jamesblasco / modal_bottom_sheet

Flutter | Create advanced modal bottom sheets. Material, Cupertino or your own style
https://pub.dev/packages/modal_bottom_sheet
MIT License
1.88k stars 473 forks source link

Automatic change of `overlayStyle` after calling `CupertinoScaffold.showCupertinoModalBottomSheet` #419

Open HE-LU opened 3 months ago

HE-LU commented 3 months ago

@jamesblasco Hey, I am solving an issue with CupertinoScaffold.showCupertinoModalBottomSheet.

This builder will automatically force a new overlayStyle, leaving me no option to keep the one I have currently set. (I want to use transparent systemNavigationBarColor. Calling this show method will always force new light or dark style, overriding anything I have set.).

I would love to introduce a new PR for you to solve this issue for me. My question would be, what was the reasoning for deprecating overlayStyle parameter? I can imagine that I could use this parameter to solve my issue, or to introduce completely new parameter like overrideOverlayStyle defaulting to true. Actually, I probably do not see any clear solution for handling this case.

Any ideas, please?

raccoondev85 commented 2 months ago

wrap the child widget with AnnotatedRegion.

builder: (context) => AnnotatedRegion<SystemUiOverlayStyle>( value: overlayStyle, child: child, ),