snapping_sheet
snapping_sheet copied to clipboard
Dynamic grabbingHeight causes snapping to not complete the entire path. (buggy)
First off amazing package!
I am running into this issue where dynamic values seem to confuse the sheets snapping positions.
My grabbing widget changes in height. Hence why I need to change the grabbingHeight property dynamically in my build function.
It seems like the SnappingSheet widget doesn't refresh the new values while snapping is in motion. After snapping is done (and off by a few pixels), I can drag and release the sheet slightly just to find it snap in the right place.
On onSnapStart -> set expanded bool to true/false
onSnapStart: (sheetPosition, snappingPosition) {
if (snappingPosition.grabbingContentOffset == -1) {
setState(() {
_isExpanded = true;
});
} else {
setState(() {
_isExpanded = false;
});
}
},
In build function
var grabbingHeight = _isExpanded ? 150 : 105 ;
Any workarounds?