BasicRouter constructor Null safety

BasicRouter(
  1. {required Widget routeBuilder(
    1. String
    ),
  2. String? initialRoute}
)

Implementation

BasicRouter({
  required this.routeBuilder,
  String? initialRoute,
}) : currentRoute =
          initialRoute ?? window.location.hash.replaceFirst('#', '') {
  window.onHashChange.listen(_onHashChangeListener);
}