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
eebe09d4
Commit
eebe09d4
authored
Aug 05, 2016
by
Hans Muller
Committed by
GitHub
Aug 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the ScrollConfiguration for dropdown menus (#5255)
parent
47139f1d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
9 deletions
+20
-9
flutter.yaml
examples/flutter_gallery/flutter.yaml
+0
-1
pesto_demo.dart
examples/flutter_gallery/lib/demo/pesto_demo.dart
+1
-2
drop_down.dart
packages/flutter/lib/src/material/drop_down.dart
+19
-6
No files found.
examples/flutter_gallery/flutter.yaml
View file @
eebe09d4
...
...
@@ -25,7 +25,6 @@ assets:
-
packages/flutter_gallery_assets/pesto/image9.jpg
-
packages/flutter_gallery_assets/pesto/logo_small.png
-
packages/flutter_gallery_assets/pesto/logo_medium.png
-
packages/flutter_gallery_assets/pesto/logo_big.png
-
packages/flutter_gallery_assets/pesto/fish.png
-
packages/flutter_gallery_assets/pesto/healthy.png
-
packages/flutter_gallery_assets/pesto/main.png
...
...
examples/flutter_gallery/lib/demo/pesto_demo.dart
View file @
eebe09d4
...
...
@@ -12,8 +12,7 @@ const String _kUserImage = 'packages/flutter_gallery_assets/pesto/avatar.jpg';
// Map of logo images keyed by the minimum height their container needs to be.
final
Map
<
double
,
String
>
_kLogoImages
=
<
double
,
String
>{
0.0
:
'packages/flutter_gallery_assets/pesto/logo_small.png'
,
70.0
:
'packages/flutter_gallery_assets/pesto/logo_medium.png'
,
170.0
:
'packages/flutter_gallery_assets/pesto/logo_big.png'
,
70.0
:
'packages/flutter_gallery_assets/pesto/logo_medium.png'
};
final
ThemeData
_kTheme
=
new
ThemeData
(
...
...
packages/flutter/lib/src/material/drop_down.dart
View file @
eebe09d4
...
...
@@ -75,6 +75,16 @@ class _DropDownMenuPainter extends CustomPainter {
}
}
// Do not use the platform-specific default scroll configuration.
// Dropdown menus should never overscroll or display an overscroll indicator.
class
_DropDownScrollConfigurationDelegate
extends
ScrollConfigurationDelegate
{
const
_DropDownScrollConfigurationDelegate
();
@override
Widget
wrapScrollWidget
(
Widget
scrollWidget
)
=>
new
ClampOverscrolls
(
value:
true
,
child:
scrollWidget
);
}
final
ScrollConfigurationDelegate
_dropDownScroll
=
const
_DropDownScrollConfigurationDelegate
();
class
_DropDownMenu
<
T
>
extends
StatefulWidget
{
_DropDownMenu
({
Key
key
,
...
...
@@ -159,6 +169,8 @@ class _DropDownMenuState<T> extends State<_DropDownMenu<T>> {
child:
new
Material
(
type:
MaterialType
.
transparency
,
textStyle:
route
.
style
,
child:
new
ScrollConfiguration
(
delegate:
_dropDownScroll
,
child:
new
Scrollbar
(
child:
new
ScrollableList
(
scrollableKey:
config
.
route
.
scrollableKey
,
...
...
@@ -169,6 +181,7 @@ class _DropDownMenuState<T> extends State<_DropDownMenu<T>> {
)
)
)
)
);
}
}
...
...
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