setNavigationBarToM3 method

Future<void> setNavigationBarToM3([
  1. bool doNotify = true
])

Set NavigationBar values to Flutter M3 defaults.

Implementation

Future<void> setNavigationBarToM3([bool doNotify = true]) async {
  setNavBarBackgroundSchemeColor(null, false);
  setNavBarIndicatorOpacity(1, false);
  setNavBarElevation(null, false);
  setNavBarHeight(null, false);
  setNavBarIndicatorSchemeColor(SchemeColor.secondaryContainer, false);
  setNavBarIndicatorOpacity(1, false);
  setNavBarIndicatorBorderRadius(null, false);
  setNavBarMuteUnselected(false, false);
  setNavBarSelectedIconSchemeColor(SchemeColor.onSurface, false);
  setNavBarSelectedLabelSchemeColor(SchemeColor.onSurface, false);
  setNavBarUnselectedSchemeColor(SchemeColor.onSurface, false);
  setNavBarLabelBehavior(NavigationDestinationLabelBehavior.alwaysShow, false);

  // Only notify at end, if asked to do so, to do so is default.
  if (doNotify) notifyListeners();
}