getFromContext function

LoadingThemeData getFromContext(
  1. BuildContext context,
  2. Loading widget
)

Implementation

LoadingThemeData getFromContext(
  BuildContext context,
  Loading widget,
) {
  final globalColorTheme =
      NomoTheme.maybeOf(context)?.componentColors.loadingColor ??
          const LoadingColorData();
  const globalSizingTheme = LoadingSizingData();
  const globalConstants = LoadingConstants();
  final themeOverride = LoadingThemeOverride.maybeOf(context);
  final themeData = LoadingThemeData.from(
          globalColorTheme, globalSizingTheme, globalConstants)
      .copyWith(themeOverride);
  return LoadingThemeData(
    color: widget.color ?? themeData.color,
    strokeWidth: widget.strokeWidth ?? themeData.strokeWidth,
  );
}