Skip to content

Commit

Permalink
Merge pull request #474 from NearHuscarl/ci
Browse files Browse the repository at this point in the history
ci: update checks, update example constraint with plugin
  • Loading branch information
juliansteenbakker authored Dec 19, 2023
2 parents 89586c8 + 5863482 commit 71e9d78
Show file tree
Hide file tree
Showing 19 changed files with 140 additions and 126 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: flutter

on:
push:
branches:
- master
pull_request:
types: [ opened, labeled, unlabeled, synchronize ]

jobs:
analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- uses: subosito/flutter-action@v2
with:
cache: true
- name: Version
run: flutter doctor -v
- name: Install dependencies
run: flutter pub get
- name: Linter
run: flutter analyze
# Min SDK is same as current SDK
# analysis_min_sdk:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-java@v3
# with:
# java-version: 17
# distribution: temurin
# - uses: subosito/[email protected]
# with:
# cache: true
# flutter-version: '3.13.9'
# channel: 'stable'
# - name: Version
# run: flutter doctor -v
# - name: Install dependencies
# run: flutter pub get
# - name: Linter
# run: flutter analyze
formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- uses: subosito/flutter-action@v2
with:
cache: true
- name: Format
run: dart format --set-exit-if-changed .
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
- uses: subosito/flutter-action@v2
with:
cache: true
- name: Version
run: flutter doctor -v
- name: Install dependencies
run: flutter pub get
- name: Linter
run: flutter test
28 changes: 0 additions & 28 deletions .github/workflows/test.yml

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 5.0.0
Breaking Changes:
- [Android] Upgraded to Gradle 8. Due to a dependency update, the minimum Flutter version is changed to 3.16.

Features:
- Added keyboardDismissBehavior parameter to select the behaviour of the keyboard when scrolling.
- Added initialIsoCode parameter to set the initial iso code for the widget [LoginUserType.intlPhone]. Defaults to ['US'] if not specified.
- The card surfaceTintColor can now be set using cardTheme.surfaceTintColor.

Bugs fixed:
- Navigate to login page after pressing sign up confirm button when loginAfterSignUp is disabled and additionalSignupData is not null.
- Added context checks to prevent crashes when widget is not mounted anymore.

## 4.2.1
- Added dynamic prefix-icon on recover card based on user type. (thanks @lucaloiacono !)

Expand Down
52 changes: 11 additions & 41 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
Expand All @@ -22,52 +23,21 @@

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.packages
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# Symbolication related
app.*.symbols

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Obfuscation related
app.*.map.json

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
11 changes: 4 additions & 7 deletions example/lib/custom_route.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import 'package:flutter/material.dart';

import 'package:login_example/login_screen.dart';
import 'package:flutter_login_example/login_screen.dart';

class FadePageRoute<T> extends MaterialPageRoute<T> {
FadePageRoute({
required WidgetBuilder builder,
RouteSettings? settings,
}) : super(
builder: builder,
settings: settings,
);
required super.builder,
super.settings,
});

@override
Duration get transitionDuration => const Duration(milliseconds: 600);
Expand Down
12 changes: 6 additions & 6 deletions example/lib/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_login/theme.dart';
import 'package:flutter_login/widgets.dart';
import 'package:flutter_login_example/constants.dart';
import 'package:flutter_login_example/transition_route_observer.dart';
import 'package:flutter_login_example/widgets/animated_numeric_text.dart';
import 'package:flutter_login_example/widgets/fade_in.dart';
import 'package:flutter_login_example/widgets/round_button.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:login_example/constants.dart';
import 'package:login_example/transition_route_observer.dart';
import 'package:login_example/widgets/animated_numeric_text.dart';
import 'package:login_example/widgets/fade_in.dart';
import 'package:login_example/widgets/round_button.dart';

class DashboardScreen extends StatefulWidget {
static const routeName = '/dashboard';

const DashboardScreen({Key? key}) : super(key: key);
const DashboardScreen({super.key});

@override
State<DashboardScreen> createState() => _DashboardScreenState();
Expand Down
12 changes: 6 additions & 6 deletions example/lib/login_screen.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
import 'package:flutter_login/flutter_login.dart';
import 'package:flutter_login_example/constants.dart';
import 'package:flutter_login_example/custom_route.dart';
import 'package:flutter_login_example/dashboard_screen.dart';
import 'package:flutter_login_example/users.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:login_example/constants.dart';
import 'package:login_example/custom_route.dart';
import 'package:login_example/dashboard_screen.dart';
import 'package:login_example/users.dart';

class LoginScreen extends StatelessWidget {
static const routeName = '/auth';

const LoginScreen({Key? key}) : super(key: key);
const LoginScreen({super.key});

Duration get loginTime => Duration(milliseconds: timeDilation.ceil() * 2250);

Expand Down Expand Up @@ -280,7 +280,7 @@ class LoginScreen extends StatelessWidget {
}

class IntroWidget extends StatelessWidget {
const IntroWidget({Key? key}) : super(key: key);
const IntroWidget({super.key});

@override
Widget build(BuildContext context) {
Expand Down
8 changes: 4 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:login_example/dashboard_screen.dart';
import 'package:login_example/login_screen.dart';
import 'package:login_example/transition_route_observer.dart';
import 'package:flutter_login_example/dashboard_screen.dart';
import 'package:flutter_login_example/login_screen.dart';
import 'package:flutter_login_example/transition_route_observer.dart';

void main() {
SystemChrome.setSystemUIOverlayStyle(
Expand All @@ -15,7 +15,7 @@ void main() {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/transition_route_observer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class TransitionRouteObserver<R extends TransitionRoute<dynamic>?>
///
/// This is used with [TransitionRouteObserver] to make a widget aware of changes to the
/// [Navigator]'s session history.
abstract class TransitionRouteAware {
mixin TransitionRouteAware {
/// Called when the top route has been popped off, and the current route
/// shows up.
void didPopNext() {}
Expand Down
5 changes: 2 additions & 3 deletions example/lib/widgets/animated_numeric_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:intl/intl.dart';

class AnimatedNumericText extends StatelessWidget {
AnimatedNumericText({
Key? key,
super.key,
required this.initialValue,
required this.targetValue,
required this.controller,
Expand All @@ -19,8 +19,7 @@ class AnimatedNumericText extends StatelessWidget {
parent: controller,
curve: curve,
),
),
super(key: key);
);

final double initialValue;
final double targetValue;
Expand Down
9 changes: 2 additions & 7 deletions example/lib/widgets/fade_in.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum FadeDirection {

class FadeIn extends StatefulWidget {
const FadeIn({
Key? key,
super.key,
this.fadeDirection = FadeDirection.startToEnd,
this.offset = 1.0,
this.controller,
Expand All @@ -20,8 +20,7 @@ class FadeIn extends StatefulWidget {
controller == null && duration != null ||
controller != null && duration == null,
),
assert(offset > 0),
super(key: key);
assert(offset > 0);

/// [FadeIn] animation can be controlled via external [controller]. If
/// [controller] is not provided, it will use the default internal controller
Expand Down Expand Up @@ -66,19 +65,15 @@ class _FadeInState extends State<FadeIn> with SingleTickerProviderStateMixin {
case FadeDirection.startToEnd:
begin = Offset(-offset, 0);
end = Offset.zero;
break;
case FadeDirection.endToStart:
begin = Offset(offset, 0);
end = Offset.zero;
break;
case FadeDirection.topToBottom:
begin = Offset(0, -offset);
end = Offset.zero;
break;
case FadeDirection.bottomToTop:
begin = Offset(0, offset);
end = Offset.zero;
break;
}

_slideAnimation = Tween<Offset>(
Expand Down
4 changes: 2 additions & 2 deletions example/lib/widgets/round_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import 'package:flutter/material.dart';

class RoundButton extends StatefulWidget {
const RoundButton({
Key? key,
super.key,
required this.icon,
required this.onPressed,
required this.label,
required this.loadingController,
this.interval = const Interval(0, 1, curve: Curves.ease),
this.size = 60,
}) : super(key: key);
});

final Widget? icon;
final VoidCallback onPressed;
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.2.3"
version: "4.3.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
Loading

0 comments on commit 71e9d78

Please sign in to comment.