drawer_header.dart 1.2 KB
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.

H
Hixie 已提交
5 6
import '../theme2/colors.dart';
import '../theme2/view_configuration.dart';
7
import 'wrappers.dart';
8 9 10 11 12

class DrawerHeader extends Component {

  DrawerHeader({ Object key, this.children }) : super(key: key);

13
  final List<UINode> children;
H
Hixie 已提交
14

15
  UINode build() {
H
Hixie 已提交
16
    return new Container(
17
      height: kStatusBarHeight + kMaterialDrawerHeight,
H
Hixie 已提交
18 19 20 21 22 23 24
      decoration: new BoxDecoration(
        backgroundColor: BlueGrey[50],
        border: const Border(
          bottom: const BorderSide(
            color: const Color(0xFFD1D9E1),
            width: 1.0
          )
25
        )
H
Hixie 已提交
26 27 28
      ),
      padding: const EdgeDims.only(bottom: 7.0),
      margin: const EdgeDims.only(bottom: 8.0),
29 30 31 32 33 34 35 36
      child: new Flex([
        new FlexExpandingChild(new Container(key: 'drawer-header-spacer')),
        new Container(
          key: 'drawer-header-label',
          padding: const EdgeDims.symmetric(horizontal: 16.0),
          child: new Flex(children, direction: FlexDirection.horizontal)
        )],
        direction: FlexDirection.vertical
H
Hixie 已提交
37
      )
38 39
    );
  }
H
Hixie 已提交
40

41
}