getFromContext function

NomoAppBarThemeData getFromContext(
  1. dynamic context,
  2. NomoAppBar widget
)

Implementation

NomoAppBarThemeData getFromContext(
  BuildContext context,
  NomoAppBar widget,
) {
  final globalColorTheme =
      NomoTheme.maybeOf(context)?.componentColors.appBarTheme ??
          NomoAppBarColorData();
  final globalSizingTheme =
      NomoTheme.maybeOf(context)?.componentSizes.appBarTheme ??
          NomoAppBarSizingData();
  final themeOverride = NomoAppBarThemeOverride.maybeOf(context);
  final themeData =
      NomoAppBarThemeData.from(globalColorTheme, globalSizingTheme)
          .override(themeOverride);
  return NomoAppBarThemeData(
    borderRadius: widget.borderRadius ?? themeData.borderRadius,
    backgroundColor: widget.backgroundColor ?? themeData.backgroundColor,
    spacing: widget.spacing ?? themeData.spacing,
    topInset: widget.topInset ?? themeData.topInset,
    height: widget.height ?? themeData.height,
    elevation: widget.elevation ?? themeData.elevation,
  );
}