Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions package/lib/src/beamer_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,10 @@ class BeamerDelegate extends RouterDelegate<RouteInformation>
// 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) {
Expand Down Expand Up @@ -986,10 +990,12 @@ class BeamerDelegate extends RouterDelegate<RouteInformation>
}
}

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);
}
}
Expand Down Expand Up @@ -1135,4 +1141,4 @@ class BeamerDelegate extends RouterDelegate<RouteInformation>
updateListenable?.removeListener(_update);
super.dispose();
}
}
}