File tree Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,18 @@ String _screenSegment(ClassInsight<ModelGenerateScreenBindings> insight) {
206
206
}
207
207
208
208
final _interpolator = TemplateInterpolator <ClassInsight <GenerateScreenBindings >>({
209
+ '___CONDITION___' : (insight) {
210
+ if (insight.annotation.isAccessibleOnlyIfLoggedInAndVerified == true ) {
211
+ return 'isLoggedInAndVerified' ;
212
+ }
213
+ if (insight.annotation.isAccessibleOnlyIfLoggedIn == true ) {
214
+ return 'isLoggedIn' ;
215
+ }
216
+ if (insight.annotation.isAccessibleOnlyIfLoggedOut == true ) {
217
+ return 'isLoggedOut' ;
218
+ }
219
+ return 'null' ;
220
+ },
209
221
'___SCREEN_KEY___' : _screenKey,
210
222
'___SCREEN_SEGMENT___' : _screenSegment,
211
223
'___WIDGET_NAME___' : (insight) {
Original file line number Diff line number Diff line change 8
8
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
9
9
//.title~
10
10
11
- import 'package:df_screen/df_screen.dart';
12
- import 'package:flutter/widgets.dart' show SizedBox;
13
-
14
- import '_screens.g.dart';
11
+ import '/_common.dart';
15
12
16
13
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
17
14
15
+ bool isLoggedInAndEmailVerified() {
16
+ return DI.global<AuthServiceInterface>().map((e) => e.loggedInAndEmailVerified).unwrapOr(false);
17
+ }
18
+
19
+ bool isLoggedIn() {
20
+ return DI.global<AuthServiceInterface>().map((e) => e.loggedIn).unwrapOr(false);
21
+ }
22
+
23
+ bool isLoggedOut() {
24
+ return DI.global<AuthServiceInterface>().map((e) => e.loggedOut).unwrapOr(false);
25
+ }
26
+
18
27
final class EmptyScreenState extends RouteState {
19
28
EmptyScreenState() : super.parse('/empty');
20
29
}
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ class ___WIDGET_NAME___RouteBuilder extends RouteBuilder<___WIDGET_NAME___Extra?
76
76
___WIDGET_NAME___RouteBuilder()
77
77
: super(
78
78
routeState: ___WIDGET_NAME___RouteState(),
79
+ condition: ___CONDITION___,
79
80
builder: (context, routeState) {
80
81
return ___WIDGET_NAME___(routeState: routeState);
81
82
},
Original file line number Diff line number Diff line change 4
4
import 'package:flutter/material.dart';
5
5
import 'package:df_screen/df_screen.dart';
6
6
7
+ import '../_access.g.dart';
7
8
part '_bindings.g.dart';
8
9
part '_controller.dart';
9
10
part '/_state.dart';
You can’t perform that action at this time.
0 commit comments