onCreateAppbar method

  1. @protected
AppBar? onCreateAppbar(
  1. BuildContext context
)

Implementation

@protected
AppBar? onCreateAppbar(BuildContext context) {
  final t = Theme.of(context).appBarTheme;
  final s = appbarProperties(context);
  final it = s.iconTheme ?? t.iconTheme;
  final ait = s.actionsIconTheme ?? t.actionsIconTheme;

  final mSC = statusBarProperties(context);
  final mNC = navigationBarProperties(context);

  final mTitle = onCreateTitle(context, s);
  final mActions = onCreateActions(context);
  final mBottom = onCreateToolbarBottom(context);
  final mFlexibleSpace = onCreateToolbarFlexibleSpace(context);
  final mLeading = onCreateLeading(context);
  final mTH = mTitle == null ? 0.0 : s.toolbarHeight ?? t.toolbarHeight;

  return AppBar(
    key: s.appbarKey,
    actions: mActions,
    actionsIconTheme: ait ?? it,
    automaticallyImplyLeading: s.automaticallyImplyLeading,
    backgroundColor: s.backgroundColor ?? t.backgroundColor,
    bottom: mBottom,
    bottomOpacity: s.bottomOpacity,
    centerTitle: s.titleCenter ?? t.centerTitle,
    clipBehavior: s.clipBehavior,
    elevation: s.elevation ?? t.elevation,
    excludeHeaderSemantics: s.excludeHeaderSemantics,
    flexibleSpace: mFlexibleSpace,
    foregroundColor: s.foregroundColor ?? t.foregroundColor,
    forceMaterialTransparency: s.forceMaterialTransparency,
    iconTheme: it,
    leading: mLeading,
    leadingWidth: s.leadingWidth,
    notificationPredicate: onCreateNotificationPredicate,
    primary: s.primary,
    scrolledUnderElevation:
        s.scrolledUnderElevation ?? t.scrolledUnderElevation,
    shadowColor: s.shadowColor ?? t.shadowColor,
    shape: s.shape ?? t.shape,
    surfaceTintColor: s.surfaceTintColor ?? t.surfaceTintColor,
    systemOverlayStyle: SystemUiOverlayStyle(
      statusBarColor: mSC.color,
      statusBarBrightness: mSC.brightness,
      statusBarIconBrightness: mSC.iconBrightness,
      systemStatusBarContrastEnforced: mSC.contrastEnforced,
      systemNavigationBarColor: mNC.color,
      systemNavigationBarDividerColor: mNC.dividerColor,
      systemNavigationBarIconBrightness: mNC.brightness,
      systemNavigationBarContrastEnforced: mNC.contrastEnforced,
    ),
    title: mTitle,
    titleSpacing: s.titleSpacing ?? t.titleSpacing,
    titleTextStyle: s.titleTextStyle ?? t.titleTextStyle,
    toolbarHeight: mTH,
    toolbarOpacity: s.toolbarOpacity,
    toolbarTextStyle: s.toolbarTextStyle ?? t.toolbarTextStyle,
  );
}