Skip to content

Commit

Permalink
chore: fix some static analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Milad-Akarie committed Jan 9, 2025
1 parent 0f73986 commit adde731
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 111 deletions.
26 changes: 13 additions & 13 deletions auto_route/example/lib/declarative/declarative.router.gr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class AgeInputRoute extends _i2.PageRouteInfo<AgeInputRouteArgs> {
required _i3.ValueChanged<int> onAgeSubmitted,
List<_i2.PageRouteInfo>? children,
}) : super(
AgeInputRoute.name,
args: AgeInputRouteArgs(key: key, onAgeSubmitted: onAgeSubmitted),
initialChildren: children,
);
AgeInputRoute.name,
args: AgeInputRouteArgs(key: key, onAgeSubmitted: onAgeSubmitted),
initialChildren: children,
);

static const String name = 'AgeInputRoute';

Expand Down Expand Up @@ -57,7 +57,7 @@ class AgeInputRouteArgs {
/// [_i1.MainScreen]
class MainRoute extends _i2.PageRouteInfo<void> {
const MainRoute({List<_i2.PageRouteInfo>? children})
: super(MainRoute.name, initialChildren: children);
: super(MainRoute.name, initialChildren: children);

static const String name = 'MainRoute';

Expand All @@ -77,10 +77,10 @@ class NameInputRoute extends _i2.PageRouteInfo<NameInputRouteArgs> {
required _i3.ValueChanged<String> onNameSubmitted,
List<_i2.PageRouteInfo>? children,
}) : super(
NameInputRoute.name,
args: NameInputRouteArgs(key: key, onNameSubmitted: onNameSubmitted),
initialChildren: children,
);
NameInputRoute.name,
args: NameInputRouteArgs(key: key, onNameSubmitted: onNameSubmitted),
initialChildren: children,
);

static const String name = 'NameInputRoute';

Expand Down Expand Up @@ -118,10 +118,10 @@ class ResultRoute extends _i2.PageRouteInfo<ResultRouteArgs> {
required _i3.VoidCallback onReset,
List<_i2.PageRouteInfo>? children,
}) : super(
ResultRoute.name,
args: ResultRouteArgs(key: key, profile: profile, onReset: onReset),
initialChildren: children,
);
ResultRoute.name,
args: ResultRouteArgs(key: key, profile: profile, onReset: onReset),
initialChildren: children,
);

static const String name = 'ResultRoute';

Expand Down
74 changes: 36 additions & 38 deletions auto_route/example/lib/mobile/router/router.gr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import 'package:flutter/material.dart' as _i9;
/// [_i1.BookDetailsPage]
class BookDetailsRoute extends _i8.PageRouteInfo<BookDetailsRouteArgs> {
BookDetailsRoute({int id = -3, List<_i8.PageRouteInfo>? children})
: super(
BookDetailsRoute.name,
args: BookDetailsRouteArgs(id: id),
rawPathParams: {'id': id},
initialChildren: children,
);
: super(
BookDetailsRoute.name,
args: BookDetailsRouteArgs(id: id),
rawPathParams: {'id': id},
initialChildren: children,
);

static const String name = 'BookDetailsRoute';

Expand Down Expand Up @@ -59,7 +59,7 @@ class BookDetailsRouteArgs {
/// [_i2.BookListScreen]
class BookListRoute extends _i8.PageRouteInfo<void> {
const BookListRoute({List<_i8.PageRouteInfo>? children})
: super(BookListRoute.name, initialChildren: children);
: super(BookListRoute.name, initialChildren: children);

static const String name = 'BookListRoute';

Expand All @@ -75,7 +75,7 @@ class BookListRoute extends _i8.PageRouteInfo<void> {
/// [_i3.HomePage]
class HomeRoute extends _i8.PageRouteInfo<void> {
const HomeRoute({List<_i8.PageRouteInfo>? children})
: super(HomeRoute.name, initialChildren: children);
: super(HomeRoute.name, initialChildren: children);

static const String name = 'HomeRoute';

Expand All @@ -96,14 +96,14 @@ class LoginRoute extends _i8.PageRouteInfo<LoginRouteArgs> {
bool showBackButton = true,
List<_i8.PageRouteInfo>? children,
}) : super(
LoginRoute.name,
args: LoginRouteArgs(
key: key,
onLoginResult: onLoginResult,
showBackButton: showBackButton,
),
initialChildren: children,
);
LoginRoute.name,
args: LoginRouteArgs(
key: key,
onLoginResult: onLoginResult,
showBackButton: showBackButton,
),
initialChildren: children,
);

static const String name = 'LoginRoute';

Expand Down Expand Up @@ -149,11 +149,11 @@ class MyBooksRoute extends _i8.PageRouteInfo<MyBooksRouteArgs> {
String? filter = 'none',
List<_i8.PageRouteInfo>? children,
}) : super(
MyBooksRoute.name,
args: MyBooksRouteArgs(key: key, filter: filter),
rawQueryParams: {'filter': filter},
initialChildren: children,
);
MyBooksRoute.name,
args: MyBooksRouteArgs(key: key, filter: filter),
rawQueryParams: {'filter': filter},
initialChildren: children,
);

static const String name = 'MyBooksRoute';

Expand All @@ -162,10 +162,9 @@ class MyBooksRoute extends _i8.PageRouteInfo<MyBooksRouteArgs> {
builder: (data) {
final queryParams = data.queryParams;
final args = data.argsAs<MyBooksRouteArgs>(
orElse:
() => MyBooksRouteArgs(
filter: queryParams.optString('filter', 'none'),
),
orElse: () => MyBooksRouteArgs(
filter: queryParams.optString('filter', 'none'),
),
);
return _i5.MyBooksPage(key: args.key, filter: args.filter);
},
Expand All @@ -189,7 +188,7 @@ class MyBooksRouteArgs {
/// [_i6.ProfilePage]
class ProfileRoute extends _i8.PageRouteInfo<void> {
const ProfileRoute({List<_i8.PageRouteInfo>? children})
: super(ProfileRoute.name, initialChildren: children);
: super(ProfileRoute.name, initialChildren: children);

static const String name = 'ProfileRoute';

Expand All @@ -210,12 +209,12 @@ class SettingsTab extends _i8.PageRouteInfo<SettingsTabArgs> {
String query = 'none',
List<_i8.PageRouteInfo>? children,
}) : super(
SettingsTab.name,
args: SettingsTabArgs(key: key, tab: tab, query: query),
rawPathParams: {'tab': tab},
rawQueryParams: {'query': query},
initialChildren: children,
);
SettingsTab.name,
args: SettingsTabArgs(key: key, tab: tab, query: query),
rawPathParams: {'tab': tab},
rawQueryParams: {'query': query},
initialChildren: children,
);

static const String name = 'SettingsTab';

Expand All @@ -225,11 +224,10 @@ class SettingsTab extends _i8.PageRouteInfo<SettingsTabArgs> {
final pathParams = data.inheritedPathParams;
final queryParams = data.queryParams;
final args = data.argsAs<SettingsTabArgs>(
orElse:
() => SettingsTabArgs(
tab: pathParams.getString('tab', 'none'),
query: queryParams.getString('query', 'none'),
),
orElse: () => SettingsTabArgs(
tab: pathParams.getString('tab', 'none'),
query: queryParams.getString('query', 'none'),
),
);
return _i7.SettingsPage(key: args.key, tab: args.tab, query: args.query);
},
Expand All @@ -255,7 +253,7 @@ class SettingsTabArgs {
/// [_i3.WelcomeScreen]
class WelcomeRoute extends _i8.PageRouteInfo<void> {
const WelcomeRoute({List<_i8.PageRouteInfo>? children})
: super(WelcomeRoute.name, initialChildren: children);
: super(WelcomeRoute.name, initialChildren: children);

static const String name = 'WelcomeRoute';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import 'package:example/nested-navigation/nested_navigation.router.dart' as _i1;
/// [_i1.FirstScreen]
class FirstRoute extends _i2.PageRouteInfo<void> {
const FirstRoute({List<_i2.PageRouteInfo>? children})
: super(FirstRoute.name, initialChildren: children);
: super(FirstRoute.name, initialChildren: children);

static const String name = 'FirstRoute';

Expand All @@ -32,7 +32,7 @@ class FirstRoute extends _i2.PageRouteInfo<void> {
/// [_i1.HostScreen]
class HostRoute extends _i2.PageRouteInfo<void> {
const HostRoute({List<_i2.PageRouteInfo>? children})
: super(HostRoute.name, initialChildren: children);
: super(HostRoute.name, initialChildren: children);

static const String name = 'HostRoute';

Expand All @@ -48,7 +48,7 @@ class HostRoute extends _i2.PageRouteInfo<void> {
/// [_i1.SecondScreen]
class SecondRoute extends _i2.PageRouteInfo<void> {
const SecondRoute({List<_i2.PageRouteInfo>? children})
: super(SecondRoute.name, initialChildren: children);
: super(SecondRoute.name, initialChildren: children);

static const String name = 'SecondRoute';

Expand Down
Loading

0 comments on commit adde731

Please sign in to comment.