read<T> method
The value at path parsed with parse; null when there is none.
Throws a ThemePropertyException naming the property and expected
when parse cannot read it.
Implementation
T? read<T>(String path, T? Function(String value) parse, String expected) {
final value = this[path];
if (value == null) {
return null;
}
return parse(value) ??
(throw ThemePropertyException(propertyName(path), value, expected));
}