You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add this to your package's pubspec.yaml file:
把如下字段加入你的pubspec.yaml文件:
dependencies:
flutter:
sdk: flutter// 添加下面这一行。 Add this row.left_scroll_actions: any
然后运行flutter packages get即可
Usage
CupertinoLeftScroll (1.4.0)
final key =Key('MY CUSTOM KEY, use id/title');
final closeTag =LeftScrollCloseTag('MyTestListTag');
// widgetCupertinoLeftScroll(
// important, each Row must have different key.// DO NOT use '$index' as Key! Use id or title.
key: key,
// left scroll widget will auto close while the other widget is opened and has same closeTag.// 当另一个有相同closeTag的组件打开时,其他有着相同closeTag的组件会自动关闭.
closeTag: closeTag,
buttonWidth:80,
child:Container(
height:60,
color:Colors.white,
alignment:Alignment.center,
child:Text('👈 Try Scroll Left'),
),
onTap: () {
print('tap row');
closeTag.of(key).open();
},
buttons:<Widget>[
LeftScrollItem(
text:'edit',
color:Colors.orange,
onTap: () {
print('edit');
closeTag.of(key).close();
},
),
LeftScrollItem(
text:'delete',
color:Colors.red,
onTap: () {
// with animation
closeTag.of(key).remove(() async {
print('delete');
setState(() {
list.remove(id);
});
// return false; // restore dismiss statusreturntrue;
});
},
),
],
onTap: () {
print('tap row');
},
);
LeftScroll
You can use this widget as same as CupertinoLeftScroll.
Custom define you slide animation by implements onScroll function.