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

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

Issue 1204523002: Material light and dark themes for Sky widgets (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix analyzer warning properly 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
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 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'dart:sky' as sky; 8 import 'dart:sky' as sky;
9 9
10 import '../base/hit_test.dart'; 10 import '../base/hit_test.dart';
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 class ParentDataNode extends TagNode { 218 class ParentDataNode extends TagNode {
219 ParentDataNode(Widget child, this.parentData, { String key }) 219 ParentDataNode(Widget child, this.parentData, { String key })
220 : super(child, key: key); 220 : super(child, key: key);
221 final ParentData parentData; 221 final ParentData parentData;
222 } 222 }
223 223
224 abstract class _Heir implements Widget { 224 abstract class _Heir implements Widget {
225 Map<Type, Inherited> _traits; 225 Map<Type, Inherited> _traits;
226 Inherited inheritedOfType(Type type) => _traits[type]; 226 Inherited inheritedOfType(Type type) => _traits == null ? null : _traits[type] ;
227 227
228 static _Heir _getHeirAncestor(Widget widget) { 228 static _Heir _getHeirAncestor(Widget widget) {
229 Widget ancestor = widget; 229 Widget ancestor = widget;
230 while (ancestor != null && !(ancestor is _Heir)) { 230 while (ancestor != null && !(ancestor is _Heir)) {
231 ancestor = ancestor.parent; 231 ancestor = ancestor.parent;
232 } 232 }
233 return ancestor as _Heir; 233 return ancestor as _Heir;
234 } 234 }
235 235
236 void _updateTraitsFromParent(Widget parent) { 236 void _updateTraitsFromParent(Widget parent) {
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 if (root.parent == null) { 999 if (root.parent == null) {
1000 // we haven't attached it yet 1000 // we haven't attached it yet
1001 assert(_container.child == null); 1001 assert(_container.child == null);
1002 _container.child = root; 1002 _container.child = root;
1003 } 1003 }
1004 assert(root.parent == _container); 1004 assert(root.parent == _container);
1005 } 1005 }
1006 1006
1007 Widget build() => builder(); 1007 Widget build() => builder();
1008 } 1008 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698