知识FlutterFlutter-Slidable
Kahvia Slidable
滑动选项卡组件。
依赖引入
1
| flutter_slidable: ^2.0.0
|
使用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| Slidable( endActionPane: ActionPane( motion: const StretchMotion(), children: [ SlidableAction( onPressed: onDelete, icon: Icons.delete, backgroundColor: Colors.redAccent, borderRadius: BorderRadius.circular(12), ) ], ), child: Container( padding: const EdgeInsets.all(24), decoration: BoxDecoration( color: Colors.orange, borderRadius: BorderRadius.circular(12) ), child: Row( children: [ Checkbox( value: finished, onChanged: onChanged, activeColor: Colors.black, ), Text( taskName, style: TextStyle(decoration: finished?TextDecoration.lineThrough:TextDecoration.none), overflow: TextOverflow.ellipsis, ) ], ), ), )
|
Navigator.of(context).pop();//这样Navigator.pop(context);//或这样dart