Adam Barth 171ff643ef Disentangle Material and InkSplash
Most of the elements that want to be Material (i.e., have a level and cast a
shadow) don't want to be InkWells (i.e., have an ink splash effect). This CL
disentangles these two components, fixing bugs in the Drawer and in the
PopupMenu. Separating these concepts also lets us use Material for the
ActionBar and the FloatingActionButton.

R=rafaelw@chromium.org

Review URL: https://codereview.chromium.org/1037673002
2015-03-25 10:43:12 -07:00

28 lines
739 B
Dart

// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import '../fn.dart';
import '../theme/shadows.dart';
import 'ink_well.dart';
class Material extends Component {
static final List<Style> _shadowStyle = [
null,
new Style('box-shadow: ${Shadow[1]}'),
new Style('box-shadow: ${Shadow[2]}'),
new Style('box-shadow: ${Shadow[3]}'),
new Style('box-shadow: ${Shadow[4]}'),
new Style('box-shadow: ${Shadow[5]}'),
];
Node content;
int level;
Material({ Object key, this.content, this.level: 0 }) : super(key: key);
Node build() {
return new StyleNode(content, _shadowStyle[level]);
}
}