Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
bacd3d2c
Commit
bacd3d2c
authored
May 24, 2016
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revised Drawer Header (#4160)
parent
e8a47b6d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
18 deletions
+26
-18
card_collection.dart
dev/manual_tests/card_collection.dart
+1
-1
pageable_list.dart
dev/manual_tests/pageable_list.dart
+1
-1
drawer.dart
examples/flutter_gallery/lib/gallery/drawer.dart
+3
-1
stock_home.dart
examples/stocks/lib/stock_home.dart
+1
-1
drawer_header.dart
packages/flutter/lib/src/material/drawer_header.dart
+20
-14
No files found.
dev/manual_tests/card_collection.dart
View file @
bacd3d2c
...
...
@@ -126,7 +126,7 @@ class CardCollectionState extends State<CardCollection> {
child:
new
IconTheme
(
data:
const
IconThemeData
(
color:
Colors
.
black
),
child:
new
Block
(
children:
<
Widget
>[
new
DrawerHeader
(
c
hild:
new
Text
(
'Options'
)),
new
DrawerHeader
(
c
ontent:
new
Center
(
child:
new
Text
(
'Options'
)
)),
buildDrawerCheckbox
(
"Make card labels editable"
,
_editable
,
_toggleEditable
),
buildDrawerCheckbox
(
"Snap fling scrolls to center"
,
_snapToCenter
,
_toggleSnapToCenter
),
buildDrawerCheckbox
(
"Fixed size cards"
,
_fixedSizeCards
,
_toggleFixedSizeCards
),
...
...
dev/manual_tests/pageable_list.dart
View file @
bacd3d2c
...
...
@@ -85,7 +85,7 @@ class PageableListAppState extends State<PageableListApp> {
Widget
_buildDrawer
()
{
return
new
Drawer
(
child:
new
Block
(
children:
<
Widget
>[
new
DrawerHeader
(
c
hild:
new
Text
(
'Options'
)),
new
DrawerHeader
(
c
ontent:
new
Center
(
child:
new
Text
(
'Options'
)
)),
new
DrawerItem
(
icon:
Icons
.
more_horiz
,
selected:
scrollDirection
==
Axis
.
horizontal
,
...
...
examples/flutter_gallery/lib/gallery/drawer.dart
View file @
bacd3d2c
...
...
@@ -32,7 +32,9 @@ class GalleryDrawer extends StatelessWidget {
return
new
Drawer
(
child:
new
Block
(
children:
<
Widget
>[
new
DrawerHeader
(
child:
new
Text
(
'Flutter gallery'
)),
new
DrawerHeader
(
content:
new
Center
(
child:
new
Text
(
'Flutter gallery'
))
),
new
DrawerItem
(
icon:
Icons
.
brightness_5
,
onPressed:
()
{
onThemeChanged
(
true
);
},
...
...
examples/stocks/lib/stock_home.dart
View file @
bacd3d2c
...
...
@@ -124,7 +124,7 @@ class StockHomeState extends State<StockHome> {
Widget
_buildDrawer
(
BuildContext
context
)
{
return
new
Drawer
(
child:
new
Block
(
children:
<
Widget
>[
new
DrawerHeader
(
c
hild:
new
Text
(
'Stocks'
)),
new
DrawerHeader
(
c
ontent:
new
Center
(
child:
new
Text
(
'Stocks'
)
)),
new
DrawerItem
(
icon:
Icons
.
assessment
,
selected:
true
,
...
...
packages/flutter/lib/src/material/drawer_header.dart
View file @
bacd3d2c
...
...
@@ -9,7 +9,9 @@ import 'theme.dart';
const
double
_kDrawerHeaderHeight
=
140.0
;
/// The top-most region of a material design drawer.
/// The top-most region of a material design drawer. The header's [background]
/// widget extends behind the system status bar and its [content] widget is
/// stacked on top of the background and below the status bar.
///
/// Part of the material design [Drawer].
///
...
...
@@ -24,10 +26,15 @@ class DrawerHeader extends StatelessWidget {
/// Creates a material design drawer header.
///
/// Requires one of its ancestors to be a [Material] widget.
const
DrawerHeader
({
Key
key
,
this
.
child
})
:
super
(
key:
key
);
const
DrawerHeader
({
Key
key
,
this
.
background
,
this
.
content
})
:
super
(
key:
key
);
/// The widget below this widget in the tree.
final
Widget
child
;
/// A widget that extends behind the system status bar and is stacked
/// behind the [content] widget.
final
Widget
background
;
/// A widget that's positioned below the status bar and stacked on top of the
/// [background] widget. Typically a view of the user's id.
final
Widget
content
;
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -35,10 +42,8 @@ class DrawerHeader extends StatelessWidget {
final
double
statusBarHeight
=
MediaQuery
.
of
(
context
).
padding
.
top
;
return
new
Container
(
height:
statusBarHeight
+
_kDrawerHeaderHeight
,
margin:
const
EdgeInsets
.
only
(
bottom:
7.0
),
// 8 less 1 for the bottom border.
decoration:
new
BoxDecoration
(
// TODO(jackson): This class should usually render the user's
// preferred banner image rather than a solid background
backgroundColor:
Theme
.
of
(
context
).
cardColor
,
border:
const
Border
(
bottom:
const
BorderSide
(
color:
const
Color
(
0xFFD1D9E1
),
...
...
@@ -46,16 +51,17 @@ class DrawerHeader extends StatelessWidget {
)
)
),
padding:
const
EdgeInsets
.
only
(
bottom:
7.0
),
margin:
const
EdgeInsets
.
only
(
bottom:
8.0
),
child:
new
Column
(
child:
new
Stack
(
children:
<
Widget
>[
new
Flexible
(
child:
new
Container
()),
new
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
16.0
),
background
??
new
Container
(),
new
Positioned
(
top:
statusBarHeight
+
16.0
,
left:
16.0
,
right:
16.0
,
bottom:
8.0
,
child:
new
DefaultTextStyle
(
style:
Theme
.
of
(
context
).
textTheme
.
body2
,
child:
c
hild
child:
c
ontent
)
)
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment