of static method

The closest instance of this class that encloses the given context.

If there is no enclosing UserTileTheme widget, then PensilThemeData.userTileTheme is used.

Typical usage is as follows:

final theme = UserBarTheme.of(context);

Implementation

static UserTileThemeData of(BuildContext context) {
  final userTileTheme =
      context.dependOnInheritedWidgetOfExactType<UserTileTheme>();
  return userTileTheme?.data ?? PensilTheme.of(context).userTileTheme;
}