OkHiUser.fromMap constructor

OkHiUser.fromMap({
  1. required String phone,
  2. required Map<String, dynamic> data,
})

Implementation

OkHiUser.fromMap({required this.phone, required Map<String, dynamic> data}) {
  id = data.containsKey("id") ? data["id"] : null;
  firstName = data.containsKey("firstName")
      ? data["firstName"]
      : data.containsKey("first_name")
          ? data["first_name"]
          : null;
  lastName = data.containsKey("lastName")
      ? data["lastName"]
      : data.containsKey("last_name")
          ? data["last_name"]
          : null;
}