of method

CupertinoThemeData of (BuildContext context)

Retrieve the CupertinoThemeData from an ancestor CupertinoTheme widget.

Returns a default CupertinoThemeData if no CupertinoTheme widgets exist in the ancestry tree.

Implementation

static CupertinoThemeData of(BuildContext context) {
  final _InheritedCupertinoTheme inheritedTheme = context.inheritFromWidgetOfExactType(_InheritedCupertinoTheme);
  return inheritedTheme?.theme?.data ?? const CupertinoThemeData();
}