getFromContext function

NomoScaffoldThemeData getFromContext(
  1. BuildContext context,
  2. NomoScaffold widget
)

Implementation

NomoScaffoldThemeData getFromContext(
  BuildContext context,
  NomoScaffold widget,
) {
  final globalColorTheme =
      NomoTheme.maybeOf(context)?.componentColors.scaffoldColor ??
          const NomoScaffoldColorData();
  final globalSizingTheme =
      NomoTheme.maybeOf(context)?.componentSizes.scaffoldSizing ??
          const NomoScaffoldSizingData();
  const globalConstants = NomoScaffoldConstants();
  final themeOverride = NomoScaffoldThemeOverride.maybeOf(context);
  final themeData = NomoScaffoldThemeData.from(
          globalColorTheme, globalSizingTheme, globalConstants)
      .copyWith(themeOverride);
  return NomoScaffoldThemeData(
    backgroundColor: widget.backgroundColor ?? themeData.backgroundColor,
    padding: widget.padding ?? themeData.padding,
    showBottomBar: widget.showBottomBar ?? themeData.showBottomBar,
    showSider: widget.showSider ?? themeData.showSider,
  );
}