diff --git a/package/lib/src/beamer_delegate.dart b/package/lib/src/beamer_delegate.dart index c6a4140..dc10a12 100644 --- a/package/lib/src/beamer_delegate.dart +++ b/package/lib/src/beamer_delegate.dart @@ -432,6 +432,10 @@ class BeamerDelegate extends RouterDelegate // run guards on _beamStackCandidate final context = _context; if (context != null) { + if (configuration != null) { + _setBrowserTitle(context, + fixTitle: configuration.uri.pathSegments.last); + } final didApply = _runGuards(context, _beamStackCandidate); _didRunGuards = true; if (didApply) { @@ -986,10 +990,12 @@ class BeamerDelegate extends RouterDelegate } } - void _setBrowserTitle(BuildContext context) { + void _setBrowserTitle(BuildContext context, {String? fixTitle}) { if (active && setBrowserTabTitle) { final String title = _currentPages.last.title ?? currentBeamStack.state.routeInformation.uri.path; + final String title = fixTitle ?? _currentPages.last.title ?? + currentBeamLocation.state.routeInformation.uri.path; browser_tab_title_util.setTabTitle(title); } } @@ -1135,4 +1141,4 @@ class BeamerDelegate extends RouterDelegate updateListenable?.removeListener(_update); super.dispose(); } -} +} \ No newline at end of file