Files
AcWeb/ac_web/lib/Layouts/MobileView.dart
T
2026-08-18 18:35:45 +02:00

51 lines
1.3 KiB
Dart

import 'package:ac_web/Pages/LatestReports.dart';
import 'package:flutter/material.dart';
class MobileView extends StatefulWidget {
const MobileView({super.key});
@override
State<StatefulWidget> createState() => MobileViewState();
}
class MobileViewState extends State<MobileView> {
int currentPageIndex = 1;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text("AC Control"),
),
bottomNavigationBar: NavigationBar(
onDestinationSelected: (int index) {
setState(() {
currentPageIndex = index;
});
},
indicatorColor: Theme.of(context).colorScheme.inversePrimary,
selectedIndex: currentPageIndex,
destinations: [
NavigationDestination(icon: Icon(Icons.newspaper), label: 'Reports'),
NavigationDestination(icon: Icon(Icons.home), label: 'Latest Reports'),
NavigationDestination(icon: Icon(Icons.adb), label: 'Agents')
],
),
body: <Widget>[
// Homepage
Text("Homepage"),
// Eighteen
LatestReports(),
// Notifications
Text("Notifications")
][currentPageIndex],
);
}
}