
- Ganti `Key? key` dengan `super.key` di berbagai tampilan - Gunakan `withAlpha()` sebagai pengganti `withOpacity()` untuk transparansi warna - Lakukan penyesuaian kecil pada tata letak dan styling komponen - Hapus impor yang tidak digunakan - Sederhanakan beberapa bagian kode dashboard
64 lines
1.7 KiB
Dart
64 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:penyaluran_app/app/modules/home/controllers/home_controller.dart';
|
|
|
|
class HomeView extends GetView<HomeController> {
|
|
const HomeView({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Penyaluran App'),
|
|
actions: [
|
|
IconButton(
|
|
icon: const Icon(Icons.logout),
|
|
onPressed: controller.logout,
|
|
tooltip: 'Logout',
|
|
),
|
|
],
|
|
),
|
|
body: SafeArea(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(20.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// Greeting
|
|
Text(
|
|
'Halo, ${controller.user?.email ?? 'Pengguna'}!',
|
|
style: const TextStyle(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const SizedBox(height: 5),
|
|
const Text(
|
|
'Selamat datang di Penyaluran App',
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
color: Colors.grey,
|
|
),
|
|
),
|
|
const SizedBox(height: 30),
|
|
|
|
// Dashboard Content
|
|
const Expanded(
|
|
child: Center(
|
|
child: Text(
|
|
'Halaman Dashboard',
|
|
style: TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|