Skip to content

Commit 7e536d7

Browse files
authored
[go_router_builder] support v10.0.0 go_router (flutter#4578)
fixes:131189
1 parent 441895b commit 7e536d7

16 files changed

+110
-94
lines changed

packages/go_router_builder/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.2.4
2+
3+
* Bumps example go_router version to v10.0.0 and migrate example code.
4+
15
## 2.2.3
26

37
* Removes `path_to_regexp` from the dependencies.

packages/go_router_builder/example/lib/all_types.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class BigIntRoute extends GoRouteData {
5858
Widget drawerTile(BuildContext context) => ListTile(
5959
title: const Text('BigIntRoute'),
6060
onTap: () => go(context),
61-
selected: GoRouterState.of(context).location == location,
61+
selected: GoRouterState.of(context).uri.toString() == location,
6262
);
6363
}
6464

@@ -84,7 +84,7 @@ class BoolRoute extends GoRouteData {
8484
Widget drawerTile(BuildContext context) => ListTile(
8585
title: const Text('BoolRoute'),
8686
onTap: () => go(context),
87-
selected: GoRouterState.of(context).location == location,
87+
selected: GoRouterState.of(context).uri.toString() == location,
8888
);
8989
}
9090

@@ -107,7 +107,7 @@ class DateTimeRoute extends GoRouteData {
107107
Widget drawerTile(BuildContext context) => ListTile(
108108
title: const Text('DateTimeRoute'),
109109
onTap: () => go(context),
110-
selected: GoRouterState.of(context).location == location,
110+
selected: GoRouterState.of(context).uri.toString() == location,
111111
);
112112
}
113113

@@ -133,7 +133,7 @@ class DoubleRoute extends GoRouteData {
133133
Widget drawerTile(BuildContext context) => ListTile(
134134
title: const Text('DoubleRoute'),
135135
onTap: () => go(context),
136-
selected: GoRouterState.of(context).location == location,
136+
selected: GoRouterState.of(context).uri.toString() == location,
137137
);
138138
}
139139

@@ -159,7 +159,7 @@ class IntRoute extends GoRouteData {
159159
Widget drawerTile(BuildContext context) => ListTile(
160160
title: const Text('IntRoute'),
161161
onTap: () => go(context),
162-
selected: GoRouterState.of(context).location == location,
162+
selected: GoRouterState.of(context).uri.toString() == location,
163163
);
164164
}
165165

@@ -185,7 +185,7 @@ class NumRoute extends GoRouteData {
185185
Widget drawerTile(BuildContext context) => ListTile(
186186
title: const Text('NumRoute'),
187187
onTap: () => go(context),
188-
selected: GoRouterState.of(context).location == location,
188+
selected: GoRouterState.of(context).uri.toString() == location,
189189
);
190190
}
191191

@@ -212,7 +212,7 @@ class EnumRoute extends GoRouteData {
212212
Widget drawerTile(BuildContext context) => ListTile(
213213
title: const Text('EnumRoute'),
214214
onTap: () => go(context),
215-
selected: GoRouterState.of(context).location == location,
215+
selected: GoRouterState.of(context).uri.toString() == location,
216216
);
217217
}
218218

@@ -239,7 +239,7 @@ class EnhancedEnumRoute extends GoRouteData {
239239
Widget drawerTile(BuildContext context) => ListTile(
240240
title: const Text('EnhancedEnumRoute'),
241241
onTap: () => go(context),
242-
selected: GoRouterState.of(context).location == location,
242+
selected: GoRouterState.of(context).uri.toString() == location,
243243
);
244244
}
245245

@@ -265,7 +265,7 @@ class StringRoute extends GoRouteData {
265265
Widget drawerTile(BuildContext context) => ListTile(
266266
title: const Text('StringRoute'),
267267
onTap: () => go(context),
268-
selected: GoRouterState.of(context).location == location,
268+
selected: GoRouterState.of(context).uri.toString() == location,
269269
);
270270
}
271271

@@ -288,7 +288,7 @@ class UriRoute extends GoRouteData {
288288
Widget drawerTile(BuildContext context) => ListTile(
289289
title: const Text('UriRoute'),
290290
onTap: () => go(context),
291-
selected: GoRouterState.of(context).location == location,
291+
selected: GoRouterState.of(context).uri.toString() == location,
292292
);
293293
}
294294

@@ -361,7 +361,7 @@ class IterableRoute extends GoRouteData {
361361
Widget drawerTile(BuildContext context) => ListTile(
362362
title: const Text('IterableRoute'),
363363
onTap: () => go(context),
364-
selected: GoRouterState.of(context).location == location,
364+
selected: GoRouterState.of(context).uri.toString() == location,
365365
);
366366
}
367367

@@ -430,7 +430,7 @@ class IterableRouteWithDefaultValues extends GoRouteData {
430430
Widget drawerTile(BuildContext context) => ListTile(
431431
title: const Text('IterableRouteWithDefaultValues'),
432432
onTap: () => go(context),
433-
selected: GoRouterState.of(context).location == location,
433+
selected: GoRouterState.of(context).uri.toString() == location,
434434
);
435435
}
436436

@@ -536,7 +536,7 @@ class BasePage<T> extends StatelessWidget {
536536
Text(
537537
'Query param with default value: $queryParamWithDefaultValue',
538538
),
539-
SelectableText(GoRouterState.of(context).location),
539+
SelectableText(GoRouterState.of(context).uri.toString()),
540540
],
541541
),
542542
),

0 commit comments

Comments
 (0)