getFromContext function

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

Implementation

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