createLargeTitle static method

KeyedSubtree? createLargeTitle({
  1. required GlobalKey<State<StatefulWidget>> largeTitleKey,
  2. required Widget? userLargeTitle,
  3. required bool large,
  4. required bool automaticImplyTitle,
  5. required ModalRoute? route,
})

Implementation

static KeyedSubtree? createLargeTitle({
  required GlobalKey largeTitleKey,
  required Widget? userLargeTitle,
  required bool large,
  required bool automaticImplyTitle,
  required ModalRoute<dynamic>? route,
}) {
  if (!large) {
    return null;
  }

  final Widget? largeTitleContent = userLargeTitle ??
      _derivedTitle(
        automaticallyImplyTitle: automaticImplyTitle,
        currentRoute: route,
      );

  assert(
    largeTitleContent != null,
    'largeTitle was not provided and there was no title from the route.',
  );

  return KeyedSubtree(
    key: largeTitleKey,
    child: largeTitleContent!,
  );
}