TKK_E32232340/lib/screens/home/views/home_screen.dart

67 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../blocs/authentication_bloc/authentication_bloc.dart';
import 'main_drawer.dart';
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: const MainDrawer(),
appBar: AppBar(
backgroundColor: Colors.white,
elevation: 0.5, // Kasih sedikit bayangan tipis agar elegan
centerTitle: false,
leading: Builder(
builder: (context) => IconButton(
icon: const Icon(Icons.menu,
color: Colors.black), // Ikon garis 3 horizontal
onPressed: () {
// ini kodenya untuk membuka:
Scaffold.of(context).openDrawer();
},
)),
title: Row(
children: [
// Ganti dengan Image.asset jika sudah ada logo
const Icon(Icons.cloud_queue, color: Colors.blue, size: 28),
const SizedBox(width: 10),
Text(
"Klimatologi",
style: GoogleFonts.rubik(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 20,
),
),
],
),
actions: [
IconButton(
icon: const Icon(Icons.notifications_none, color: Colors.black),
onPressed: () {
// Aksi notifikasi
},
),
IconButton(
icon: const Icon(Icons.logout, color: Colors.black),
onPressed: () {
// Trigger Logout di AuthenticationBloc kamu
context
.read<AuthenticationBloc>()
.add(AuthenticationLogoutRequested());
},
),
const SizedBox(width: 8),
],
),
body: const Center(
child: Text("body home page"),
),
);
}
}