getProperty<T> method

  1. @override
Property<T> getProperty<T>(
  1. String name,
  2. T converter(
    1. String s
    ),
  3. T defaultValue(), {
  4. 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);
}