popup_menu_item.dart 826 Bytes
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 'package:flutter/widgets.dart';
6 7

import 'theme.dart';
8

9 10
const double _kMenuItemHeight = 48.0;
const double _kBaselineOffsetFromBottom = 20.0;
11

12
class PopupMenuItem extends StatelessComponent {
13
  PopupMenuItem({
14
    Key key,
15
    this.value,
16 17 18 19
    this.child
  }) : super(key: key);

  final Widget child;
20
  final dynamic value;
21

22
  Widget build(BuildContext context) {
23 24 25 26 27 28 29
    return new Container(
      height: _kMenuItemHeight,
      child: new DefaultTextStyle(
        style: Theme.of(context).text.subhead,
        child: new Baseline(
          baseline: _kMenuItemHeight - _kBaselineOffsetFromBottom,
          child: child
30 31 32 33 34
        )
      )
    );
  }
}