這是一個仿iOS(微信)效果的 Flutter 左滑菜單插件。在最新版本中,我添加了拉伸的彈性效果。
Pub地址:left_scroll_actions
GitHub地址:left_scroll_actionsgit
CupertinoLeftScroll
的bounce
參數爲true
,便可得到彈性效果CupertinoLeftScroll
的bounceStyle
參數控制彈性效果這功能可讓你在打開一個左滑組件時,聯動關閉其餘打開的左滑組件。你也能夠指定讓一個組件打開與關閉:github
LeftScrollCloseTag
的LeftScroll組件,能夠在一個打開時,關閉其餘組件// 找到對應tag與key的row狀態,改變狀態便可 LeftScrollGlobalListener.instance.targetStatus(tag,key) = false;
CupertinoLeftScroll( // important, each Row must have different key. // DO NOT use '$index' as Key! Use id or title. key: Key('TODO: your key'), // left scroll widget will auto close while the other widget is opened and has same closeTag. // 當另外一個有相同closeTag的組件打開時,其餘有着相同closeTag的組件會自動關閉. closeTag: LeftScrollCloseTag('TODO: your tag'), buttonWidth: 80, bounce: true, child: Container( height: 60, color: Colors.white, alignment: Alignment.center, child: Text('👈 Try Scroll Left'), ), buttons: <Widget>[ LeftScrollItem( text: 'edit', color: Colors.orange, onTap: () { print('edit'); }, ), LeftScrollItem( text: 'delete', color: Colors.red, onTap: () { print('delete'); }, ), ], onTap: () { print('tap row'); }, );