Refactor initialLocation formatting in GoRouter for improved readability
This commit is contained in:
@@ -20,7 +20,9 @@ import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:web/web.dart' as web;
|
||||
|
||||
final GoRouter _router = GoRouter(
|
||||
initialLocation: kIsWeb ? web.window.location.pathname + web.window.location.search : '/',
|
||||
initialLocation: kIsWeb
|
||||
? web.window.location.pathname + web.window.location.search
|
||||
: '/',
|
||||
routes: [
|
||||
GoRoute(path: '/', builder: (context, state) => const HomePage()),
|
||||
GoRoute(
|
||||
|
||||
Reference in New Issue
Block a user