kelola penyewa dan beberapa error fix
This commit is contained in:
@ -19,12 +19,12 @@ class PetugasBumdesBinding extends Bindings {
|
||||
print('Error removing controller: $e');
|
||||
}
|
||||
|
||||
// Gunakan put untuk memastikan controller selalu tersedia dan permanent
|
||||
Get.put<PetugasBumdesDashboardController>(
|
||||
PetugasBumdesDashboardController(),
|
||||
permanent: true,
|
||||
// Gunakan lazyPut untuk memastikan controller hanya diinisialisasi saat dibutuhkan
|
||||
Get.lazyPut<PetugasBumdesDashboardController>(
|
||||
() => PetugasBumdesDashboardController(),
|
||||
fenix: true, // Akan dibuat ulang jika dihapus
|
||||
);
|
||||
|
||||
print('✅ PetugasBumdesDashboardController registered successfully');
|
||||
print('✅ PetugasBumdesDashboardController initialized successfully');
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,15 @@ import '../modules/warga/controllers/warga_dashboard_controller.dart';
|
||||
class WargaBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.lazyPut<AuthProvider>(() => AuthProvider());
|
||||
Get.lazyPut<WargaDashboardController>(() => WargaDashboardController());
|
||||
// Pastikan AuthProvider teregistrasi
|
||||
if (!Get.isRegistered<AuthProvider>()) {
|
||||
Get.put(AuthProvider());
|
||||
}
|
||||
|
||||
// Gunakan lazyPut untuk memastikan controller hanya diinisialisasi saat dibutuhkan
|
||||
Get.lazyPut<WargaDashboardController>(
|
||||
() => WargaDashboardController(),
|
||||
fenix: true, // Akan dibuat ulang jika dihapus
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user