fromMap method
fromMap Fuction For Convert From Map To Item
Implementation
@override
T fromMap(Map<String, dynamic> map) {
if (table.isAutoMap) {
T newItem = table.newEmptyObject();
table.primaryKeySet(newItem, map[table.primaryKeyName]);
for (var propertyItem in table.properties!) {
propertyItem.propertySet!(
newItem,
propertyItem.type == TypeEnum.BOOL
? (map[propertyItem.name] == 1)
: map[propertyItem.name]);
}
return newItem;
}
return table.fromMap!(map);
}