PropertyInfo constructor
Creates a new instance of PropertyInfo.
_name - The name of the property, usualle the same as the name of the getter/setter
_type - The type of the property.
defaultValue - A default value for the property if it has not been set.
Implementation
PropertyInfo(this._name, this._type, [Object? defaultValue]) {
if (defaultValue == null && _type == String) {
_defaultValue = '';
} else if (defaultValue == null && _type == int) {
_defaultValue = 0;
} else if (defaultValue == null && _type == double) {
_defaultValue = 0.0;
} else if (defaultValue == null && _type == DateTime) {
_defaultValue = DateTime.fromMicrosecondsSinceEpoch(0);
} else if (defaultValue == null && _type == bool) {
_defaultValue = false;
} else {
_defaultValue = defaultValue;
}
}