Last updated:
0 purchases
fdropdown
fdropdown #
A customizable flutter dropdown ui.
Getting Started #
1、必须设置目标组件key
final GlobalKey selectAreaKey = GlobalKey();
copied to clipboard
2、关联到目标组件
appBar: AppBar(
key: selectAreaKey,
backgroundColor: Colors.blue,
title: const Text('自定义下拉菜单'),
),
copied to clipboard
3、展示常用菜单
FDropdown.instance.show(
distWidgetKey: selectAreaKey,
allMarginTop: 2,
allMarginRight: 2,
child: ListView(
padding: EdgeInsets.only(),
shrinkWrap: true,
children: items.map((e) => Container(
height: 30,
alignment: Alignment.center,
color: Colors.amber,
margin: EdgeInsets.only(
bottom: 1
),
child: Text(e),
)).toList(),
)
)
copied to clipboard
4、展示自定义自适应菜单
FDropdown.instance.show(
distWidgetKey: selectAreaKey,
allMarginTop: 0,
isSelfExpand: true,
align: OverlayAlign.CENTER,
// contMarginLeft: 15,
// contMarginRight: 15,
allBgColor: Color(0x3f000000),
child: ListView(
padding: EdgeInsets.only(),
shrinkWrap: true,
children: items.map((e) => Container(
height: 30,
alignment: Alignment.centerLeft,
color: Colors.amber,
margin: EdgeInsets.only(
bottom: 1
),
child: Text(e),
)).toList(),
)
)
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.