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
b81229b5
Commit
b81229b5
authored
Jun 21, 2016
by
Hans Muller
Committed by
GitHub
Jun 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DropdownButton layout (#4582)
parent
0e38cba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
drop_down.dart
packages/flutter/lib/src/material/drop_down.dart
+3
-6
No files found.
packages/flutter/lib/src/material/drop_down.dart
View file @
b81229b5
...
...
@@ -19,7 +19,7 @@ import 'material.dart';
const
Duration
_kDropDownMenuDuration
=
const
Duration
(
milliseconds:
300
);
const
double
_kMenuItemHeight
=
48.0
;
const
EdgeInsets
_kMenuVerticalPadding
=
const
EdgeInsets
.
symmetric
(
vertical:
8.0
);
const
EdgeInsets
_kMenuHorizontalPadding
=
const
EdgeInsets
.
symmetric
(
horizontal:
36
.0
);
const
EdgeInsets
_kMenuHorizontalPadding
=
const
EdgeInsets
.
symmetric
(
horizontal:
4
.0
);
const
double
_kBaselineOffsetFromBottom
=
20.0
;
const
double
_kBottomBorderHeight
=
2.0
;
const
Border
_kDropDownUnderline
=
const
Border
(
bottom:
const
BorderSide
(
color:
const
Color
(
0xFFBDBDBD
),
width:
_kBottomBorderHeight
));
...
...
@@ -424,8 +424,6 @@ class DropDownButton<T> extends StatefulWidget {
}
class
_DropDownButtonState
<
T
>
extends
State
<
DropDownButton
<
T
>>
{
final
GlobalKey
_itemKey
=
new
GlobalKey
(
debugLabel:
'DropDownButton item key'
);
@override
void
initState
()
{
super
.
initState
();
...
...
@@ -456,7 +454,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> {
void
_handleTap
()
{
assert
(
_currentRoute
==
null
);
final
RenderBox
itemBox
=
_itemKey
.
currentC
ontext
.
findRenderObject
();
final
RenderBox
itemBox
=
c
ontext
.
findRenderObject
();
final
Rect
itemRect
=
itemBox
.
localToGlobal
(
Point
.
origin
)
&
itemBox
.
size
;
final
Completer
<
_DropDownRouteResult
<
T
>>
completer
=
new
Completer
<
_DropDownRouteResult
<
T
>>();
_currentRoute
=
new
_DropDownRoute
<
T
>(
...
...
@@ -485,13 +483,12 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> {
Widget
result
=
new
DefaultTextStyle
(
style:
style
,
child:
new
Row
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
// We use an IndexedStack to make sure we have enough width to show any
// possible item as the selected item without changing size.
new
IndexedStack
(
key:
_itemKey
,
index:
_selectedIndex
,
alignment:
FractionalOffset
.
centerLeft
,
children:
config
.
items
...
...
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