v1.0.8flexible_dropdown
允许通过点击或滑动遮罩来关闭下拉菜单,并将标题(屏障)设置为透明
15喜欢 108近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
TrangLeQuynh/flexible_dropdown open-source repository details.
以下为英文项目原文快照,最新内容请访问 GitHub。
Customize dropdown
Auto scroll to selected item position
Support BarrierShape.headerTrans to highlight the content above the flexible dropdown button
Allows the dropdown to be dismissed by tapping | panning the scrim or by pressing the escape key on the keyboard.
Allow to choose the Animation Type
First, add flexible_dropdown as a dependency in your pubspec.yaml file.
dependencies:
flexible_dropdown: ^1.0.7
FlexibleDropdown(
overlayChild: Container(
height: 160,
width: double.infinity,
color: Colors.deepPurple,
),
barrierColor: Colors.black38.withOpacity(.2),
barrierShape: BarrierShape.headerTrans,
textDirection: TextDirection.ltr,
offset: Offset.zero,
duration: const Duration(milliseconds: 400),
animationType: AnimationType.size,
animationAlignment: Alignment.topCenter,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
color: Colors.blueAccent.withOpacity(.2),
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 20),
child: Text(
title,
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
),
),
),
)
Usage to close the flexible dropdown:
Navigator.pop(context);
| scale | scaleX | scaleY |
|---|---|---|
![]() |
![]() |
![]() |
| size | slide | fade |
![]() |
![]() |
![]() |
| rotate | ||
![]() |
Note:
AnimationType.sizeis only suitable for width ofoverlayChildis full screen width.
依赖清单 4 项
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^2.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗