resolveAs<T> static method
Resolves the value for the given context if value is a
ContextualProperty, otherwise returns the value itself.
Implementation
static T resolveAs<T>(T light, T dark, BuildContext context) {
return Theme.of(context).brightness == Brightness.light ? light : dark;
}