of<T extends PresetValue<T> > static method
Retrieve an instance of PresetValue of type T
from
context
. If context doesn't contain any PresetValue
instance of type T
, this method will return null.
Implementation
static T? of<T extends PresetValue<T>>(BuildContext context) {
//...
try {
return Theme.of(context).extension<T>()!;
} catch (e) {
return null;
}
}