createBackLabel static method

KeyedSubtree? createBackLabel({
  1. required GlobalKey<State<StatefulWidget>> backLabelKey,
  2. required Widget? userLeading,
  3. required ModalRoute? route,
  4. required bool automaticallyImplyLeading,
  5. required String? previousPageTitle,
})

Implementation

static KeyedSubtree? createBackLabel({
  required GlobalKey backLabelKey,
  required Widget? userLeading,
  required ModalRoute<dynamic>? route,
  required bool automaticallyImplyLeading,
  required String? previousPageTitle,
}) {
  if (userLeading != null ||
      !automaticallyImplyLeading ||
      route == null ||
      !route.canPop ||
      (route is PageRoute && route.fullscreenDialog)) {
    return null;
  }

  return KeyedSubtree(
    key: backLabelKey,
    child: BackLabel(
      specifiedPreviousTitle: previousPageTitle,
      route: route,
    ),
  );
}