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

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

Issue 1218153005: Refactoring to support dark theme better (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix import issues 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/BUILD.gn ('k') | sky/sdk/example/stocks/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/theme/colors.dart' as colors; 5 import 'package:sky/theme/colors.dart' as colors;
6 import 'package:sky/theme/typography.dart' as typography; 6 import 'package:sky/theme/typography.dart' as typography;
7 import 'package:sky/widgets/basic.dart'; 7 import 'package:sky/widgets/basic.dart';
8 import 'package:sky/widgets/default_text_style.dart'; 8 import 'package:sky/widgets/default_text_style.dart';
9 import 'package:sky/widgets/navigator.dart'; 9 import 'package:sky/widgets/navigator.dart';
10 import 'package:sky/widgets/theme.dart'; 10 import 'package:sky/widgets/theme.dart';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 setState(() { 61 setState(() {
62 data.appendTo(_stocks); 62 data.appendTo(_stocks);
63 }); 63 });
64 }); 64 });
65 } 65 }
66 66
67 Widget build() { 67 Widget build() {
68 68
69 ThemeData theme; 69 ThemeData theme;
70 if (optimismSetting == StockMode.optimistic) { 70 if (optimismSetting == StockMode.optimistic) {
71 theme = new ThemeData.light( 71 theme = new ThemeData(
72 primary: colors.Purple, 72 brightness: ThemeBrightness.light,
73 accent: colors.RedAccent, 73 primarySwatch: colors.Purple,
74 darkToolbar: true 74 accentColor: colors.RedAccent[200]
75 ); 75 );
76 } else { 76 } else {
77 theme = new ThemeData.dark( 77 theme = new ThemeData(
78 primary: colors.Red, 78 brightness: ThemeBrightness.dark,
79 accent: colors.PurpleAccent 79 accentColor: colors.RedAccent[200]
80 ); 80 );
81 } 81 }
82 82
83 return new Theme( 83 return new Theme(
84 data: theme, 84 data: theme,
85 child: new DefaultTextStyle( 85 child: new DefaultTextStyle(
86 style: typography.error, // if you see this, you've forgotten to corre ctly configure the text style! 86 style: typography.error, // if you see this, you've forgotten to corre ctly configure the text style!
87 child: new Navigator(_navigationState) 87 child: new Navigator(_navigationState)
88 ) 88 )
89 ); 89 );
90 } 90 }
91 } 91 }
92 92
93 void main() { 93 void main() {
94 runApp(new StocksApp()); 94 runApp(new StocksApp());
95 } 95 }
OLDNEW
« no previous file with comments | « sky/sdk/BUILD.gn ('k') | sky/sdk/example/stocks/lib/stock_home.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698