RouterOutlet<TDelegate extends RouterDelegate<T>, T extends Object> constructor

RouterOutlet<TDelegate extends RouterDelegate<T>, T extends Object>({
  1. required Iterable<GetPage> pickPages(
    1. T currentNavStack
    ),
  2. required Widget pageBuilder(
    1. BuildContext context,
    2. TDelegate,
    3. Iterable<GetPage>? page
    ),
  3. Key? key,
  4. TDelegate? delegate,
})

Implementation

RouterOutlet({
  required Iterable<GetPage> Function(T currentNavStack) pickPages,
  required Widget Function(
    BuildContext context,
    TDelegate,
    Iterable<GetPage>? page,
  ) pageBuilder,
  Key? key,
  TDelegate? delegate,
}) : this.builder(
        builder: (BuildContext context) {
          final currentConfig = context.delegate.currentConfiguration as T?;
          final rDelegate = context.delegate as TDelegate;
          Iterable<GetPage>? picked =
              currentConfig == null ? null : pickPages(currentConfig);
          if (picked?.isEmpty ?? true) {
            picked = null;
          }
          return pageBuilder(context, rDelegate, picked);
        },
        delegate: delegate,
        key: key,
      );