diff --git a/lib/main.dart b/lib/main.dart index 5e15e42..96d3a2a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,59 +20,59 @@ class MyApp extends StatelessWidget { class Home extends StatefulWidget { @override _HomeState createState() => _HomeState(); - } class _HomeState extends State { int _selectedPage = 0; @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(pages[_selectedPage].title), - centerTitle: true, - ), - body: pages[_selectedPage].content, - bottomNavigationBar: BottomNavigationBar( - currentIndex: _selectedPage, - onTap: (int index) { - setState(() { - _selectedPage = index; - }); - }, - items: navBar, - showSelectedLabels: false, - showUnselectedLabels: false, - unselectedItemColor: Colors.blue, - selectedItemColor: Colors.green, - ), - ); - } - + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(pages[_selectedPage].title), + centerTitle: true, + ), + body: pages[_selectedPage].content, + bottomNavigationBar: BottomNavigationBar( + currentIndex: _selectedPage, + onTap: (int index) { + setState(() { + _selectedPage = index; + }); + }, + items: navBar, + showSelectedLabels: false, + showUnselectedLabels: false, + unselectedItemColor: Colors.blue, + selectedItemColor: Colors.green, + ), + ); + } } List navBar = [ BottomNavigationBarItem( title: Text('Search'), - icon: Icon(Icons.search) + icon: Icon(Icons.search), ), BottomNavigationBarItem( title: Text('Kanji'), icon: Text( '漢', - style: TextStyle( - fontSize: 18 - ), - ) + style: TextStyle(fontSize: 18), + ), + ), + BottomNavigationBarItem( + title: Text('Log'), + icon: Icon(Icons.bookmark), ), BottomNavigationBarItem( title: Text('Memorize'), - icon: Icon(Icons.local_offer) + icon: Icon(Icons.local_offer), ), BottomNavigationBarItem( title: Text('Settings'), - icon: Icon(Icons.settings) + icon: Icon(Icons.settings), ), ]; @@ -80,27 +80,28 @@ class Page { String title; Widget content; - Page({ - this.title, - this.content - }); + Page({this.title, this.content}); } List pages = [ Page( title: "Search", - content: Container() + content: Container(), ), Page( title: "Kanji", - content: KanjiSearch() + content: KanjiSearch(), + ), + Page( + title: "Log", + content: Container(), ), Page( title: "Memorization", - content: Container() + content: Container(), ), Page( title: "Settings", - content: Container() + content: Container(), ), -]; \ No newline at end of file +]; diff --git a/lib/screens/log.dart b/lib/screens/log.dart new file mode 100644 index 0000000..e69de29