of<T> static method

FlutterFolderViewTheme<T> of<T>(
  1. BuildContext context
)

Retrieves the FlutterFolderViewTheme from the closest FolderViewTheme ancestor

If there is no FolderViewTheme ancestor, returns a default light theme.

Example:

final theme = FolderViewTheme.of<MyDataType>(context);
final lineColor = theme.lineTheme.lineColor;

Implementation

static FlutterFolderViewTheme<T> of<T>(BuildContext context) {
  final FolderViewTheme<T>? theme =
      context.dependOnInheritedWidgetOfExactType<FolderViewTheme<T>>();
  return theme?.data ?? FlutterFolderViewTheme<T>.light();
}