Skip to content

Commit ff67bd5

Browse files
committed
Update
1 parent 82693f9 commit ff67bd5

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

bin/generate_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ void main(List<String> args) async {
2020
final argsChecker = await runGenerateScreensApp(args);
2121
final r = argsChecker.screenName?.toSnakeCase() ?? '.';
2222
await runGenerateScreenBindingsApp(['-r', r]);
23+
await generateScreenAccessApp([]);
2324
}

lib/src/generate_screen/_insight_mappers.dart

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ import '_insight.dart';
1313
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
1414

1515
final insightMappers = [
16+
_InsightMapper(
17+
placeholder: Placeholders.TITLE,
18+
mapInsights: (insight) async {
19+
return insight.title;
20+
},
21+
),
1622
_InsightMapper(
1723
placeholder: Placeholders.SCREEN_CLASS,
1824
mapInsights: (insight) async {
@@ -57,9 +63,8 @@ final insightMappers = [
5763
_InsightMapper(
5864
placeholder: Placeholders.I1,
5965
mapInsights: (insight) async {
60-
final q1 = insight.queryParameters
61-
.map((e) => 'late final $e = this.configuration.$e;')
62-
.join('\n');
66+
final q1 =
67+
insight.queryParameters.map((e) => 'late final $e = this.configuration.$e;').join('\n');
6368
return q1;
6469
},
6570
),
@@ -83,17 +88,13 @@ final insightMappers = [
8388
final generateScreenBindingsArgs = [
8489
if (insight.path.isNotEmpty) "path: '${insight.path}'",
8590
if (insight.title.isNotEmpty) "defaultTitle: '${insight.title}'",
86-
if (insight.isAccessibleOnlyIfLoggedIn)
87-
'isAccessibleOnlyIfLoggedIn: true',
91+
if (insight.isAccessibleOnlyIfLoggedIn) 'isAccessibleOnlyIfLoggedIn: true',
8892
if (insight.isAccessibleOnlyIfLoggedInAndVerified)
8993
'isAccessibleOnlyIfLoggedInAndVerified: true',
90-
if (insight.isAccessibleOnlyIfLoggedOut)
91-
'isAccessibleOnlyIfLoggedOut: true',
94+
if (insight.isAccessibleOnlyIfLoggedOut) 'isAccessibleOnlyIfLoggedOut: true',
9295
if (insight.isRedirectable) 'isRedirectable: true',
93-
if (insight.internalParameters.isNotEmpty && a.isNotEmpty)
94-
'internalParameters: {$a,}',
95-
if (insight.queryParameters.isNotEmpty && b.isNotEmpty)
96-
'queryParameters: {$b,}',
96+
if (insight.internalParameters.isNotEmpty && a.isNotEmpty) 'internalParameters: {$a,}',
97+
if (insight.queryParameters.isNotEmpty && b.isNotEmpty) 'queryParameters: {$b,}',
9798
].join(',');
9899
return generateScreenBindingsArgs;
99100
},
@@ -111,6 +112,7 @@ final insightMappers = [
111112
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
112113

113114
enum Placeholders {
115+
TITLE,
114116
SCREEN_CLASS,
115117
BINDINGS_FILE,
116118
CONTROLLER_FILE,

0 commit comments

Comments
 (0)