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 ↗