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

Side by Side Diff: sky/examples/stocks2/lib/stock_app.dart

Issue 1194743003: Add a new Theme widget to control color and text color of apps (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years, 6 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 | « no previous file | sky/examples/stocks2/lib/stock_home.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/rendering/sky_binding.dart'; 5 import 'package:sky/rendering/sky_binding.dart';
6 import 'package:sky/theme/colors.dart' as colors;
7 import 'package:sky/theme/theme_data.dart';
8 import 'package:sky/theme/typography.dart' as typography;
6 import 'package:sky/widgets/basic.dart'; 9 import 'package:sky/widgets/basic.dart';
7 import 'package:sky/widgets/navigator.dart'; 10 import 'package:sky/widgets/navigator.dart';
11 import 'package:sky/widgets/theme.dart';
8 import 'package:sky/widgets/widget.dart'; 12 import 'package:sky/widgets/widget.dart';
9 13
10 import 'stock_data.dart'; 14 import 'stock_data.dart';
11 import 'stock_home.dart'; 15 import 'stock_home.dart';
12 import 'stock_settings.dart'; 16 import 'stock_settings.dart';
13 17
14 class StocksApp extends App { 18 class StocksApp extends App {
15 19
16 StocksApp() { 20 StocksApp() {
17 _navigationState = new NavigationState([ 21 _navigationState = new NavigationState([
(...skipping 21 matching lines...) Expand all
39 NavigationState _navigationState; 43 NavigationState _navigationState;
40 44
41 void onBack() { 45 void onBack() {
42 setState(() { 46 setState(() {
43 _navigationState.pop(); 47 _navigationState.pop();
44 }); 48 });
45 // TODO(jackson): Need a way to invoke default back behavior here 49 // TODO(jackson): Need a way to invoke default back behavior here
46 } 50 }
47 51
48 Widget build() { 52 Widget build() {
49 return new Navigator(_navigationState); 53 return new Theme(
54 data: new ThemeData(color: colors.Purple, text: typography.white),
55 child: new Navigator(_navigationState)
56 );
50 } 57 }
51 } 58 }
52 59
53 void main() { 60 void main() {
54 print("starting stocks app!"); 61 print("starting stocks app!");
55 runApp(new StocksApp()); 62 runApp(new StocksApp());
56 SkyBinding.instance.onFrame = () { 63 SkyBinding.instance.onFrame = () {
57 // uncomment this for debugging: 64 // uncomment this for debugging:
58 // SkyBinding.instance.debugDumpRenderTree(); 65 // SkyBinding.instance.debugDumpRenderTree();
59 }; 66 };
60 } 67 }
OLDNEW
« no previous file with comments | « no previous file | sky/examples/stocks2/lib/stock_home.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698