mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #824 from HansMuller/save_tabs_selection
Make the StockHome TabBar selection persistent Fixes #671
This commit is contained in:
commit
b42ac4e6ab
@ -22,9 +22,18 @@ class StockHome extends StatefulComponent {
|
||||
class StockHomeState extends State<StockHome> {
|
||||
|
||||
final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
|
||||
final TabBarSelection _tabBarSelection = new TabBarSelection();
|
||||
bool _isSearching = false;
|
||||
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() {
|
||||
ModalRoute.of(context).addLocalHistoryEntry(new LocalHistoryEntry(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user