of static method

Returns the UIProThemeData from the closest UIProTheme ancestor.

If there is no UIProTheme ancestor, returns UIProThemeData.light as default.

Example:

final theme = UIProTheme.of(context);
print(theme.primaryColor);

Implementation

static UIProThemeData of(BuildContext context) {
  final UIProTheme? result = context
      .dependOnInheritedWidgetOfExactType<UIProTheme>();
  return result?.data ?? UIProThemeData.light;
}