73 lines
1.9 KiB
Dart
73 lines
1.9 KiB
Dart
import 'package:chicken/page/dashboard.dart';
|
|
import 'package:chicken/page/jadwal.dart';
|
|
import 'package:chicken/page/minum.dart';
|
|
import 'package:chicken/page/pakan.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
void main() {
|
|
runApp(const HomeApp());
|
|
}
|
|
|
|
class HomeApp extends StatefulWidget {
|
|
const HomeApp({super.key});
|
|
|
|
@override
|
|
State<HomeApp> createState() => _HomeAppState();
|
|
}
|
|
|
|
class _HomeAppState extends State<HomeApp> {
|
|
int _currentIndex = 0;
|
|
|
|
final List<Widget> _pages = [
|
|
Dashboard(),
|
|
pakan(),
|
|
minum(),
|
|
jadwal(),
|
|
];
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar:AppBar(
|
|
title: Row(
|
|
children: [
|
|
Image.asset(
|
|
'images/logos.png',
|
|
width: 46,
|
|
height: 46,
|
|
),
|
|
],
|
|
),
|
|
backgroundColor: Colors.transparent,
|
|
elevation: 0,
|
|
),
|
|
body: _pages[_currentIndex],
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
currentIndex: _currentIndex,
|
|
onTap: (index) {
|
|
setState(() {
|
|
_currentIndex = index;
|
|
});
|
|
},
|
|
backgroundColor: Colors.amber,
|
|
items: [
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.home),
|
|
label: 'Home', backgroundColor: Colors.orange,
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.food_bank_sharp),
|
|
label: 'Makan', backgroundColor: Colors.orange,
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.water_drop),
|
|
label: 'Minum', backgroundColor: Colors.orange,
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.schedule_rounded),
|
|
label: 'Jadwal', backgroundColor: Colors.orange,
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |