import 'package:flutter/material.dart'; import 'add_form.dart'; import 'data_util.dart' as data; void main() { runApp(const BoxChecker()); } class BoxChecker extends StatelessWidget { const BoxChecker({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData(brightness: Brightness.dark), themeMode: ThemeMode.dark, home: const MainListPage(title: 'BoxChecker'), ); } } class MainListPage extends StatefulWidget { const MainListPage({Key? key, required this.title}) : super(key: key); final String title; @override State createState() => _MainListPageState(); } class _MainListPageState extends State { int _selectedPage = data.Page.lists.index; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text(widget.title), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: FloatingActionButton( onPressed: () { Navigator.push( context, MaterialPageRoute( builder: (context) => AddForm(type: data.Page.values[_selectedPage]))); }, // TODO Implement add button tooltip: 'Add List', child: const Icon(Icons.add), ), body: ListView.builder(itemBuilder: (context, index) { return ListTile(); // TODO Implement tile rendering }), bottomNavigationBar: BottomNavigationBar( currentIndex: _selectedPage, onTap: (index) { setState(() { _selectedPage = index; }); }, items: const [ BottomNavigationBarItem( icon: Icon(Icons.checklist), label: "Lists", ), BottomNavigationBarItem( icon: Icon(Icons.folder_open), label: "Templates", ), ])); } }