Skip to content

Commit 85c93ce

Browse files
committed
fix(app_routes): fix loggging route null
1 parent 9114028 commit 85c93ce

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

lib/routes/app_routes.dart

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ class AppRoutes {
4444
static const String profileEdit = '/profile/edit';
4545

4646
static GoRouter createRouter({required bool isFirstLaunch}) {
47-
return GoRouter(
47+
final router = GoRouter(
4848
initialLocation: isFirstLaunch ? welcome : login,
49-
observers: [TalkerRouteObserver()],
5049
routes: [
5150
ShellRoute(
5251
builder: (context, state, child) {
@@ -227,5 +226,17 @@ class AppRoutes {
227226
),
228227
],
229228
);
229+
230+
String? _previousUri;
231+
router.routerDelegate.addListener(() {
232+
final uri =
233+
router.routerDelegate.currentConfiguration.uri.toString();
234+
if (uri != _previousUri) {
235+
talker.debug('Route: $_previousUri -> $uri');
236+
_previousUri = uri;
237+
}
238+
});
239+
240+
return router;
230241
}
231242
}

0 commit comments

Comments
 (0)