diff --git a/wrestling_scoreboard_client/lib/app.dart b/wrestling_scoreboard_client/lib/app.dart index 20aca43d..492b94a7 100644 --- a/wrestling_scoreboard_client/lib/app.dart +++ b/wrestling_scoreboard_client/lib/app.dart @@ -21,6 +21,9 @@ class WrestlingScoreboardApp extends ConsumerStatefulWidget { } class WrestlingScoreboardAppState extends ConsumerState { + // Initialize router once to avoid reloading initial path on rebuild. + final routerConfig = getRouter(); + @override void initState() { super.initState(); @@ -65,7 +68,7 @@ class WrestlingScoreboardAppState extends ConsumerState supportedLocales: Preferences.supportedLanguages, builder: (context, child) => GlobalWidget(child: child ?? const CircularProgressIndicator()), locale: locale, - routerConfig: getRouter(), + routerConfig: routerConfig, ); }, );