of method Null safety

ListTileTheme of(
  1. BuildContext context
)

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

Typical usage is as follows:

ListTileTheme theme = ListTileTheme.of(context);

Implementation

static ListTileTheme of(BuildContext context) {
  final ListTileTheme? result = context.dependOnInheritedWidgetOfExactType<ListTileTheme>();
  return result ?? const ListTileTheme(child: SizedBox());
}