resolveFrom method Null safety

  1. @protected
NoDefaultCupertinoThemeData resolveFrom(
  1. BuildContext context
)
protected">@protected

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

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

  return NoDefaultCupertinoThemeData(
    brightness: brightness,
    primaryColor: convertColor(primaryColor),
    primaryContrastingColor: convertColor(primaryContrastingColor),
    textTheme: textTheme?.resolveFrom(context),
    barBackgroundColor: convertColor(barBackgroundColor),
    scaffoldBackgroundColor: convertColor(scaffoldBackgroundColor),
  );
}