GetAllSpecialitiesProviders

 avatar
unknown
dart
3 years ago
7.0 kB
0
Indexable
import 'package:mobile/app/services/methods/tools.dart';

Tools tools = Tools();

class GetAllSpecialitiesProviders {
  bool succeeded;
  Data data;
  Null warningErrors;
  List<Null> validationErrors;

  GetAllSpecialitiesProviders(
      {this.succeeded, this.data, this.warningErrors, this.validationErrors});

  GetAllSpecialitiesProviders.fromJson(Map<String, dynamic> json) {
    succeeded = json['succeeded'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
    warningErrors = json['warningErrors'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['succeeded'] = this.succeeded;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    data['warningErrors'] = this.warningErrors;

    return data;
  }
}

class Data {
  int totalCount;
  List<SpecialitiesProvidersItems> items;

  Data({this.totalCount, this.items});

  Data.fromJson(Map<String, dynamic> json) {
    totalCount = json['totalCount'];
    if (json['items'] != null) {
      items = new List<SpecialitiesProvidersItems>();
      json['items'].forEach((v) {
        items.add(new SpecialitiesProvidersItems.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['totalCount'] = this.totalCount;
    if (this.items != null) {
      data['items'] = this.items.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class SpecialitiesProvidersItems {
  String providerUserName;
  int genderId;
  String providerId;
  String providerName;
  String providerProfileUrl;
  double rating;
  String briefAboutMe;
  Address address;
  List<String> distance;
  int roleId;
  String roleNameAr;
  String roleNameEn;
  int categoryId;
  String categoryNameAr;
  String categoryNameEn;
  int specialityId;
  String specialityNameAr;
  String specialityNameEn;
  String descr;
  double price;
  Null docId;
  String imageUrl;
  String createdDate;
  Null createdBy;
  String modifiedDate;
  Null modifiedBy;
  bool isDeleted;
  String id;

  SpecialitiesProvidersItems(
      {this.genderId,
      this.providerUserName,
      this.providerId,
      this.providerName,
      this.providerProfileUrl,
      this.rating,
      this.briefAboutMe,
      this.address,
      this.distance,
      this.roleId,
      this.roleNameAr,
      this.roleNameEn,
      this.categoryId,
      this.categoryNameAr,
      this.categoryNameEn,
      this.specialityId,
      this.specialityNameAr,
      this.specialityNameEn,
      this.descr,
      this.price,
      this.docId,
      this.imageUrl,
      this.createdDate,
      this.createdBy,
      this.modifiedDate,
      this.modifiedBy,
      this.isDeleted,
      this.id});

  SpecialitiesProvidersItems.fromJson(Map<String, dynamic> json) {
    providerUserName = json['providerUserName'];
    genderId = json['genderId'];
    providerId = json['providerId'];
    providerName = json['providerName'];
    providerProfileUrl = json['providerProfileUrl'];
    rating = json['rating'];
    briefAboutMe = json['briefAboutMe'];
    address =
        json['address'] != null ? new Address.fromJson(json['address']) : null;
    distance = <String> [];
    roleId = json['roleId'];
    roleNameAr = json['roleNameAr'];
    roleNameEn = json['roleNameEn'];
    categoryId = json['categoryId'];
    categoryNameAr = json['categoryNameAr'];
    categoryNameEn = json['categoryNameEn'];
    specialityId = json['specialityId'];
    specialityNameAr = json['specialityNameAr'];
    specialityNameEn = json['specialityNameEn'];
    descr = json['descr'];
    price = json['price'];
    docId = json['docId'];
    imageUrl = json['imageUrl'];
    createdDate = json['createdDate'];
    createdBy = json['createdBy'];
    modifiedDate = json['modifiedDate'];
    modifiedBy = json['modifiedBy'];
    isDeleted = json['isDeleted'];
    id = json['id'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['genderId'] = this.genderId;
    data['providerUserName'] = this.providerUserName;
    data['providerId'] = this.providerId;
    data['providerName'] = this.providerName;
    data['providerProfileUrl'] = this.providerProfileUrl;
    data['rating'] = this.rating;
    data['briefAboutMe'] = this.briefAboutMe;
    if (this.address != null) {
      data['address'] = this.address.toJson();
    }
    data['roleId'] = this.roleId;
    data['roleNameAr'] = this.roleNameAr;
    data['roleNameEn'] = this.roleNameEn;
    data['categoryId'] = this.categoryId;
    data['categoryNameAr'] = this.categoryNameAr;
    data['categoryNameEn'] = this.categoryNameEn;
    data['specialityId'] = this.specialityId;
    data['specialityNameAr'] = this.specialityNameAr;
    data['specialityNameEn'] = this.specialityNameEn;
    data['descr'] = this.descr;
    data['price'] = this.price;
    data['docId'] = this.docId;
    data['imageUrl'] = this.imageUrl;
    data['createdDate'] = this.createdDate;
    data['createdBy'] = this.createdBy;
    data['modifiedDate'] = this.modifiedDate;
    data['modifiedBy'] = this.modifiedBy;
    data['isDeleted'] = this.isDeleted;
    data['id'] = this.id;
    return data;
  }
}

class Address {
  String area;
  String region;
  String street;
  String buildingNumber;
  String city;
  String createdDate;
  String createdBy;
  String modifiedDate;
  String modifiedBy;
  bool isDeleted;
  String id;
  int cityId;
  String latitude;
  String longitude;

  Address(
      {this.area,
      this.region,
      this.street,
      this.buildingNumber,
      this.city,
      this.createdDate,
      this.createdBy,
      this.modifiedDate,
      this.modifiedBy,
      this.isDeleted,
      this.id,
      this.cityId,
      this.latitude,
      this.longitude});

  Address.fromJson(Map<String, dynamic> json) {
    area = json['area'];
    region = json['region'];
    street = json['street'];
    buildingNumber = json['buildingNumber'];
    city = json['city'];
    createdDate = json['createdDate'];
    createdBy = json['createdBy'];
    modifiedDate = json['modifiedDate'];
    modifiedBy = json['modifiedBy'];
    isDeleted = json['isDeleted'];
    id = json['id'];
    cityId = json['cityId'];
    latitude = json['latitude'];
    longitude = json['longitude'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['area'] = this.area;
    data['region'] = this.region;
    data['street'] = this.street;
    data['buildingNumber'] = this.buildingNumber;
    data['city'] = this.city;
    data['createdDate'] = this.createdDate;
    data['createdBy'] = this.createdBy;
    data['modifiedDate'] = this.modifiedDate;
    data['modifiedBy'] = this.modifiedBy;
    data['isDeleted'] = this.isDeleted;
    data['id'] = this.id;
    data['cityId'] = this.cityId;
    data['latitude'] = this.latitude;
    data['longitude'] = this.longitude;
    return data;
  }
}
Editor is loading...