mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Moving these files into sky/framework will make them easier to use from the SDK. Also, this CL also splits up the giant "widgets" library into smaller libraries, one per component. TBR=eseidel@chromium.org Review URL: https://codereview.chromium.org/993033003
43 lines
1.0 KiB
Dart
43 lines
1.0 KiB
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 'button_base.dart';
|
|
|
|
class Button extends ButtonBase {
|
|
static final Style _style = new Style('''
|
|
transform: translateX(0);
|
|
display: inline-flex;
|
|
border-radius: 4px;
|
|
justify-content: center;
|
|
align-items: center;
|
|
border: 1px solid blue;
|
|
-webkit-user-select: none;
|
|
margin: 5px;'''
|
|
);
|
|
|
|
static final Style _highlightStyle = new Style('''
|
|
transform: translateX(0);
|
|
display: inline-flex;
|
|
border-radius: 4px;
|
|
justify-content: center;
|
|
align-items: center;
|
|
border: 1px solid blue;
|
|
-webkit-user-select: none;
|
|
margin: 5px;
|
|
background-color: orange;'''
|
|
);
|
|
|
|
Node content;
|
|
|
|
Button({ Object key, this.content }) : super(key: key);
|
|
|
|
Node build() {
|
|
return new Container(
|
|
style: highlight ? _highlightStyle : _style,
|
|
children: [super.build(), content]
|
|
);
|
|
}
|
|
}
|