toMap abstract method

Map<String, dynamic> toMap()

将对象转换为Map

  @override
  Map<String, dynamic> toMap() {
    var map = <String, dynamic>{
      "id": id,
      "name": name,
    };
    return map;
  }

Implementation

Map<String, dynamic> toMap();