addHead method

void addHead(
  1. Widget screen, {
  2. BaseContainerOptions? options = BaseContainerOptions.defaultSetup,
  3. dynamic arguments,
})

Creates a new head node by clearing all lists and replacing it with the newly created Screens

Best suited for screens that you don't want to revisit again throughout the app lifecycle

Implementation

void addHead(Widget screen,
    {BaseContainerOptions? options = BaseContainerOptions.defaultSetup,
    dynamic arguments}) {
  screenViewHistory = [screen];
  optionsHistory = [options!];
  notifyListeners();
}