resolveColorToArgb function

int? resolveColorToArgb(
  1. Color? color,
  2. BuildContext context
)

Resolves a possibly dynamic Cupertino color to a concrete ARGB int for the current BuildContext. Falls back to the raw color if not dynamic.

Implementation

int? resolveColorToArgb(Color? color, BuildContext context) {
  if (color == null) return null;
  if (color is CupertinoDynamicColor) {
    final resolved = color.resolveFrom(context);
    return _argbFromColor(resolved);
  }
  return _argbFromColor(color);
}