Closed Faiz-rhm closed 1 year ago
I have added ListView to the panel..
I think the best solution to this problem is to add a ScrollController and add a listener to check if the scroll position is 0, then close the pane with weslide controller
Example: https://dartpad.dev/?id=9286d980f4377d8bd9d48bb7858ee354
ScrollController _scrollController = ScrollController();
double _scrollPosition;
scrollListener() {
_scrollPosition = _scrollController.position.pixels;
print(_scrollPosition);
if(_scrollPosition <= 0) {
_controller.hide();
}
}
_scrollController.addListener(scrollListener);
...
panel: Container(
color: _colorScheme.primary,
child: ListView.builder(
controller: _scrollController,
padding: const EdgeInsets.all(8),
itemCount: entries.length,
itemBuilder: (BuildContext context, int index) {
return Container(
margin: const EdgeInsets.symmetric(vertical: 20),
height: 150,
color: Colors.amber[colorCodes[index]],
child: Center(child: Text('Entry ${entries[index]}', style: TextStyle(color: Colors.white)),),
);
}
),
)
when the panel contains a list of items "ListView" is scrollable. It can not be pulled down.
https://github.com/luciano-work/we_slide/assets/14290499/eb8521d1-e389-4df9-b192-e606acca7495