setNewRoutePath method

  1. @override
Future<void> setNewRoutePath(
  1. AppRoutePath configuration
)
override

Of course, You're free to override this function if you like

Implementation

@override
Future<void> setNewRoutePath(AppRoutePath configuration) async {
  //
  if (configuration.isHomePage) {
    //
    _currentConfiguration = configuration;

    // This is a hack! There must be a better way.
  } else if (_backButtonPushed(configuration.path!)) {
    //
    _currentConfiguration = _previousRoute();

    // If not a recognized path
  } else if (!_findPage(configuration.path)) {
    //
    _addUnknown(configuration.path);

    _currentConfiguration = AppRoutePath.unknown(configuration.path);
  } else {
    //
    _currentConfiguration = AppRoutePath.page(configuration.path);
  }
}