passo_mobile_app/lib/model/location/region.dart

35 lines
811 B
Dart
Raw Normal View History

2023-02-15 03:40:12 +00:00
// To parse this JSON data, do
//
// final region = regionFromJson(jsonString);
import 'package:meta/meta.dart';
import 'dart:convert';
Region regionFromJson(String str) => Region.fromJson(json.decode(str));
String regionToJson(Region data) => json.encode(data.toJson());
class Region {
Region({
required this.code,
required this.description,
required this.psgcCode,
});
final int? code;
final String? description;
final String? psgcCode;
2023-02-15 03:40:12 +00:00
factory Region.fromJson(Map<String, dynamic> json) => Region(
code: json["code"],
description: json["description"],
psgcCode: json["psgc_code"],
);
Map<String, dynamic> toJson() => {
"code": code,
"description": description,
"psgc_code": psgcCode,
};
}