Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: sky/sdk/example/stocks/lib/stock_home.dart

Issue 1231753008: Support for anonymous state routes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: re-upload Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/sdk/example/fitness/lib/home.dart ('k') | sky/sdk/lib/widgets/drawer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'package:sky/editing/input.dart'; 5 import 'package:sky/editing/input.dart';
6 import 'package:sky/animation/animation_performance.dart'; 6 import 'package:sky/animation/animation_performance.dart';
7 import 'package:sky/widgets/animated_component.dart'; 7 import 'package:sky/widgets/animated_component.dart';
8 import 'package:sky/widgets/animation_builder.dart'; 8 import 'package:sky/widgets/animation_builder.dart';
9 import 'package:sky/theme/colors.dart' as colors; 9 import 'package:sky/theme/colors.dart' as colors;
10 import 'package:sky/widgets/basic.dart'; 10 import 'package:sky/widgets/basic.dart';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 stockMode = source.stockMode; 50 stockMode = source.stockMode;
51 modeUpdater = source.modeUpdater; 51 modeUpdater = source.modeUpdater;
52 } 52 }
53 53
54 bool _isSearching = false; 54 bool _isSearching = false;
55 String _searchQuery; 55 String _searchQuery;
56 56
57 AnimationBuilder _snackbarTransform; 57 AnimationBuilder _snackbarTransform;
58 58
59 void _handleSearchBegin() { 59 void _handleSearchBegin() {
60 navigator.pushState("/search", (_) { 60 navigator.pushState(this, (_) {
61 setState(() { 61 setState(() {
62 _isSearching = false; 62 _isSearching = false;
63 _searchQuery = null; 63 _searchQuery = null;
64 }); 64 });
65 }); 65 });
66 setState(() { 66 setState(() {
67 _isSearching = true; 67 _isSearching = true;
68 }); 68 });
69 } 69 }
70 70
71 void _handleSearchEnd() { 71 void _handleSearchEnd() {
72 assert(navigator.currentRoute.name == '/search'); 72 assert(navigator.currentRoute.key == this);
73 navigator.pop(); 73 navigator.pop();
74 assert(navigator.currentRoute.name == '/');
75 setState(() { 74 setState(() {
76 _isSearching = false; 75 _isSearching = false;
77 _searchQuery = null; 76 _searchQuery = null;
78 }); 77 });
79 } 78 }
80 79
81 void _handleSearchQueryChanged(String query) { 80 void _handleSearchQueryChanged(String query) {
82 setState(() { 81 setState(() {
83 _searchQuery = query; 82 _searchQuery = query;
84 }); 83 });
85 } 84 }
86 85
87 bool _drawerShowing = false; 86 bool _drawerShowing = false;
88 DrawerStatus _drawerStatus = DrawerStatus.inactive; 87 DrawerStatus _drawerStatus = DrawerStatus.inactive;
89 88
90 void _handleOpenDrawer() { 89 void _handleOpenDrawer() {
91 setState(() { 90 setState(() {
92 _drawerShowing = true; 91 _drawerShowing = true;
93 _drawerStatus = DrawerStatus.active; 92 _drawerStatus = DrawerStatus.active;
94 }); 93 });
95 } 94 }
96 95
97 void _handleDrawerStatusChange(DrawerStatus status) { 96 void _handleDrawerStatusChange(DrawerStatus status) {
98 if (status == DrawerStatus.inactive && navigator.currentRoute.name == "/draw er") {
99 navigator.pop();
100 }
101 setState(() { 97 setState(() {
102 _drawerStatus = status; 98 _drawerStatus = status;
103 }); 99 });
104 } 100 }
105 101
106 bool _menuShowing = false; 102 bool _menuShowing = false;
107 PopupMenuStatus _menuStatus = PopupMenuStatus.inactive; 103 PopupMenuStatus _menuStatus = PopupMenuStatus.inactive;
108 104
109 void _handleMenuShow() { 105 void _handleMenuShow() {
110 setState(() { 106 setState(() {
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 body: buildTabNavigator(), 319 body: buildTabNavigator(),
324 snackBar: buildSnackBar(), 320 snackBar: buildSnackBar(),
325 floatingActionButton: buildFloatingActionButton(), 321 floatingActionButton: buildFloatingActionButton(),
326 drawer: buildDrawer() 322 drawer: buildDrawer()
327 ), 323 ),
328 ]; 324 ];
329 addMenuToOverlays(overlays); 325 addMenuToOverlays(overlays);
330 return new Stack(overlays); 326 return new Stack(overlays);
331 } 327 }
332 } 328 }
OLDNEW
« no previous file with comments | « sky/sdk/example/fitness/lib/home.dart ('k') | sky/sdk/lib/widgets/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698