createBackChevron static method

KeyedSubtree? createBackChevron({
  1. required GlobalKey<State<StatefulWidget>> backChevronKey,
  2. required Widget? userLeading,
  3. required ModalRoute? route,
  4. required bool automaticallyImplyLeading,
})

Implementation

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

  return KeyedSubtree(key: backChevronKey, child: const BackChevron());
}