RoutePath constructor

const RoutePath(
  1. String path, {
  2. Type? pageType,
  3. Function? builder,
  4. Function? pageBuilder,
  5. String? name,
  6. String? parentNavigatorKey,
  7. Function? redirect,
  8. Function? onExit,
  9. Set<String>? pathArguments,
  10. Set<String>? arguments,
  11. List<_RouteBuilder>? routes,
  12. bool extra = false,
})

Reflect to GoRoute class, using builder for building page of this route

Implementation

const RoutePath(
  this.path, {
  this.pageType,
  this.builder,
  this.pageBuilder,
  //
  this.name,
  this.parentNavigatorKey,

  /// GoRouterRedirect
  ///
  /// FutureOr<String?> Function(BuildContext context, GoRouterState state)
  this.redirect,

  /// ExitCallback
  ///
  /// FutureOr<bool> Function(BuildContext context)
  this.onExit,
  this.pathArguments,
  this.arguments,
  this.routes,
  this.extra = false,
}) : assert(
        (pageType != null ? 1 : 0) + (builder != null ? 1 : 0) + (pageBuilder != null ? 1 : 0) ==
            1,
        'use either [pageType], [builder] or [pageBuilder].',
      );