getFromContext function

NomoBottomBarThemeData getFromContext(
  1. dynamic context,
  2. NomoBottomBar widget
)

Implementation

NomoBottomBarThemeData getFromContext(
  BuildContext context,
  NomoBottomBar widget,
) {
  final globalColorTheme =
      NomoTheme.maybeOf(context)?.componentColors.bottomBarTheme ??
          NomoBottomBarColorData();
  final globalSizingTheme =
      NomoTheme.maybeOf(context)?.componentSizes.bottomBarTheme ??
          NomoBottomBarSizingData();
  final themeOverride = NomoBottomBarThemeOverride.maybeOf(context);
  final themeData =
      NomoBottomBarThemeData.from(globalColorTheme, globalSizingTheme)
          .override(themeOverride);
  return NomoBottomBarThemeData(
    foreground: widget.foreground ?? themeData.foreground,
    background: widget.background ?? themeData.background,
    selectedForeground:
        widget.selectedForeground ?? themeData.selectedForeground,
    borderRadius: widget.borderRadius ?? themeData.borderRadius,
    height: widget.height ?? themeData.height,
    spacing: widget.spacing ?? themeData.spacing,
    iconSize: widget.iconSize ?? themeData.iconSize,
    padding: widget.padding ?? themeData.padding,
    itemPadding: widget.itemPadding ?? themeData.itemPadding,
  );
}