menggulir ke atas sliverlist berkibar dengan tombol punggung
// first add a scroll controller var
final ScrollController _scrollController = ScrollController(
initialScrollOffset: 0.0,
);
// after add the code to set offset of controller at WillPopScope
return WillPopScope( onWillPop: () async {
if (_scrollController.offset != 0.0) {
_scrollController.animateTo(0.0,
duration: const Duration(milliseconds: 250), curve: Curves.easeIn);
return false;
}else {
return true;
}
},
child: Scaffold( //...
// and finally set var controller to controller of your scroller like this:
CustomScrollView( controller: _scrollController, //...
LightBolt