first commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
class School {
|
||||
final int id;
|
||||
final String name;
|
||||
final String? logo;
|
||||
final String? addressFull;
|
||||
|
||||
School({required this.id, required this.name, this.logo, this.addressFull});
|
||||
|
||||
factory School.fromJson(Map<String, dynamic> j) {
|
||||
return School(
|
||||
id: (j['id'] as num).toInt(),
|
||||
name: (j['name'] ?? '').toString(),
|
||||
logo: (j['logo'] as String?)?.trim().isEmpty == true ? null : j['logo'],
|
||||
addressFull: (j['address_full'] as String?)?.trim().isEmpty == true
|
||||
? null
|
||||
: j['address_full'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user