import 'dart:convert'; import 'package:azlistview/azlistview.dart'; import 'package:flutter/material.dart'; class CityModel extends ISuspensionBean { String name; String? tagIndex; String? namePinyin; CityModel({ required this.name, this.tagIndex, this.namePinyin, }); CityModel.fromJson(Map json) : name = json['name']; Map toJson() => { 'name': name, // 'tagIndex': tagIndex, // 'namePinyin': namePinyin, // 'isShowSuspension': isShowSuspension }; @override String getSuspensionTag() => tagIndex!; @override String toString() => json.encode(this); } class ContactInfo extends ISuspensionBean { String name; String? tagIndex; String? namePinyin; Color? bgColor; IconData? iconData; String? img; String? id; String? firstletter; ContactInfo({ required this.name, this.tagIndex, this.namePinyin, this.bgColor, this.iconData, this.img, this.id, this.firstletter, }); ContactInfo.fromJson(Map json) : name = json['name'], img = json['img'], id = json['id']?.toString(), firstletter = json['firstletter']; Map toJson() => { // 'id': id, 'name': name, 'img': img, // 'firstletter': firstletter, // 'tagIndex': tagIndex, // 'namePinyin': namePinyin, // 'isShowSuspension': isShowSuspension }; @override String getSuspensionTag() => tagIndex!; @override String toString() => json.encode(this); } // class Languages extends GithubLanguage with ISuspensionBean { // String? tagIndex; // String? pinyin; // String? shortPinyin; // Languages.fromJson(Map json) : super.fromJson(json); // @override // Map toJson() { // final Map map = super.toJson(); // void addIfNonNull(String fieldName, dynamic value) { // if (value != null) { // map[fieldName] = value; // } // } // // addIfNonNull('tagIndex', tagIndex); // return map; // } // @override // String getSuspensionTag() { // return tagIndex!; // } // @override // String toString() { // return json.encode(this); // } // }