Skip to content

Commit b37b67a

Browse files
committed
fix: Fix generator bug
1 parent 6317ceb commit b37b67a

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

lib/src/generate_screen_bindings/_insight_mappers.dart

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ final _screenSegmentMapper = _InsightMapper(
3131
final path = insight.annotation.path ?? '';
3232
final screenSegment = p.joinAll(
3333
[
34-
path.isNotEmpty && path.startsWith(RegExp(r'[\\/]'))
35-
? path.substring(1)
36-
: path,
34+
path.isNotEmpty && path.startsWith(RegExp(r'[\\/]')) ? path.substring(1) : path,
3735
screenKey,
3836
],
3937
);
@@ -79,8 +77,7 @@ final insightMappers = [
7977
_InsightMapper(
8078
placeholder: Placeholders.IS_ACCESSIBLE_ONLY_IF_LOGGED_IN_AND_VERIFIED,
8179
mapInsights: (insight) async {
82-
final b =
83-
insight.annotation.isAccessibleOnlyIfLoggedInAndVerified ?? false;
80+
final b = insight.annotation.isAccessibleOnlyIfLoggedInAndVerified ?? false;
8481
return b.toString();
8582
},
8683
),
@@ -101,8 +98,7 @@ final insightMappers = [
10198
_InsightMapper(
10299
placeholder: Placeholders.IS_ALWAYS_ACCESSIBLE,
103100
mapInsights: (insight) async {
104-
final a =
105-
insight.annotation.isAccessibleOnlyIfLoggedInAndVerified ?? false;
101+
final a = insight.annotation.isAccessibleOnlyIfLoggedInAndVerified ?? false;
106102
final b = insight.annotation.isAccessibleOnlyIfLoggedIn ?? false;
107103
final c = insight.annotation.isAccessibleOnlyIfLoggedOut ?? false;
108104
if (a && b) {
@@ -145,10 +141,8 @@ final insightMappers = [
145141
_InsightMapper(
146142
placeholder: Placeholders.IP0,
147143
mapInsights: (insight) async {
148-
final params = insight.annotation.internalParameters
149-
?.map((e) => FieldUtils.ofOrNull(e))
150-
.nonNulls ??
151-
{};
144+
final params =
145+
insight.annotation.internalParameters?.map((e) => FieldUtils.ofOrNull(e)).nonNulls ?? {};
152146
if (params.isNotEmpty) {
153147
final a = params.map((e) {
154148
final fieldName = e.fieldPath!.join('_').toCamelCase();
@@ -176,10 +170,8 @@ final insightMappers = [
176170
_InsightMapper(
177171
placeholder: Placeholders.IP1,
178172
mapInsights: (insight) async {
179-
final params = insight.annotation.internalParameters
180-
?.map((e) => FieldUtils.ofOrNull(e))
181-
.nonNulls ??
182-
{};
173+
final params =
174+
insight.annotation.internalParameters?.map((e) => FieldUtils.ofOrNull(e)).nonNulls ?? {};
183175
if (params.isNotEmpty) {
184176
final a = params.map((e) {
185177
final fieldName = e.fieldPath!.join('_').toCamelCase();
@@ -199,10 +191,8 @@ final insightMappers = [
199191
_InsightMapper(
200192
placeholder: Placeholders.IP2,
201193
mapInsights: (insight) async {
202-
final params = insight.annotation.internalParameters
203-
?.map((e) => FieldUtils.ofOrNull(e))
204-
.nonNulls ??
205-
{};
194+
final params =
195+
insight.annotation.internalParameters?.map((e) => FieldUtils.ofOrNull(e)).nonNulls ?? {};
206196
if (params.isNotEmpty) {
207197
final a = params.map((e) {
208198
final fieldName = e.fieldPath!.join('_').toCamelCase();
@@ -220,10 +210,8 @@ final insightMappers = [
220210
_InsightMapper(
221211
placeholder: Placeholders.QP0,
222212
mapInsights: (insight) async {
223-
final params = insight.annotation.queryParameters
224-
?.map((e) => FieldUtils.ofOrNull(e))
225-
.nonNulls ??
226-
{};
213+
final params =
214+
insight.annotation.queryParameters?.map((e) => FieldUtils.ofOrNull(e)).nonNulls ?? {};
227215
if (params.isNotEmpty) {
228216
final a = params.map((e) {
229217
final fieldName = e.fieldPath!.join('_').toCamelCase();
@@ -251,10 +239,8 @@ final insightMappers = [
251239
_InsightMapper(
252240
placeholder: Placeholders.QP1,
253241
mapInsights: (insight) async {
254-
final params = insight.annotation.internalParameters
255-
?.map((e) => FieldUtils.ofOrNull(e))
256-
.nonNulls ??
257-
{};
242+
final params =
243+
insight.annotation.queryParameters?.map((e) => FieldUtils.ofOrNull(e)).nonNulls ?? {};
258244
if (params.isNotEmpty) {
259245
final a = params.map((e) {
260246
final fieldName = e.fieldPath!.join('_').toCamelCase();
@@ -271,10 +257,8 @@ final insightMappers = [
271257
_InsightMapper(
272258
placeholder: Placeholders.QP2,
273259
mapInsights: (insight) async {
274-
final params = insight.annotation.internalParameters
275-
?.map((e) => FieldUtils.ofOrNull(e))
276-
.nonNulls ??
277-
{};
260+
final params =
261+
insight.annotation.queryParameters?.map((e) => FieldUtils.ofOrNull(e)).nonNulls ?? {};
278262
if (params.isNotEmpty) {
279263
final a = params.map((e) {
280264
final fieldName = e.fieldPath!.join('_').toCamelCase();
@@ -316,5 +300,4 @@ enum Placeholders {
316300
TITLE,
317301
}
318302

319-
typedef _InsightMapper
320-
= InsightMapper<ClassInsight<ModelGenerateScreenBindings>, Placeholders>;
303+
typedef _InsightMapper = InsightMapper<ClassInsight<ModelGenerateScreenBindings>, Placeholders>;

0 commit comments

Comments
 (0)