@@ -32,16 +32,15 @@ class HomeScreenConfiguration extends ModelScreenConfiguration {
32
32
//
33
33
34
34
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
+ );
45
44
46
45
//
47
46
//
@@ -60,16 +59,14 @@ class HomeScreenConfiguration extends ModelScreenConfiguration {
60
59
static const TR_KEY = _TR_KEY ;
61
60
62
61
/// 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 ;
65
63
66
64
/// Whether the corresponding [Screen] is only accessible if the user is logged in.
67
65
static const IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED =
68
66
_IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED ;
69
67
70
68
/// 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 ;
73
70
74
71
/// Whether the corresponding [Screen] is redirectable, i.e., if it can be requested from the browser URL.
75
72
static const IS_REDIRECTABLE = _IS_REDIRECTABLE ;
@@ -87,15 +84,13 @@ abstract base class _ControllerBroker<T1 extends HomeScreen, T2 extends _State>
87
84
late final state = super .superState as T2 ;
88
85
89
86
/// 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
+ );
99
94
100
95
_ControllerBroker (super .superScreen, super .superState, [super .extra]);
101
96
}
@@ -111,17 +106,13 @@ final generatedHomeScreenRoute = GoRoute(
111
106
key: state.pageKey,
112
107
child: HomeScreen (
113
108
key: _globalKey,
114
- extra:
115
- extra ??
109
+ extra: extra ??
116
110
urlToScreenConfiguration (
117
111
url: state.uri,
118
- isAccessibleOnlyIfLoggedIn:
119
- HomeScreenConfiguration .IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ,
112
+ isAccessibleOnlyIfLoggedIn: HomeScreenConfiguration .IS_ACCESSIBLE_ONLY_IF_LOGGED_IN ,
120
113
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 ,
125
116
isRedirectable: HomeScreenConfiguration .IS_REDIRECTABLE ,
126
117
title: null ,
127
118
),
@@ -141,8 +132,7 @@ Screen? makerHomeScreen(
141
132
bool isLoggedIn,
142
133
bool isLoggedOut,
143
134
) {
144
- if ((_IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED &&
145
- ! isLoggedInAndVerified) ||
135
+ if ((_IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED && ! isLoggedInAndVerified) ||
146
136
(_IS_ACCESSIBLE_ONLY_IF_LOGGED_IN && ! isLoggedIn) ||
147
137
(_IS_ACCESSIBLE_ONLY_IF_LOGGED_OUT && ! isLoggedOut)) {
148
138
return null ;
@@ -165,27 +155,23 @@ Screen? makerHomeScreen(
165
155
typedef THomeScreenController = _ControllerBroker <HomeScreen , _State >;
166
156
167
157
/// 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 >;
174
160
175
161
/// A [ScreenState] type corresponding to [HomeScreen] .
176
- typedef THomeScreenState =
177
- ScreenState <HomeScreen , HomeScreenConfiguration , HomeScreenController >;
162
+ typedef THomeScreenState = ScreenState <HomeScreen , HomeScreenConfiguration , HomeScreenController >;
178
163
179
164
/// 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 >;
182
167
183
168
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
184
169
185
170
base class _HomeScreen extends Screen {
186
171
const _HomeScreen ({
187
172
required super .key,
188
173
required super .extra,
174
+ // ignore: unused_element_parameter
189
175
super .controllerTimeout = Duration .zero,
190
176
});
191
177
0 commit comments