@@ -32,16 +32,15 @@ class HomeScreenConfiguration extends ModelScreenConfiguration {
3232 //
3333
3434 HomeScreenConfiguration .optional ({Map <dynamic , dynamic >? args})
35- : super .optional (
36- title: null ,
37- path: _PATH ,
38- args: args ?? {},
39- isAccessibleOnlyIfLoggedInAndVerified:
40- _IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED ,
41- isAccessibleOnlyIfLoggedIn: _IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ,
42- isAccessibleOnlyIfLoggedOut: _IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT ,
43- isRedirectable: _IS_REDIRECTABLE ,
44- );
35+ : super .optional (
36+ title: null ,
37+ path: _PATH ,
38+ args: args ?? {},
39+ isAccessibleOnlyIfLoggedInAndVerified: _IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED ,
40+ isAccessibleOnlyIfLoggedIn: _IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ,
41+ isAccessibleOnlyIfLoggedOut: _IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT ,
42+ isRedirectable: _IS_REDIRECTABLE ,
43+ );
4544
4645 //
4746 //
@@ -60,16 +59,14 @@ class HomeScreenConfiguration extends ModelScreenConfiguration {
6059 static const TR_KEY = _TR_KEY ;
6160
6261 /// Whether the corresponding [Screen] is only accessible if the user is logged in and verified.
63- static const IS_ACCESSIBLE_ONLY_IF_LOGGED_IN =
64- _IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ;
62+ static const IS_ACCESSIBLE_ONLY_IF_LOGGED_IN = _IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ;
6563
6664 /// Whether the corresponding [Screen] is only accessible if the user is logged in.
6765 static const IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED =
6866 _IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED ;
6967
7068 /// Whether the corresponding [Screen] is only accessible if the user is logged out.
71- static const IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT =
72- _IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT ;
69+ static const IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT = _IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT ;
7370
7471 /// Whether the corresponding [Screen] is redirectable, i.e., if it can be requested from the browser URL.
7572 static const IS_REDIRECTABLE = _IS_REDIRECTABLE ;
@@ -87,15 +84,13 @@ abstract base class _ControllerBroker<T1 extends HomeScreen, T2 extends _State>
8784 late final state = super .superState as T2 ;
8885
8986 /// The [ModelScreenConfiguration] that corresponds to `this` controller.
90- late final configuration =
91- screen.extra is HomeScreenConfiguration
92- ? screen.extra as HomeScreenConfiguration
93- : HomeScreenConfiguration .optional (
94- args:
95- screen.extra is ModelScreenConfiguration
96- ? (screen.extra as ModelScreenConfiguration ).args
97- : {},
98- );
87+ late final configuration = screen.extra is HomeScreenConfiguration
88+ ? screen.extra as HomeScreenConfiguration
89+ : HomeScreenConfiguration .optional (
90+ args: screen.extra is ModelScreenConfiguration
91+ ? (screen.extra as ModelScreenConfiguration ).args
92+ : {},
93+ );
9994
10095 _ControllerBroker (super .superScreen, super .superState, [super .extra]);
10196}
@@ -111,17 +106,13 @@ final generatedHomeScreenRoute = GoRoute(
111106 key: state.pageKey,
112107 child: HomeScreen (
113108 key: _globalKey,
114- extra:
115- extra ??
109+ extra: extra ??
116110 urlToScreenConfiguration (
117111 url: state.uri,
118- isAccessibleOnlyIfLoggedIn:
119- HomeScreenConfiguration .IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ,
112+ isAccessibleOnlyIfLoggedIn: HomeScreenConfiguration .IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ,
120113 isAccessibleOnlyIfLoggedInAndVerified:
121- HomeScreenConfiguration
122- .IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED ,
123- isAccessibleOnlyIfLoggedOut:
124- HomeScreenConfiguration .IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT ,
114+ HomeScreenConfiguration .IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED ,
115+ isAccessibleOnlyIfLoggedOut: HomeScreenConfiguration .IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT ,
125116 isRedirectable: HomeScreenConfiguration .IS_REDIRECTABLE ,
126117 title: null ,
127118 ),
@@ -141,8 +132,7 @@ Screen? makerHomeScreen(
141132 bool isLoggedIn,
142133 bool isLoggedOut,
143134) {
144- if ((_IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED &&
145- ! isLoggedInAndVerified) ||
135+ if ((_IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED && ! isLoggedInAndVerified) ||
146136 (_IS_ACCESSIBLE_ONLY_IF_LOGGED_IN && ! isLoggedIn) ||
147137 (_IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT && ! isLoggedOut)) {
148138 return null ;
@@ -165,27 +155,23 @@ Screen? makerHomeScreen(
165155typedef THomeScreenController = _ControllerBroker <HomeScreen , _State >;
166156
167157/// A [AdaptiveScreenState] type corresponding to [HomeScreen] .
168- typedef TAdaptiveHomeScreenState =
169- AdaptiveScreenState <
170- HomeScreen ,
171- HomeScreenConfiguration ,
172- HomeScreenController
173- >;
158+ typedef TAdaptiveHomeScreenState
159+ = AdaptiveScreenState <HomeScreen , HomeScreenConfiguration , HomeScreenController >;
174160
175161/// A [ScreenState] type corresponding to [HomeScreen] .
176- typedef THomeScreenState =
177- ScreenState <HomeScreen , HomeScreenConfiguration , HomeScreenController >;
162+ typedef THomeScreenState = ScreenState <HomeScreen , HomeScreenConfiguration , HomeScreenController >;
178163
179164/// A [ScreenPageState] type corresponding to [HomeScreen] .
180- typedef THomeScreenPageState <T extends ScreenPage > =
181- ScreenPageState <T , HomeScreenConfiguration , HomeScreenController >;
165+ typedef THomeScreenPageState <T extends ScreenPage >
166+ = ScreenPageState <T , HomeScreenConfiguration , HomeScreenController >;
182167
183168// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
184169
185170base class _HomeScreen extends Screen {
186171 const _HomeScreen ({
187172 required super .key,
188173 required super .extra,
174+ // ignore: unused_element_parameter
189175 super .controllerTimeout = Duration .zero,
190176 });
191177
0 commit comments