attributeToProperty<T> function
Implementation
T attributeToProperty<T>(String value) {
// The most using type.
if (T == String) {
return value as T;
} else if (T == bool) {
return true as T;
} else if (T == int) {
return (int.tryParse(value) ?? 0) as T;
} else if (T == double) {
return (double.tryParse(value) ?? 0.0) as T;
} else {
return value as T;
}
}