57 lines
1.7 KiB
Dart
57 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:instruction_app/screens/instruction_page/instruction_list_page.dart';
|
|
import 'package:instruction_app/screens/worker_page/list_workers_page.dart';
|
|
import 'package:instruction_app/screens/organization_page/list_organization_page.dart';
|
|
import 'package:instruction_app/screens/instruction_log_page/instruction_log_list_page.dart';
|
|
|
|
class HomePage extends StatefulWidget {
|
|
const HomePage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<HomePage> createState() => _HomePageState();
|
|
}
|
|
|
|
class _HomePageState extends State<HomePage> {
|
|
int _selectedIndex = 0;
|
|
|
|
static final List<Widget> _pages = [
|
|
const InstructionListPage(),
|
|
const ListWorkersPage(),
|
|
const OrganizationListPage(),
|
|
const InstructionLogListPage()
|
|
];
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: _pages[_selectedIndex],
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
type: BottomNavigationBarType.fixed,
|
|
currentIndex: _selectedIndex,
|
|
onTap: (index) {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
});
|
|
},
|
|
items: const [
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.description),
|
|
label: 'Инструктажи',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.people),
|
|
label: 'Работники',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.business),
|
|
label: 'Организации',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.assignment),
|
|
label: 'Журнал',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
} |