You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
654 B
29 lines
654 B
// To parse this JSON data, do |
|
// |
|
// final address = addressFromJson(jsonString); |
|
|
|
import 'dart:convert'; |
|
|
|
Address addressFromJson(String str) => Address.fromJson(json.decode(str)); |
|
|
|
String addressToJson(Address data) => json.encode(data.toJson()); |
|
|
|
class Address { |
|
String streetName; |
|
String comments; |
|
|
|
Address({ |
|
required this.streetName, |
|
required this.comments, |
|
}); |
|
|
|
factory Address.fromJson(Map<String, dynamic> json) => Address( |
|
streetName: json["street_name"], |
|
comments: json["comments"], |
|
); |
|
|
|
Map<String, dynamic> toJson() => { |
|
"street_name": streetName, |
|
"comments": comments, |
|
}; |
|
}
|
|
|