init method

void init(
  1. Map<String, dynamic> params,
  2. Map<String, dynamic>? extra,
  3. Object? groupId
)

Implementation

void init(
  Map<String, dynamic> params,
  Map<String, dynamic>? extra,
  Object? groupId,
) {
  WidgetsFlutterBinding.ensureInitialized();
  if (_restore()) return;

  RouteQueueEntry? entry;
  final defaultName =
      WidgetsBinding.instance.platformDispatcher.defaultRouteName;

  if (defaultName != '/') {
    entry = _parse(defaultName);
  }

  entry ??=
      createEntry(rootPage, params: params, extra: extra, groupId: groupId);

  routeQueue.insert(entry);
  assert(routeQueue.current == entry);
}