maybeOf<T> static method

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

Retrieves the FlutterFolderViewTheme from the closest FolderViewTheme ancestor without registering a dependency

This is useful when you just need to read the theme once without needing to rebuild when the theme changes.

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

Implementation

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