import 'position.dart'; import 'dart:convert'; /// id : 153966 /// address : "1400 N Shoreline Blvd, Mountain View, CA 94043, USA" /// home : false /// position : {"id":153967,"longitude":37.4135457,"altitude":-122.0803274} Address addressFromJson(String str) => Address.fromJson(json.decode(str)); String addressToJson(Address data) => json.encode(data.toJson()); class Address { Address({ this.id, this.address, this.home, this.position,}); Address.fromJson(dynamic json) { id = json['id']; address = json['address']; home = json['home']; position = json['position'] != null ? Position.fromJson(json['position']) : null; } int? id; String? address; bool? home; Position? position; Map toJson() { final map = {}; map['id'] = id; map['address'] = address; map['home'] = home; if (position != null) { map['position'] = position?.toJson(); } return map; } }