getProperty<T> method
Property<T>
getProperty<
T>( - String name,
- T converter(
- String s
),
- T defaultValue(), {
- bool isImmutable = true,
})
override
Implementation
@override
Property<T> getProperty<T>(
String name, T Function(String s) converter, T Function() defaultValue,
{bool isImmutable = true}) {
var property = element[name];
if (property == null) {
return createProperty<T>(defaultValue(), isImmutable);
}
if (property is String) {
return createProperty<T>(converter(property), isImmutable);
}
if (property is bool && T == bool) {
return createProperty<T>(property as T, isImmutable);
}
if (property is int && T == int) {
return createProperty<T>(property as T, isImmutable);
}
if (property is double && T == double) {
return createProperty<T>(property as T, isImmutable);
}
if (property is Map<String, dynamic>) {
var expression = property['expression'];
if (expression != null) {
return StringExpressionProperty<T>(expression);
}
}
return createProperty<T>(defaultValue(), isImmutable);
}