diff --git a/lib/main.dart b/lib/main.dart index 0834a07..2d3e205 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -31,7 +31,7 @@ class _HomeState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: Text(pages[_selectedPage].title), + title: pages[_selectedPage].titleBar, centerTitle: true, ), body: pages[_selectedPage].content, @@ -79,31 +79,31 @@ final List navBar = [ ]; class Page { - String title; Widget content; + Widget titleBar; - Page({this.title, this.content}); + Page({ this.content,this.titleBar,}); } final List pages = [ Page( - title: "Search", content: SearchView(), + titleBar: Text('Search') ), Page( - title: "Kanji", content: KanjiView(), + titleBar: KanjiViewBar(), ), Page( - title: "History", content: HistoryView(), + titleBar: Text("History"), ), Page( - title: "Memorization", content: Container(), + titleBar: Text("Memorization"), ), Page( - title: "Settings", content: Container(), + titleBar: Text("Settings"), ), ]; diff --git a/lib/screens/kanji_search.dart b/lib/screens/kanji_search.dart index 41ad316..1a60ff6 100644 --- a/lib/screens/kanji_search.dart +++ b/lib/screens/kanji_search.dart @@ -30,6 +30,13 @@ class _KanjiSearchPage extends StatelessWidget { } } +class KanjiViewBar extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Text('Kanji'); + } +} + class KanjiSearchBar extends StatelessWidget { @override Widget build(BuildContext context) {