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

Side by Side Diff: sky/sdk/lib/framework/components2/material.dart

Issue 1174023003: Remove one more use of mirrors: Components now have to explicitly sync their fields. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 '../fn2.dart'; 5 import '../fn2.dart';
6 import '../theme/shadows.dart'; 6 import '../theme/shadows.dart';
7 7
8 class Material extends Component { 8 class Material extends Component {
9 9
10 Material({ Object key, this.content, this.level: 0 }) : super(key: key); 10 Material({ Object key, this.content, this.level: 0 }) : super(key: key);
11 11
12 // static final List<Style> _shadowStyle = [ 12 // static final List<Style> _shadowStyle = [
13 // null, 13 // null,
14 // new Style('box-shadow: ${Shadow[1]}'), 14 // new Style('box-shadow: ${Shadow[1]}'),
15 // new Style('box-shadow: ${Shadow[2]}'), 15 // new Style('box-shadow: ${Shadow[2]}'),
16 // new Style('box-shadow: ${Shadow[3]}'), 16 // new Style('box-shadow: ${Shadow[3]}'),
17 // new Style('box-shadow: ${Shadow[4]}'), 17 // new Style('box-shadow: ${Shadow[4]}'),
18 // new Style('box-shadow: ${Shadow[5]}'), 18 // new Style('box-shadow: ${Shadow[5]}'),
19 // ]; 19 // ];
20 20
21 UINode content; 21 UINode content;
22 int level; 22 int level;
23 23
24 void syncFields(Material source) {
25 content = source.content;
26 level = source.level;
27 super.syncFields(source);
28 }
29
24 UINode build() { 30 UINode build() {
25 // TODO(eseidel): Add a shadow. 31 // TODO(eseidel): Add a shadow.
26 // return new StyleNode(content, _shadowStyle[level]); 32 // return new StyleNode(content, _shadowStyle[level]);
27 return content; 33 return content;
28 } 34 }
29 35
30 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698