flutter_form_builder icon indicating copy to clipboard operation
flutter_form_builder copied to clipboard

[FormBuilderDropdown] Add support to menuMaxHeight

Open kentomiya89 opened this issue 4 years ago • 0 comments
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.

4DFDE030-A64F-4B95-A0ED-0A60C1B81027
  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,
          ),
        ),
      ),
    );
  }

kentomiya89 avatar Jul 24 '21 15:07 kentomiya89