53 lines
1.4 KiB
Dart
53 lines
1.4 KiB
Dart
import 'package:ac_web/Pages/AgentAvailabilities.dart';
|
|
import 'package:ac_web/Pages/LatestReports.dart';
|
|
import 'package:ac_web/Pages/Reports.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>[
|
|
|
|
// Reports grouped by their type
|
|
Reports(),
|
|
|
|
// Eighteen
|
|
LatestReports(),
|
|
|
|
// Agents
|
|
AgentAvailabilities()
|
|
][currentPageIndex],
|
|
);
|
|
}
|
|
} |