ThingSmartUserModel.fromJson constructor

ThingSmartUserModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

ThingSmartUserModel.fromJson(Map<String, dynamic> json)
    : uid = json['uid'],username = json['userName'],
      countryCode = json['countryCode'],
      email = json['email'],
      regionCode = json['regionCode'],
      phoneNumber = json['phoneNumber'],
      nickname = json['snsNickname'],
      headIconUrl = json['headIconUrl'].toString().isEmpty
          ? null
          : json['headIconUrl'].toString().startsWith('http')
              ? json['headIconUrl']
              : 'https://images.tuyaeu.com/${json['headIconUrl']}',
      tempUnit =json['tempUnit'],
      timezoneId = json['timezoneId'],
      regFrom = json['regFrom'];