drawer_header.dart 1.35 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.

5
import 'package:sky/material.dart';
6 7 8
import 'package:sky/src/widgets/basic.dart';
import 'package:sky/src/widgets/framework.dart';
import 'package:sky/src/widgets/theme.dart';
9 10 11 12

// TODO(jackson): This class should usually render the user's
// preferred banner image rather than a solid background

13 14
class DrawerHeader extends StatelessComponent {
  const DrawerHeader({ Key key, this.child }) : super(key: key);
15

16
  final Widget child;
17

18
  Widget build(BuildContext context) {
19 20 21
    return new Container(
      height: kStatusBarHeight + kMaterialDrawerHeight,
      decoration: new BoxDecoration(
22
        backgroundColor: Theme.of(context).cardColor,
23 24 25 26 27 28 29 30 31
        border: const Border(
          bottom: const BorderSide(
            color: const Color(0xFFD1D9E1),
            width: 1.0
          )
        )
      ),
      padding: const EdgeDims.only(bottom: 7.0),
      margin: const EdgeDims.only(bottom: 8.0),
32
      child: new Column([
33 34 35 36
        new Flexible(child: new Container()),
        new Container(
          padding: const EdgeDims.symmetric(horizontal: 16.0),
          child: new DefaultTextStyle(
37
            style: Theme.of(context).text.body2,
38
            child: child
39
          )
40
        )]
41 42 43 44
      )
    );
  }
}