Skip to content

Commit b055054

Browse files
committed
update
1 parent 81f8a48 commit b055054

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

templates/v6/access.dart.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ ModelScreenConfiguration? currentUrlToConfiguration({
8282
required bool loggedIn,
8383
required bool verified,
8484
}) {
85-
return findScreenFromConfigurationAndAuthService(
86-
configuration: ModelScreenConfiguration(
87-
args: Uri.base.queryParameters,
88-
path: Uri.base.path,
89-
),
90-
loggedIn: loggedIn,
91-
verified: verified,
92-
)?.configuration;
85+
return letAsOrNull<ModelScreenConfiguration>(
86+
findScreenFromConfigurationAndAuthService(
87+
configuration: ModelScreenConfiguration(
88+
args: Uri.base.queryParameters,
89+
path: Uri.base.path,
90+
),
91+
loggedIn: loggedIn,
92+
verified: verified,
93+
)?.extra,
9394
}
9495
9596
/// Translates the current URL into a [ModelScreenConfiguration] under the
@@ -99,15 +100,17 @@ ModelScreenConfiguration? currentUrlToConfiguration({
99100
/// screen is accessible, its configuration is returned; otherwise, `null` is
100101
/// returned.
101102
ModelScreenConfiguration? currentUrlToLoginConfiguration() {
102-
return findScreenFromConfiguration(
103-
configuration: ModelScreenConfiguration(
104-
args: Uri.base.queryParameters,
105-
path: Uri.base.path,
106-
),
107-
isLoggedInAndVerified: true,
108-
isLoggedIn: true,
109-
isLoggedOut: false,
110-
)?.configuration;
103+
return letAsOrNull<ModelScreenConfiguration>(
104+
findScreenFromConfiguration(
105+
configuration: ModelScreenConfiguration(
106+
args: Uri.base.queryParameters,
107+
path: Uri.base.path,
108+
),
109+
isLoggedInAndVerified: true,
110+
isLoggedIn: true,
111+
isLoggedOut: false,
112+
)?.extra,
113+
);
111114
}
112115
113116
/// Translates the current URL into a [ModelScreenConfiguration] under the
@@ -116,14 +119,16 @@ ModelScreenConfiguration? currentUrlToLoginConfiguration() {
116119
/// logged out. If a corresponding screen is accessible, its configuration is
117120
/// returned; otherwise, `null` is returned.
118121
ModelScreenConfiguration? currentUrlToLogoutConfiguration() {
119-
return findScreenFromConfiguration(
120-
configuration: ModelScreenConfiguration(
121-
args: Uri.base.queryParameters,
122-
path: Uri.base.path,
123-
),
124-
isLoggedInAndVerified: false,
125-
isLoggedIn: false,
126-
isLoggedOut: true,
127-
)?.configuration;
122+
return letAsOrNull<ModelScreenConfiguration>(
123+
findScreenFromConfiguration(
124+
configuration: ModelScreenConfiguration(
125+
args: Uri.base.queryParameters,
126+
path: Uri.base.path,
127+
),
128+
isLoggedInAndVerified: false,
129+
isLoggedIn: false,
130+
isLoggedOut: true,
131+
)?.extra,
132+
);
128133
}
129134
```

0 commit comments

Comments
 (0)