letsar / flutter_slidable

A Flutter implementation of slidable list item with directional slide actions.
MIT License
2.73k stars 591 forks source link

startActionPane children in slidable are not updating on Obx #414

Open gowda4967 opened 1 year ago

gowda4967 commented 1 year ago

Getx values updating only when Slidable closed but when in open the values are not updating

gowda4967 commented 1 year ago

class Slidablewidget extends GetView { final Widget child; Slidablewidget({super.key, required this.child}); @override Widget build(BuildContext context) { Size size = MediaQuery.of(context).size; return GetBuilder( initState: (state) {}, dispose: ($$) {}, builder: (sliderController) { return Obx(() { return Slidable( dragStartBehavior: DragStartBehavior.start, enabled: true, startActionPane: ActionPane( extentRatio: 0.25, motion: BehindMotion(key: ValueKey(1)), closeThreshold: 0.01, children: [ Builder(builder: (context) { return Container( color: Color(0xffBBBBBB).withOpacity(0.3), alignment: Alignment.center, height: size.height, width: 86, child: ListView( shrinkWrap: true, scrollDirection: Axis.vertical, addRepaintBoundaries: true, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ SidePanelCard( cardColor: Color(0xff95C471), value: sliderController.heart_rate.value, condition: "Heart Rate", status: "High", beta: false) ], ), ), ], ), ); }) ], ), closeOnScroll: true, child: child, ); }); }); } }