initErrorPage method

void initErrorPage({
  1. required String? route,
  2. required Map<String, String?>? params,
  3. required BuildContext context,
})

Implementation

void initErrorPage(
    {required String? route,
    required Map<String, String?>? params,
    required BuildContext context}) {
  //routedPageCounts++;
  _currentPage = null;
  _route = RouteProperties(route: route, name: null, params: params);
  if (kIsWeb &&
      _unknownRoutePage != null &&
      _unknownRoutePage!.description != null) {
    FutureOr<String?> func = _unknownRoutePage!.description!(_route!);
    if (func is Future<String?>) {
      func.then((value) {
        if (_currentPage == currentPage && value != null) {
          _updatePageDescription(value, context);
        }
      });
    } else {
      if (func != null) {
        _updatePageDescription(func, context);
      }
    }
  }
}