diff --git a/.github/workflows/run_ci_flutter_downgrade_analyze.yml b/.github/workflows/run_ci_flutter_downgrade_analyze.yml new file mode 100644 index 0000000..04324d7 --- /dev/null +++ b/.github/workflows/run_ci_flutter_downgrade_analyze.yml @@ -0,0 +1,32 @@ +name: Run CI Flutter downgrade analyze +on: + push: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' # every sunday at midnight + +jobs: + test: + name: Test on ${{ matrix.os }} / ${{ matrix.flutter }} + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: . + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + flutter: [stable] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '12.x' + - uses: subosito/flutter-action@v2 + with: + channel: ${{ matrix.flutter }} + - run: dart --version + - run: flutter --version + - run: dart pub global activate dev_test + - run: dart pub global run dev_test:run_ci --pub-downgrade --analyze --no-override --recursive \ No newline at end of file diff --git a/app_bloc/lib/bloc_provider.dart b/app_bloc/lib/bloc_provider.dart index 3433c2b..4071148 100644 --- a/app_bloc/lib/bloc_provider.dart +++ b/app_bloc/lib/bloc_provider.dart @@ -7,8 +7,8 @@ class BlocProvider extends StatefulWidget { final Widget child; final T Function() blocBuilder; - const BlocProvider({Key? key, required this.blocBuilder, required this.child}) - : super(key: key); + const BlocProvider( + {super.key, required this.blocBuilder, required this.child}); @override State createState() => _BlocProviderState(); @@ -48,10 +48,10 @@ class _BlocProviderState extends State { class _BlocProviderInherited extends InheritedWidget { const _BlocProviderInherited({ - Key? key, - required Widget child, + super.key, + required super.child, required this.bloc, - }) : super(key: key, child: child); + }); final T bloc; diff --git a/app_bloc/test/bloc_provider_widget_test.dart b/app_bloc/test/bloc_provider_widget_test.dart index 05a1d7d..c6696de 100644 --- a/app_bloc/test/bloc_provider_widget_test.dart +++ b/app_bloc/test/bloc_provider_widget_test.dart @@ -7,7 +7,7 @@ class TestBloc extends BaseBloc { } class TestApp extends StatelessWidget { - const TestApp({Key? key}) : super(key: key); + const TestApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( diff --git a/app_emit_builder/lib/emit_builder.dart b/app_emit_builder/lib/emit_builder.dart index 7008714..5b49d28 100644 --- a/app_emit_builder/lib/emit_builder.dart +++ b/app_emit_builder/lib/emit_builder.dart @@ -10,8 +10,7 @@ class EmitFutureOrBuilder extends StatefulWidget { final AsyncWidgetBuilder builder; const EmitFutureOrBuilder( - {Key? key, required this.futureOr, required this.builder}) - : super(key: key); + {super.key, required this.futureOr, required this.builder}); @override // ignore: library_private_types_in_public_api diff --git a/app_navigator/lib/src/content_navigator.dart b/app_navigator/lib/src/content_navigator.dart index 1a71097..8ff7a22 100644 --- a/app_navigator/lib/src/content_navigator.dart +++ b/app_navigator/lib/src/content_navigator.dart @@ -228,7 +228,7 @@ class ContentNavigatorBloc extends BaseBloc { void transientPopUntilPath(BuildContext context, ContentPath path) { if (_routeAwareManager != null) { _routeAwareManager!.popLock.synchronized(() { - _popUntilPath(context, path); + _popUntilPath(context, path, handleRoot: true); /// Late cleanup routeAwareManager.popLock.synchronized(() { @@ -266,15 +266,18 @@ class ContentNavigatorBloc extends BaseBloc { } /// Returns true if fount - bool _popUntilPath(BuildContext context, ContentPath path) { + /// + /// if handleRoot is true, the root is handled as well as excluded from onResume + bool _popUntilPath(BuildContext context, ContentPath path, + {bool? handleRoot}) { var found = false; Navigator.of(context).popUntil((route) { var name = route.settings.name; if (name != null) { var matches = path.matchesString(name); - if (!matches) { - if (_routeAwareManager != null) { + if (_routeAwareManager != null) { + if (!matches || (handleRoot ?? false)) { routeAwareManager.popPaths.add(name); } } @@ -526,8 +529,7 @@ class ContentNavigator extends StatefulWidget { BlocProvider.of(context); const ContentNavigator( - {Key? key, required this.def, this.child, this.observers}) - : super(key: key); + {super.key, required this.def, this.child, this.observers}); @override State createState() => _ContentNavigatorState(); diff --git a/app_navigator/lib/src/content_path_route_settings.dart b/app_navigator/lib/src/content_path_route_settings.dart index 5c9b7c8..77d295f 100644 --- a/app_navigator/lib/src/content_path_route_settings.dart +++ b/app_navigator/lib/src/content_path_route_settings.dart @@ -4,8 +4,7 @@ import 'import.dart'; /// arguments are discouraged and null should be handled @Deprecated('Not supported anymore') class ContentRoutePath extends ContentPathRouteSettings { - ContentRoutePath(ContentPath path, [Object? arguments]) - : super(path, arguments); + ContentRoutePath(super.path, [super.arguments]); } class ContentPathRouteSettings { diff --git a/app_navigator/lib/src/route_aware.dart b/app_navigator/lib/src/route_aware.dart index 781e3cd..8de62ef 100644 --- a/app_navigator/lib/src/route_aware.dart +++ b/app_navigator/lib/src/route_aware.dart @@ -40,12 +40,24 @@ mixin RouteAwareMixin on State @override void didPushNext() { - onPause(); + _onPauseIfResumed(); + } + + void _onPauseIfResumed() { + if (_resumed) { + onPause(); + } + } + + void _onResumeIfPaused() { + if (!_resumed) { + onResume(); + } } @override void didPop() { - onPause(); + _onPauseIfResumed(); } @mustCallSuper @@ -61,7 +73,7 @@ mixin RouteAwareMixin on State @override void didPush() { // print('didPush'); - onResume(); + _onResumeIfPaused(); } @override @@ -84,11 +96,11 @@ mixin RouteAwareMixin on State } }).then((_) { if (needOnResume) { - onResume(); + _onResumeIfPaused(); } }); } else { - onResume(); + _onResumeIfPaused(); } if (widget is RouteAwareWithPath) {} // print('didPopNext ${routeAwareManager.popPaths}'); diff --git a/app_navigator/lib/src/route_aware_state.dart b/app_navigator/lib/src/route_aware_state.dart index 0fb00d7..8edad3f 100644 --- a/app_navigator/lib/src/route_aware_state.dart +++ b/app_navigator/lib/src/route_aware_state.dart @@ -11,8 +11,7 @@ abstract class RouteAwareStatefulWidget extends StatefulWidget implements RouteAwareWithPath { @override final ContentPath contentPath; - const RouteAwareStatefulWidget({Key? key, required this.contentPath}) - : super(key: key); + const RouteAwareStatefulWidget({super.key, required this.contentPath}); @override RouteAwareState createState(); diff --git a/app_platform/lib/platform.dart b/app_platform/lib/platform.dart index 6794a64..df56c50 100644 --- a/app_platform/lib/platform.dart +++ b/app_platform/lib/platform.dart @@ -1,4 +1,6 @@ /// Do not include with flutter_test. or add suffix. +library; + import 'package:tekartik_app_platform/app_platform.dart'; /// Safe (false) on the web diff --git a/app_rx_utils/lib/src/behavior_subject_builder.dart b/app_rx_utils/lib/src/behavior_subject_builder.dart index 27f00eb..9f9bf46 100644 --- a/app_rx_utils/lib/src/behavior_subject_builder.dart +++ b/app_rx_utils/lib/src/behavior_subject_builder.dart @@ -6,8 +6,7 @@ class BehaviorSubjectBuilder extends StatelessWidget { final AsyncWidgetBuilder builder; const BehaviorSubjectBuilder( - {Key? key, required this.subject, required this.builder}) - : super(key: key); + {super.key, required this.subject, required this.builder}); @override Widget build(BuildContext context) { diff --git a/app_rx_utils/lib/src/value_stream_builder.dart b/app_rx_utils/lib/src/value_stream_builder.dart index ebe40f4..50ea1e4 100644 --- a/app_rx_utils/lib/src/value_stream_builder.dart +++ b/app_rx_utils/lib/src/value_stream_builder.dart @@ -6,8 +6,7 @@ class ValueStreamBuilder extends StatelessWidget { final AsyncWidgetBuilder builder; const ValueStreamBuilder( - {Key? key, required this.stream, required this.builder}) - : super(key: key); + {super.key, required this.stream, required this.builder}); @override Widget build(BuildContext context) { diff --git a/app_rx_utils/test/app_rx_utils_widget_test.dart b/app_rx_utils/test/app_rx_utils_widget_test.dart index 96d102d..0e21902 100644 --- a/app_rx_utils/test/app_rx_utils_widget_test.dart +++ b/app_rx_utils/test/app_rx_utils_widget_test.dart @@ -6,11 +6,11 @@ import 'package:tekartik_app_rx_utils/app_rx_utils.dart'; abstract class _BaseWidget extends StatelessWidget { final subject = BehaviorSubject(); - _BaseWidget({Key? key}) : super(key: key); + _BaseWidget({super.key}); } class TestValueStream extends _BaseWidget { - TestValueStream({Key? key}) : super(key: key); + TestValueStream({super.key}); @override Widget build(BuildContext context) { @@ -25,7 +25,7 @@ class TestValueStream extends _BaseWidget { } class TestBehaviorSubject extends _BaseWidget { - TestBehaviorSubject({Key? key}) : super(key: key); + TestBehaviorSubject({super.key}); @override Widget build(BuildContext context) { diff --git a/app_sembast/lib/src/sembast.dart b/app_sembast/lib/src/sembast.dart index 2d3f189..5d31353 100644 --- a/app_sembast/lib/src/sembast.dart +++ b/app_sembast/lib/src/sembast.dart @@ -1,4 +1,5 @@ /// Define [getDatabaseFactory] for a common support on Flutter and Flutter Web +library; export 'sembast_stub.dart' if (dart.library.html) 'sembast_web.dart' if (dart.library.io) 'sembast_io.dart'; diff --git a/app_widget/lib/src/future_or_builder.dart b/app_widget/lib/src/future_or_builder.dart index 7b7ff8a..e9b467f 100644 --- a/app_widget/lib/src/future_or_builder.dart +++ b/app_widget/lib/src/future_or_builder.dart @@ -12,8 +12,7 @@ class FutureOrBuilder extends StatelessWidget { /// FutureOr Builder. const FutureOrBuilder( - {Key? key, required this.futureOr, required this.builder}) - : super(key: key); + {super.key, required this.futureOr, required this.builder}); @override Widget build(BuildContext context) { diff --git a/app_widget/lib/src/progress.dart b/app_widget/lib/src/progress.dart index ec397b3..2ffd146 100644 --- a/app_widget/lib/src/progress.dart +++ b/app_widget/lib/src/progress.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; /// A bad but efficient catch all place holder. class CenteredProgress extends StatelessWidget { - const CenteredProgress({Key? key}) : super(key: key); + const CenteredProgress({super.key}); @override Widget build(BuildContext context) { return const Center(child: CircularProgressIndicator()); @@ -11,7 +11,7 @@ class CenteredProgress extends StatelessWidget { /// Small icon, typically for leading/trailing class SmallProgress extends StatelessWidget { - const SmallProgress({Key? key}) : super(key: key); + const SmallProgress({super.key}); @override Widget build(BuildContext context) { var size = IconTheme.of(context).size!; @@ -29,7 +29,7 @@ class SmallProgress extends StatelessWidget { /// Small icon, typically for leading/trailing class SmallConnectivityError extends StatelessWidget { - const SmallConnectivityError({Key? key}) : super(key: key); + const SmallConnectivityError({super.key}); @override Widget build(BuildContext context) { var theme = Theme.of(context);