ofType<T extends FlutterFireUIStyle> static method
T
ofType<
T extends FlutterFireUIStyle>( - BuildContext context,
- T defaultValue
)
Implementation
static T ofType<T extends FlutterFireUIStyle>(
BuildContext context,
T defaultValue,
) {
final el =
context.getElementForInheritedWidgetOfExactType<FlutterFireUITheme>();
if (el == null) return defaultValue;
context.dependOnInheritedElement(el, aspect: T);
final style = (el as FlutterFireUIThemeElement).styles[T];
if (style == null) return defaultValue;
return style as T;
}