toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  Map<String, dynamic> map = {};

  if (id != null) {
    map['_id'] = id;
  }
  if (token != null) {
    map['token'] = token;
  }
  if (appName != null) {
    map['appName'] = appName;
  }
  if (userId != null) {
    map['userId'] = userId;
  }
  if (enabled != null) {
    map['enabled'] = enabled;
  }
  if (createdAt != null) {
    map['createdAt'] = createdAt!.toIso8601String();
  }
  if (updatedAt != null) {
    map['updatedAt'] = updatedAt!.toIso8601String();
  }

  return map;
}