getFromContext function

ShimmerThemeData getFromContext(
  1. BuildContext context,
  2. Shimmer widget
)

Implementation

ShimmerThemeData getFromContext(
  BuildContext context,
  Shimmer widget,
) {
  final globalColorTheme =
      NomoTheme.maybeOf(context)?.componentColors.shimmerColor ??
          const ShimmerColorData();
  const globalSizingTheme = ShimmerSizingData();
  const globalConstants = ShimmerConstants();
  final themeOverride = ShimmerThemeOverride.maybeOf(context);
  final themeData = ShimmerThemeData.from(
          globalColorTheme, globalSizingTheme, globalConstants)
      .copyWith(themeOverride);
  return ShimmerThemeData(
    gradient: widget.gradient ?? themeData.gradient,
  );
}