Perbarui konfigurasi routing setelah penghapusan modul dashboard dan home

- Sesuaikan konfigurasi routing aplikasi
- Hapus referensi ke modul dashboard dan home yang sudah tidak digunakan
- Bersihkan binding dan impor yang tidak perlu
- menambahkan model-model
This commit is contained in:
Khafidh Fuadi
2025-03-09 11:20:29 +07:00
parent c8f529bd1a
commit 0b5a8fbe56
14 changed files with 901 additions and 0 deletions

View File

@ -0,0 +1,52 @@
import 'dart:convert';
class DonaturModel {
final String id;
final String nama;
final String? alamat;
final String? noTelp;
final String? email;
final String? jenisDonatur; // Individu, Organisasi, Perusahaan, dll
final DateTime createdAt;
final DateTime? updatedAt;
DonaturModel({
required this.id,
required this.nama,
this.alamat,
this.noTelp,
this.email,
this.jenisDonatur,
required this.createdAt,
this.updatedAt,
});
factory DonaturModel.fromRawJson(String str) =>
DonaturModel.fromJson(json.decode(str));
String toRawJson() => json.encode(toJson());
factory DonaturModel.fromJson(Map<String, dynamic> json) => DonaturModel(
id: json["id"],
nama: json["nama"],
alamat: json["alamat"],
noTelp: json["no_telp"],
email: json["email"],
jenisDonatur: json["jenis_donatur"],
createdAt: DateTime.parse(json["created_at"]),
updatedAt: json["updated_at"] == null
? null
: DateTime.parse(json["updated_at"]),
);
Map<String, dynamic> toJson() => {
"id": id,
"nama": nama,
"alamat": alamat,
"no_telp": noTelp,
"email": email,
"jenis_donatur": jenisDonatur,
"created_at": createdAt.toIso8601String(),
"updated_at": updatedAt?.toIso8601String(),
};
}