Commit 4eeddab9 authored by Hans Muller's avatar Hans Muller

Make the StockHome TabBar selection persistent

parent 8be3a4fd
...@@ -22,9 +22,18 @@ class StockHome extends StatefulComponent { ...@@ -22,9 +22,18 @@ class StockHome extends StatefulComponent {
class StockHomeState extends State<StockHome> { class StockHomeState extends State<StockHome> {
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>(); final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
final TabBarSelection _tabBarSelection = new TabBarSelection();
bool _isSearching = false; bool _isSearching = false;
String _searchQuery; String _searchQuery;
TabBarSelection _tabBarSelection;
void initState() {
super.initState();
_tabBarSelection = PageStorage.of(context)?.readState(context);
if (_tabBarSelection == null) {
_tabBarSelection = new TabBarSelection();
PageStorage.of(context)?.writeState(context, _tabBarSelection);
}
}
void _handleSearchBegin() { void _handleSearchBegin() {
ModalRoute.of(context).addLocalHistoryEntry(new LocalHistoryEntry( ModalRoute.of(context).addLocalHistoryEntry(new LocalHistoryEntry(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment