save before flutter upgrade
This commit is contained in:
23
lib/models/state.dart
Normal file
23
lib/models/state.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class StateAPI {
|
||||
StateAPI({
|
||||
required this.id,
|
||||
required this.code,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
int id;
|
||||
String code;
|
||||
String name;
|
||||
|
||||
factory StateAPI.fromJson(String str) => StateAPI.fromMap(json.decode(str));
|
||||
|
||||
factory StateAPI.fromMap(Map<String, dynamic> json) {
|
||||
return StateAPI(
|
||||
id: json["state_id"],
|
||||
code: json['code'],
|
||||
name: json['name'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user