Unverified Commit e8f8a82a authored by Kate Lovett's avatar Kate Lovett Committed by GitHub

Revert "Fix `DropdownButton` menu clip" (#104203)

parent 24bd28f6
...@@ -286,30 +286,27 @@ class _DropdownMenuState<T> extends State<_DropdownMenu<T>> { ...@@ -286,30 +286,27 @@ class _DropdownMenuState<T> extends State<_DropdownMenu<T>> {
namesRoute: true, namesRoute: true,
explicitChildNodes: true, explicitChildNodes: true,
label: localizations.popupMenuLabel, label: localizations.popupMenuLabel,
child: ClipRRect( child: Material(
borderRadius: widget.borderRadius ?? BorderRadius.zero, type: MaterialType.transparency,
child: Material( textStyle: route.style,
type: MaterialType.transparency, child: ScrollConfiguration(
textStyle: route.style, // Dropdown menus should never overscroll or display an overscroll indicator.
child: ScrollConfiguration( // Scrollbars are built-in below.
// Dropdown menus should never overscroll or display an overscroll indicator. // Platform must use Theme and ScrollPhysics must be Clamping.
// Scrollbars are built-in below. behavior: ScrollConfiguration.of(context).copyWith(
// Platform must use Theme and ScrollPhysics must be Clamping. scrollbars: false,
behavior: ScrollConfiguration.of(context).copyWith( overscroll: false,
scrollbars: false, physics: const ClampingScrollPhysics(),
overscroll: false, platform: Theme.of(context).platform,
physics: const ClampingScrollPhysics(), ),
platform: Theme.of(context).platform, child: PrimaryScrollController(
), controller: widget.route.scrollController!,
child: PrimaryScrollController( child: Scrollbar(
controller: widget.route.scrollController!, thumbVisibility: true,
child: Scrollbar( child: ListView(
thumbVisibility: true, padding: kMaterialListPadding,
child: ListView( shrinkWrap: true,
padding: kMaterialListPadding, children: children,
shrinkWrap: true,
children: children,
),
), ),
), ),
), ),
......
...@@ -3839,35 +3839,4 @@ void main() { ...@@ -3839,35 +3839,4 @@ void main() {
expect(tester.getBottomRight(find.text(hintText)).dx, 776.0); expect(tester.getBottomRight(find.text(hintText)).dx, 776.0);
expect(tester.getBottomRight(find.text(hintText)).dy, 350.0); expect(tester.getBottomRight(find.text(hintText)).dy, 350.0);
}); });
testWidgets('BorderRadius property clips dropdown menu', (WidgetTester tester) async {
const double radius = 20.0;
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: Center(
child: DropdownButtonFormField<String>(
borderRadius: BorderRadius.circular(radius),
value: 'One',
items: <String>['One', 'Two', 'Three', 'Four']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
onChanged: (_) { },
),
),
),
),
);
await tester.tap(find.text('One'));
await tester.pumpAndSettle();
final RenderClipRRect renderClip = tester.allRenderObjects.whereType<RenderClipRRect>().first;
expect(renderClip.borderRadius, BorderRadius.circular(radius));
});
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment