resolveFrom method

  1. @override
CupertinoThemeData resolveFrom(
  1. BuildContext context
)
override

Returns a new theme data with all its colors resolved against the given BuildContext.

Called by CupertinoTheme.of to resolve colors defined in the retrieved CupertinoThemeData.

Implementation

@override
CupertinoThemeData resolveFrom(BuildContext context) {
  Color? convertColor(Color? color) => CupertinoDynamicColor.maybeResolve(color, context);

  return CupertinoThemeData._rawWithDefaults(
    brightness,
    convertColor(super.primaryColor),
    convertColor(super.primaryContrastingColor),
    super.textTheme?.resolveFrom(context),
    convertColor(super.barBackgroundColor),
    convertColor(super.scaffoldBackgroundColor),
    applyThemeToAll,
    _defaults.resolveFrom(context, super.textTheme == null),
  );
}