dbenitez-bcn / solid_bottom_sheet

Apache License 2.0
58 stars 19 forks source link

BottomSheet is closing on setState #20

Closed gabrielCuringa closed 1 year ago

gabrielCuringa commented 4 years ago

The component closes instantly when the setState function is called.

dbenitez-bcn commented 4 years ago

Yes you are right. This is a known issue. I'm working on it.

athul-ain commented 4 years ago

Same issue here,

Please fix it as soon as possible

3rsin3rgul commented 4 years ago

Hello, Is there any news about it?

herarya commented 4 years ago

hi any updates?

dbenitez-bcn commented 4 years ago

Still working on this. But no solution found for the moment...

nxcco commented 4 years ago

Any guess what's the reason for that?

Rehckover commented 4 years ago

image After set state is called opened value is overridden by default showOnAppear

LCostaN commented 4 years ago

Please try like this. it's working for me ''' bool _showOnAppear = false;

@override Widget build(BuildContext context) { return SlideTransition( position: _offsetAnimation, child: SolidBottomSheet( showOnAppear: _showOnAppear, controller: _bottomSheetController, headerBar: headerWidget(), body: Container(), onHide: () => _showOnAppear = false, onShow: () => _showOnAppear = true, ) ); } '''

JelleScheer commented 4 years ago

@LCostaN doesn't seem to work for me, sadly. @dbenitez-bcn any news? :)

hemang249 commented 3 years ago

This is pretty old, but in case if someone is still stuck with this issue, separating out the state handling to a separate Stateful Widget worked for me.

In my case I had a form inside the BottomSheet, So i just separated out the form portion and its state as a separate Widget and its working fine now.

This isn't a fix but a workaround for the problem.