getFromContext function

NomoSiderThemeData getFromContext(
  1. BuildContext context,
  2. NomoSider widget
)

Implementation

NomoSiderThemeData getFromContext(
  BuildContext context,
  NomoSider widget,
) {
  final globalColorTheme =
      NomoTheme.maybeOf(context)?.componentColors.siderColor ??
          const NomoSiderColorData();
  final globalSizingTheme =
      NomoTheme.maybeOf(context)?.componentSizes.siderSizing ??
          const NomoSiderSizingData();
  const globalConstants = NomoSiderConstants();
  final themeOverride = NomoSiderThemeOverride.maybeOf(context);
  final themeData = NomoSiderThemeData.from(
          globalColorTheme, globalSizingTheme, globalConstants)
      .copyWith(themeOverride);
  return NomoSiderThemeData(
    backgroundColor: widget.backgroundColor ?? themeData.backgroundColor,
    border: widget.border ?? themeData.border,
    padding: widget.padding ?? themeData.padding,
    scrollPadding: widget.scrollPadding ?? themeData.scrollPadding,
    width: widget.width ?? themeData.width,
  );
}