Skip to content

Commit

Permalink
Save state of tab (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
WezSieTato authored Aug 27, 2024
1 parent 7e7eb43 commit 443f0b7
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,28 @@ class _PolaAppState extends State<PolaApp> {
onTap: _onItemTapped,
currentIndex: _selectedIndex,
),
body: _getTabContentWidget()),
body: IndexedStack(
index: _selectedIndex,
children: _tabs,
)
),
),
);
}

Widget _getTabContentWidget() {
switch (_selectedIndex) {
case 0:
return MainPage();
case 1:
return WebViewPage(
title: "Wyszukiwarka",
url: "https://www.pola-app.pl/m/search/",
showBackButton: false
);
case 2:
return WebViewPage(
title: "Wiadomości",
url: "https://www.pola-app.pl/m/blog/",
showBackButton: false
);
default:
return MainPage();
}
}
final List<Widget> _tabs = [
MainPage(),
WebViewPage(
title: "Wyszukiwarka",
url: "https://www.pola-app.pl/m/search/",
showBackButton: false
),
WebViewPage(
title: "Wiadomości",
url: "https://www.pola-app.pl/m/blog/",
showBackButton: false
)
];

AnalyticsMainTab _getTabParameter(int index) {
switch (index) {
Expand Down

0 comments on commit 443f0b7

Please sign in to comment.