getFromContext function

NomoInfoItemThemeData getFromContext(
  1. BuildContext context,
  2. NomoInfoItem widget
)

Implementation

NomoInfoItemThemeData getFromContext(
  BuildContext context,
  NomoInfoItem widget,
) {
  const globalColorTheme = NomoInfoItemColorData();
  final globalSizingTheme =
      NomoTheme.maybeOf(context)?.componentSizes.infoItemSizing ??
          const NomoInfoItemSizingData();
  final globalConstants = NomoTheme.maybeOf(context)?.constants.infoItemTheme ??
      const NomoInfoItemConstants();
  final themeOverride = NomoInfoItemThemeOverride.maybeOf(context);
  final themeData = NomoInfoItemThemeData.from(
          globalColorTheme, globalSizingTheme, globalConstants)
      .copyWith(themeOverride);
  return NomoInfoItemThemeData(
    padding: widget.padding ?? themeData.padding,
    titleStyle: widget.titleStyle ?? themeData.titleStyle,
    valueStyle: widget.valueStyle ?? themeData.valueStyle,
  );
}