StandardPageWithResultFactory<T extends StandardPageWithResult<R, E>, R extends Object?, E extends Object?> constructor

StandardPageWithResultFactory<T extends StandardPageWithResult<R, E>, R extends Object?, E extends Object?>({
  1. required T create(
    1. R pageData
    ),
  2. Map<String, R Function(RegExpMatch match, Uri uri)>? links,
  3. String linkGenerator(
    1. R pageData
    )?,
  4. bool groupRoot = false,
  5. String? group = defaultGroup,
  6. bool keepHistory = true,
  7. bool enableNavigationAnalytics = true,
  8. StandardPageNavigationMode navigationMode = StandardPageNavigationMode.moveToTop,
  9. LocalKey pageKey(
    1. R pageData
    )?,
  10. StandardPageInterface<R, E> pageBuilder(
    1. Widget child,
    2. String? name,
    3. R pageData,
    4. LocalKey pageKey,
    5. String restorationId,
    6. GlobalKey<StandardPageWithResult<R, E>> standardPageKey,
    7. StandardPageWithResultFactory<StandardPageWithResult<R, E>, R, E> factoryObject,
    )?,
  11. R pageDataWhenNull()?,
  12. String? pageName()?,
  13. String restorationId(
    1. R pageData
    )?,
  14. 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 {};