Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Oct 22, 2023
1 parent 829be76 commit 8413d7d
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 35 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/run_ci_flutter_downgrade_analyze.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions app_bloc/lib/bloc_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class BlocProvider<T extends BaseBloc> 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<BlocProvider> createState() => _BlocProviderState<T>();
Expand Down Expand Up @@ -48,10 +48,10 @@ class _BlocProviderState<T extends BaseBloc> extends State<BlocProvider> {

class _BlocProviderInherited<T> 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;

Expand Down
2 changes: 1 addition & 1 deletion app_bloc/test/bloc_provider_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions app_emit_builder/lib/emit_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class EmitFutureOrBuilder<T> extends StatefulWidget {
final AsyncWidgetBuilder<T> 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
Expand Down
14 changes: 8 additions & 6 deletions app_navigator/lib/src/content_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(() {
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -526,8 +529,7 @@ class ContentNavigator extends StatefulWidget {
BlocProvider.of<ContentNavigatorBloc>(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<ContentNavigator> createState() => _ContentNavigatorState();
Expand Down
3 changes: 1 addition & 2 deletions app_navigator/lib/src/content_path_route_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
22 changes: 17 additions & 5 deletions app_navigator/lib/src/route_aware.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,24 @@ mixin RouteAwareMixin<T extends StatefulWidget> on State<T>

@override
void didPushNext() {
onPause();
_onPauseIfResumed();
}

void _onPauseIfResumed() {
if (_resumed) {
onPause();
}
}

void _onResumeIfPaused() {
if (!_resumed) {
onResume();
}
}

@override
void didPop() {
onPause();
_onPauseIfResumed();
}

@mustCallSuper
Expand All @@ -61,7 +73,7 @@ mixin RouteAwareMixin<T extends StatefulWidget> on State<T>
@override
void didPush() {
// print('didPush');
onResume();
_onResumeIfPaused();
}

@override
Expand All @@ -84,11 +96,11 @@ mixin RouteAwareMixin<T extends StatefulWidget> on State<T>
}
}).then((_) {
if (needOnResume) {
onResume();
_onResumeIfPaused();
}
});
} else {
onResume();
_onResumeIfPaused();
}
if (widget is RouteAwareWithPath) {}
// print('didPopNext ${routeAwareManager.popPaths}');
Expand Down
3 changes: 1 addition & 2 deletions app_navigator/lib/src/route_aware_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<RouteAwareStatefulWidget> createState();
Expand Down
2 changes: 2 additions & 0 deletions app_platform/lib/platform.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions app_rx_utils/lib/src/behavior_subject_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class BehaviorSubjectBuilder<T> extends StatelessWidget {
final AsyncWidgetBuilder<T> 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) {
Expand Down
3 changes: 1 addition & 2 deletions app_rx_utils/lib/src/value_stream_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class ValueStreamBuilder<T> extends StatelessWidget {
final AsyncWidgetBuilder<T> 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) {
Expand Down
6 changes: 3 additions & 3 deletions app_rx_utils/test/app_rx_utils_widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import 'package:tekartik_app_rx_utils/app_rx_utils.dart';
abstract class _BaseWidget extends StatelessWidget {
final subject = BehaviorSubject<String>();

_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) {
Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions app_sembast/lib/src/sembast.dart
Original file line number Diff line number Diff line change
@@ -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';
3 changes: 1 addition & 2 deletions app_widget/lib/src/future_or_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ class FutureOrBuilder<T> 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) {
Expand Down
6 changes: 3 additions & 3 deletions app_widget/lib/src/progress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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!;
Expand All @@ -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);
Expand Down

0 comments on commit 8413d7d

Please sign in to comment.