fromMap method

  1. @override
T fromMap(
  1. Map<String, dynamic> map
)
override

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);
}