StandardPageWithResultFactory<T extends StandardPageWithResult<R, E> , R extends Object?, E extends Object?> constructor
- required T create(
- R pageData
- Map<
String, R Function(RegExpMatch match, Uri uri)> ? links, - String linkGenerator(
- R pageData
- bool groupRoot = false,
- String? group = defaultGroup,
- bool keepHistory = true,
- LocalKey pageKey(
- R pageData
- StandardPageInterface<
R, E> pageBuilder(- Widget child,
- String? name,
- R pageData,
- LocalKey pageKey,
- String restorationId,
- GlobalKey<
StandardPageWithResult< standardPageKey,R, E> > - StandardPageWithResultFactory<
StandardPageWithResult< factoryObject,R, E> , R, E>
- R pageDataWhenNull()?,
- String? pageName()?,
- String restorationId(
- R pageData
- Type? parentPageType,
Create a StandardPageWithResultFactory.
Define deep links for navigating to this page using regular expressions, allowing for multiple configurations.
Set the page key, with page data being of the type R
.
create
is a required parameter. Pass a class that extends StandardPageWithResult to this argument.
Other arguments are optional.
links
define the links to navigate to this page using regular expressions, and linkGenerator
generates deep links for this page.
group
is the group name used to manage multiple pages as part of the same group. groupRoot
is a flag within the same group name to specify which page should be the root. The default value is false
.
keepHistory
is a flag for whether to push history on the Navigator during transitions. The default is true
.
enableNavigationAnalytics
is a flag indicating whether to enable navigation analytics. The default is true
.
navigationMode
specifies the NavigationMode when navigating to this page. The default is StandardPageNavigationMode.moveToTop.
pageKey
is a LocalKey to identify the page.
pageBuilder
is a function that wraps the processing when the page is built. The default is the page of StandardMaterialPage.
pageDataWhenNull
is a function that wraps the processing when building when page data is null.
pageName
is the name of this page.
restorationId
is a unique ID for state restoration.
parentPageType
is the page type that specifies which page type to consider as the parent.
Implementation
StandardPageWithResultFactory({
required this.create,
Map<String, R Function(RegExpMatch match, Uri uri)>? links,
this.linkGenerator,
this.groupRoot = false,
this.group = defaultGroup,
this.keepHistory = true,
this.enableNavigationAnalytics = true,
this.navigationMode = StandardPageNavigationMode.moveToTop,
LocalKey Function(
R pageData,
)? pageKey,
this.pageBuilder,
this.pageDataWhenNull,
this.pageName,
this.restorationId,
this.parentPageType,
}) : assert((links == null && linkGenerator == null) ||
(links != null && linkGenerator != null)),
_pageKey = pageKey,
_links = links != null
? {
for (var i in links.entries) RegExp('^/?${i.key}\$'): i.value,
}
: const {};