addWithFallback method

void addWithFallback(
  1. Widget screen,
  2. Widget fallBackScreen, {
  3. BaseContainerOptions? options = BaseContainerOptions.defaultSetup,
  4. BaseContainerOptions? fallOptions = BaseContainerOptions.defaultSetup,
  5. dynamic arguments,
})

creates a sequence where a fallback Screen is added to the viewHistory

Implementation

void addWithFallback(Widget screen, Widget fallBackScreen,
    {BaseContainerOptions? options = BaseContainerOptions.defaultSetup,
    BaseContainerOptions? fallOptions = BaseContainerOptions.defaultSetup,
    dynamic arguments}) {
  screenViewHistory =
      fallBackScreen != screen ? [fallBackScreen, screen] : [screen];
  optionsHistory =
      fallOptions != options ? [fallOptions!, options!] : [options!];

  if (arguments != null) routeArguments = arguments;
  notifyListeners();
}