import 'package:flutter/material.dart'; import 'package:tangocard_reader/service/tangocard_files.dart'; import 'pages/tango_set_list.dart'; class Home extends StatefulWidget { const Home({Key? key}) : super(key: key); @override State createState() => _HomeState(); } class _HomeState extends State { int page = 0; final _pages = [ TangoSetList(files: tangocardFilePaths, route: '/list/tango',), TangoSetList(files: kanjicardFilePaths, route: '/list/kanji',), ]; @override Widget build(BuildContext context) => Scaffold( appBar: AppBar( title: const Text("よく単語"), centerTitle: true, ), body: _pages[page], bottomNavigationBar: BottomNavigationBar( onTap: (int index) => setState(() => page = index), currentIndex: page, items: const [ BottomNavigationBarItem(label: 'Tango', icon: Icon(Icons.style)), BottomNavigationBarItem(label: 'Kanji', icon: Text('漢字')), ], ), ); }