fromMap static method
- Map<
String, dynamic> ? map, { - EnumMethod? enumMethod,
Gets a possible AjaxRequestEvent instance from a Map value.
Implementation
static AjaxRequestEvent? fromMap(
Map<String, dynamic>? map, {
EnumMethod? enumMethod,
}) {
if (map == null) {
return null;
}
final instance = AjaxRequestEvent(
lengthComputable: map['lengthComputable'],
loaded: map['loaded'],
total: map['total'],
type: switch (enumMethod ?? EnumMethod.nativeValue) {
EnumMethod.nativeValue => AjaxRequestEventType.fromNativeValue(
map['type'],
),
EnumMethod.value => AjaxRequestEventType.fromValue(map['type']),
EnumMethod.name => AjaxRequestEventType.byName(map['type']),
},
);
return instance;
}