yokutango-mobile-reader/lib/screens/home.dart

38 lines
1.0 KiB
Dart
Raw Normal View History

2022-01-26 00:25:07 +01:00
import 'package:flutter/material.dart';
2022-01-26 01:58:47 +01:00
import 'package:tangocard_reader/service/tangocard_files.dart';
import 'pages/tango_set_list.dart';
2022-01-26 00:25:07 +01:00
2022-01-26 01:58:47 +01:00
class Home extends StatefulWidget {
2022-01-26 00:25:07 +01:00
const Home({Key? key}) : super(key: key);
@override
2022-01-26 01:58:47 +01:00
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
int page = 0;
final _pages = [
TangoSetList(files: tangocardFilePaths, route: '/list/tango',),
TangoSetList(files: kanjicardFilePaths, route: '/list/kanji',),
];
@override
Widget build(BuildContext context) => Scaffold(
2022-01-26 00:25:07 +01:00
appBar: AppBar(
title: const Text("よく単語"),
centerTitle: true,
),
2022-01-26 01:58:47 +01:00
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('漢字')),
],
2022-01-26 00:25:07 +01:00
),
);
}