NavigationPage constructor

NavigationPage({
  1. required String path,
  2. required Widget builder(),
  3. bool fullscreenDialog = false,
  4. bool maintainState = true,
  5. Duration? transitionDuration,
  6. List<PageValidator> validators = const <PageValidator>[],
  7. String? restorationId,
  8. String? name,
  9. RouteTransitionsBuilder? transitionsBuilder,
})

Is used to create a new instance of NavigationPage

Implementation

NavigationPage({
  required this.path,
  required this.builder,
  this.fullscreenDialog = false,
  this.maintainState = true,
  this.transitionDuration,
  this.validators = const <PageValidator>[],
  this.restorationId,
  this.name,
  this.transitionsBuilder,
})  : assert(() {
        if (path.isEmpty || path[0] != '/') {
          throw const NavigationException(
            'NavigationPage.path must begin with "/"',
          );
        }

        return true;
      }()),
      hasPathParams = path.contains('/:');