ToMap method

Map<String, dynamic> ToMap(
  1. T item
)

Implementation

Map<String, dynamic> ToMap(T item) {
  if (isAutoMap) {
    Map<String, dynamic> map = {};
    for (var property in properties!) {
      map.addEntries([
        MapEntry(
            property.name,
            property.type == TypeEnum.BOOL
                ? (property.propertyGet!(item) == true ? 1 : 0)
                : property.propertyGet!(item))
      ]);
    }
    map.addEntries([MapEntry(primaryKeyName, primaryKeyGet(item))]);
    return map;
  }
  return toMap!(item);
}