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

Side by Side Diff: sky/sdk/lib/widgets/default_text_style.dart

Issue 1222823004: Make the menu items in the drawer change colour when tapped, per Material spec. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 | « no previous file | sky/sdk/lib/widgets/theme.dart » ('j') | sky/sdk/lib/widgets/widget.dart » ('J')
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 '../painting/text_style.dart'; 5 import '../painting/text_style.dart';
6 import 'basic.dart'; 6 import 'basic.dart';
7 import 'widget.dart'; 7 import 'widget.dart';
8 8
9 class DefaultTextStyle extends Inherited { 9 class DefaultTextStyle extends Inherited {
10 10
11 DefaultTextStyle({ 11 DefaultTextStyle({
12 String key, 12 String key,
13 this.style, 13 this.style,
14 Widget child 14 Widget child
15 }) : super(key: key, child: child) { 15 }) : super(key: key, child: child) {
16 assert(style != null); 16 assert(style != null);
17 assert(child != null); 17 assert(child != null);
18 } 18 }
19 19
20 final TextStyle style; 20 final TextStyle style;
21 21
22 static TextStyle of(Component component) { 22 static TextStyle of(Component component) {
23 DefaultTextStyle result = component.inheritedOfType(DefaultTextStyle); 23 DefaultTextStyle result = component.inheritedOfType(DefaultTextStyle);
24 return result == null ? null : result.style; 24 return result == null ? null : result.style;
25 } 25 }
26
27 bool syncShouldNotify(DefaultTextStyle old) => style != old.style;
28
26 } 29 }
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/theme.dart » ('j') | sky/sdk/lib/widgets/widget.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698