| Index: sky/sdk/lib/widgets/material_button.dart
|
| diff --git a/sky/sdk/lib/widgets/raised_button.dart b/sky/sdk/lib/widgets/material_button.dart
|
| similarity index 54%
|
| copy from sky/sdk/lib/widgets/raised_button.dart
|
| copy to sky/sdk/lib/widgets/material_button.dart
|
| index b3a742a3488afbc748a620870c71f8a8638156f9..4bd7b5a622816ddeeaf6e5fa8134a978f5397ed2 100644
|
| --- a/sky/sdk/lib/widgets/raised_button.dart
|
| +++ b/sky/sdk/lib/widgets/material_button.dart
|
| @@ -2,71 +2,50 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -import '../theme2/colors.dart';
|
| -import '../theme2/edges.dart';
|
| import 'basic.dart';
|
| import 'button_base.dart';
|
| import 'ink_well.dart';
|
| import 'material.dart';
|
|
|
| -enum RaisedButtonTheme { light, dark }
|
| +// Rather than using this class directly, please use FlatButton or RaisedButton.
|
| +abstract class MaterialButton extends ButtonBase {
|
|
|
| -class RaisedButton extends ButtonBase {
|
| -
|
| - RaisedButton({
|
| + MaterialButton({
|
| String key,
|
| this.child,
|
| this.enabled: true,
|
| - this.onPressed,
|
| - this.theme: RaisedButtonTheme.light
|
| + this.onPressed
|
| }) : super(key: key);
|
|
|
| Widget child;
|
| bool enabled;
|
| Function onPressed;
|
| - RaisedButtonTheme theme;
|
|
|
| - void syncFields(RaisedButton source) {
|
| + void syncFields(MaterialButton source) {
|
| child = source.child;
|
| enabled = source.enabled;
|
| onPressed = source.onPressed;
|
| - theme = source.theme;
|
| super.syncFields(source);
|
| }
|
|
|
| + Color get color;
|
| + int get level;
|
| +
|
| Widget buildContent() {
|
| Widget contents = new Container(
|
| padding: new EdgeDims.symmetric(horizontal: 8.0),
|
| child: new Center(child: child) // TODO(ianh): figure out a way to compell the child to have gray text when disabled...
|
| );
|
| - Color color;
|
| - if (enabled) {
|
| - switch (theme) {
|
| - case RaisedButtonTheme.light:
|
| - if (highlight)
|
| - color = Grey[350];
|
| - else
|
| - color = Grey[300];
|
| - break;
|
| - case RaisedButtonTheme.dark:
|
| - if (highlight)
|
| - color = Blue[700];
|
| - else
|
| - color = Blue[600];
|
| - break;
|
| - }
|
| - } else {
|
| - color = Grey[350];
|
| - }
|
| return new EventListenerNode(
|
| new Container(
|
| height: 36.0,
|
| - constraints: new BoxConstraints(minWidth: 88.0),
|
| - margin: new EdgeDims.all(4.0),
|
| + constraints: new BoxConstraints(minWidth: 88.0,
|
| + minHeight: 36.0,
|
| + maxHeight: 36.0),
|
| + margin: new EdgeDims.all(8.0),
|
| child: new Material(
|
| - edge: MaterialEdge.card,
|
| child: enabled ? new InkWell(child: contents) : contents,
|
| - level: enabled ? (highlight ? 2 : 1) : 0,
|
| + level: level,
|
| color: color
|
| )
|
| ),
|
|
|