createMaterialWidget method Null safety

  1. @override
PreferredSizeWidget createMaterialWidget(
  1. BuildContext context
)
override

Implementation

@override
PreferredSizeWidget createMaterialWidget(BuildContext context) {
  final data = material?.call(context, platform(context));

  return AppBar(
    key: data?.widgetKey ?? widgetKey,
    title: data?.title ?? title,
    backgroundColor: data?.backgroundColor ?? backgroundColor,
    bottom: data?.bottom,
    actions: data?.actions ?? trailingActions,
    automaticallyImplyLeading:
        data?.automaticallyImplyLeading ?? automaticallyImplyLeading ?? true,
    bottomOpacity: data?.bottomOpacity ?? 1.0,
    brightness: data?.brightness,
    centerTitle: data?.centerTitle,
    elevation: data?.elevation,
    flexibleSpace: data?.flexibleSpace,
    iconTheme: data?.iconTheme,
    leading: data?.leading ?? leading,
    primary: data?.primary ?? true,
    textTheme: data?.textTheme,
    titleSpacing: data?.titleSpacing,
    toolbarOpacity: data?.toolbarOpacity ?? 1.0,
    actionsIconTheme: data?.actionsIconTheme,
    shape: data?.shape,
    excludeHeaderSemantics: data?.excludeHeaderSemantics ?? false,
    shadowColor: data?.shadowColor,
    toolbarHeight: data?.toolbarHeight,
    leadingWidth: data?.leadingWidth,
    backwardsCompatibility: data?.backwardsCompatibility,
    foregroundColor: data?.foregroundColor,
    systemOverlayStyle: data?.systemOverlayStyle,
    titleTextStyle: data?.titleTextStyle,
    toolbarTextStyle: data?.toolbarTextStyle,
  );
}