register method

  1. @override
void register(
  1. ModuleRegistry registry
)
override

Registers the values and bindings owned by this module.

Implementation

@override
void register(ModuleRegistry registry) {
  final initial = readBrowserHandoff();
  _initial = initial;
  if (initial != null) {
    final browserLocation = readFlutterBrowserLocation();
    final renderedLocation = _readInitialLocation(initial);
    if (browserLocation != null &&
        renderedLocation != null &&
        browserLocation != renderedLocation) {
      _initial = null;
      _acceptHandoff = false;
      routerInitialStateKey.provide(
        registry,
        RouterInitialState(
          location: browserLocation,
          loads: const <RouteLoadResult>[],
        ),
      );
    } else {
      handoff.apply(initial);
      final state = handoff.routerState;
      if (state != null) {
        routerInitialStateKey.provide(registry, state);
      }
    }
  }
  registry.bind(const _DocumentFlutterBinding());
}