toString method

  1. @override
String toString()
override

string json

Implementation

@override
String toString() {
  //TODO: implement toString
  Map<String, dynamic> obj = {
    'provinceName': provinceName,
    'provinceId': provinceId,
    'cityName': cityName,
    'villageName': villageName, // 增加第4级(村/镇)选择
    'cityId': cityId,
    'areaName': areaName,
    'areaId': areaId,
    'villageId': villageId // 增加第4级(村/镇)选择
  };
  obj.removeWhere((key, value) => value == null || value == 'null');

  return json.encode(obj);
}