navigate method
Navigates to path by pushing a new entry onto the browser history stack.
Evaluates any BloomRouteGuards configured on the matching route. If a guard
returns a redirect, navigates to the redirect path instead. Otherwise, pushes
a new history entry with window.history.pushState, updates currentPath,
currentQuery, currentQueryAll, and currentFragment, handles fragment/top
scrolling, announces the navigation to screen readers, manages focus, and scans
for visible prefetch links.
Button(
onClick: (_) => controller.navigate('/dashboard?tab=stats#chart'),
text: 'Go to Dashboard',
)
Implementation
Future<void> navigate(String path) async {
await _handleNavigation(path, replaceState: false);
}