icon_button.dart 664 字节
Newer Older
1 2 3 4
// 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.

5
import '../rendering/box.dart';
6
import 'icon.dart';
7 8
import 'ui_node.dart';
import 'wrappers.dart';
9 10 11 12 13 14

class IconButton extends Component {

  IconButton({ String icon: '', this.onGestureTap })
    : super(key: icon), icon = icon;

15 16
  final String icon;
  final GestureEventListener onGestureTap;
H
Hixie 已提交
17

18 19
  UINode build() {
    return new EventListenerNode(
20
      new Padding(
21
        child: new Icon(type: icon, size: 24),
22
        padding: const EdgeDims.all(8.0)),
23 24
      onGestureTap: onGestureTap);
  }
H
Hixie 已提交
25

26
}