
- Tambahkan paket image_picker untuk mengambil foto - Perbarui AndroidManifest.xml dan Info.plist untuk izin kamera dan galeri - Tambahkan metode pickfotoBuktiSerahTerima di PenitipanBantuanController - Buat dialog verifikasi dengan fitur upload foto bukti serah terima - Perbarui model PenitipanBantuanModel untuk mendukung foto bukti - Integrasikan upload file ke Supabase storage
63 lines
1.5 KiB
Dart
63 lines
1.5 KiB
Dart
import 'dart:convert';
|
|
|
|
class DonaturModel {
|
|
final String? id;
|
|
final String? nama;
|
|
final String? alamat;
|
|
final String? telepon;
|
|
final String? email;
|
|
final String? jenis;
|
|
final String? deskripsi;
|
|
final String? status;
|
|
final DateTime? createdAt;
|
|
final DateTime? updatedAt;
|
|
|
|
DonaturModel({
|
|
this.id,
|
|
this.nama,
|
|
this.alamat,
|
|
this.telepon,
|
|
this.email,
|
|
this.jenis,
|
|
this.deskripsi,
|
|
this.status,
|
|
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"],
|
|
telepon: json["telepon"],
|
|
email: json["email"],
|
|
jenis: json["jenis"],
|
|
deskripsi: json["deskripsi"],
|
|
status: json["status"] ?? 'AKTIF',
|
|
createdAt: json["created_at"] != null
|
|
? DateTime.parse(json["created_at"])
|
|
: null,
|
|
updatedAt: json["updated_at"] != null
|
|
? DateTime.parse(json["updated_at"])
|
|
: null,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
"id": id,
|
|
"nama": nama,
|
|
"alamat": alamat,
|
|
"telepon": telepon,
|
|
"email": email,
|
|
"jenis": jenis,
|
|
"deskripsi": deskripsi,
|
|
"status": status ?? 'AKTIF',
|
|
"created_at": createdAt?.toIso8601String(),
|
|
"updated_at": updatedAt?.toIso8601String(),
|
|
};
|
|
}
|