Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Dynamic grabbingHeight causes snapping to not complete the entire path. (buggy) #79

Open
shantaly opened this issue Oct 19, 2021 · 0 comments

Comments

@shantaly
Copy link

shantaly commented Oct 19, 2021

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant