
- Tambahkan dependensi utama: GetX, Supabase, SharedPreferences - Konfigurasi struktur awal aplikasi dengan GetX - Inisialisasi layanan Supabase - Perbarui konfigurasi plugin untuk berbagai platform - Ganti template default dengan struktur aplikasi baru
37 lines
891 B
Dart
37 lines
891 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:penyaluran_app/app/routes/app_pages.dart';
|
|
import 'package:penyaluran_app/app/services/supabase_service.dart';
|
|
|
|
void main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
// Inisialisasi Supabase
|
|
await initServices();
|
|
|
|
runApp(const MyApp());
|
|
}
|
|
|
|
// Inisialisasi service
|
|
Future<void> initServices() async {
|
|
await Get.putAsync(() => SupabaseService().init());
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GetMaterialApp(
|
|
title: 'Penyaluran App',
|
|
theme: ThemeData(
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
|
|
useMaterial3: true,
|
|
),
|
|
debugShowCheckedModeBanner: false,
|
|
initialRoute: AppPages.INITIAL,
|
|
getPages: AppPages.routes,
|
|
);
|
|
}
|
|
}
|