flutter_form_builder
flutter_form_builder copied to clipboard
[FormBuilderDropdown] Add support to menuMaxHeight
trafficstars
menuMaxHeight has been added in DropDownButton Widget since Flutter 2.2.0 and above.
menuMaxHeight allows you to specify the height of the menu window. ↓
https://api.flutter.dev/flutter/material/DropdownButton/menuMaxHeight.html https://github.com/flutter/flutter/pull/76493
FormBuilderDropdown also wants to specify the height of the menu. This is what it looks like when the height is specified with DropDownButton.
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Sample'),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
child: DropdownButton(
items: List.generate(100, (index) => 'testtesttesttest')
.toList()
.map((value) => DropdownMenuItem(
value: value,
child: Text(value),
))
.toList(),
onChanged: (_) {},
isExpanded: true,
menuMaxHeight: 450,
),
),
),
);
}