BeamerDelegate<T extends BeamState> constructor
BeamerDelegate<T extends BeamState> ({
- required LocationBuilder locationBuilder,
- String initialPath = '/',
- void listener()?,
- T createState(
- BeamState state
- bool preferUpdate = true,
- bool removeDuplicateHistory = true,
- BeamPage? notFoundPage,
- BeamLocation<
BeamState> ? notFoundRedirect, - String? notFoundRedirectNamed,
- List<
BeamGuard> guards = const <BeamGuard>[], - TransitionDelegate transitionDelegate = const DefaultTransitionDelegate(),
- TransitionDelegate beamBackTransitionDelegate = const ReverseTransitionDelegate(),
- bool onPopPage(
- BuildContext context,
- Route route,
- dynamic result
- bool setBrowserTabTitle = true,
- bool updateFromParent = true,
- bool updateParent = true,
Implementation
BeamerDelegate({
required this.locationBuilder,
this.initialPath = '/',
this.listener,
this.createState,
this.preferUpdate = true,
this.removeDuplicateHistory = true,
this.notFoundPage,
this.notFoundRedirect,
this.notFoundRedirectNamed,
this.guards = const <BeamGuard>[],
this.navigatorObservers = const <NavigatorObserver>[],
this.transitionDelegate = const DefaultTransitionDelegate(),
this.beamBackTransitionDelegate = const ReverseTransitionDelegate(),
this.onPopPage,
this.setBrowserTabTitle = true,
this.updateFromParent = true,
this.updateParent = true,
}) {
notFoundPage ??= BeamPage(
title: 'Not found',
child: Container(child: Center(child: Text('Not found'))),
);
createState ??= (BeamState state) => BeamState.fromUri(
state.uri,
data: state.data,
) as T;
_currentTransitionDelegate = transitionDelegate;
state = createState!(BeamState.fromUriString(initialPath));
_currentBeamLocation = EmptyBeamLocation();
}