getFromContext function

NomoLinkButtonThemeData getFromContext(
  1. BuildContext context,
  2. NomoLinkButton widget
)

Implementation

NomoLinkButtonThemeData getFromContext(
  BuildContext context,
  NomoLinkButton widget,
) {
  final globalColorTheme =
      NomoTheme.maybeOf(context)?.componentColors.linkButtonColor ??
          const NomoLinkButtonColorData();
  final globalSizingTheme =
      NomoTheme.maybeOf(context)?.componentSizes.linkButtonSizing ??
          const NomoLinkButtonSizingData();
  const globalConstants = NomoLinkButtonConstants();
  final themeOverride = NomoLinkButtonThemeOverride.maybeOf(context);
  final themeData = NomoLinkButtonThemeData.from(
          globalColorTheme, globalSizingTheme, globalConstants)
      .copyWith(themeOverride);
  return NomoLinkButtonThemeData(
    foregroundColor: widget.foregroundColor ?? themeData.foregroundColor,
    tapDownColor: widget.tapDownColor ?? themeData.tapDownColor,
    padding: widget.padding ?? themeData.padding,
    selectionColor: widget.selectionColor ?? themeData.selectionColor,
  );
}