stacked icon indicating copy to clipboard operation
stacked copied to clipboard

[bug]: isBottomSheetOpen

Open 7NT opened this issue 1 year ago • 6 comments

Describe the bug

Not sure if this is the right place to ask questions about the BottomSheetService.

I have my custom BottomSheet open: showCustomSheet

When new the data is received, I don't want to open another BottomSheet, so I check isBottomSheetOpen If yes, I am going to append data, otherwise I will open a new sheet.

But, somewhere that isBottomSheetOpen always returned null.

How to check if the CustomSheet is already open?

What operating system do you use?

macOS

Information about the installed tooling

flutter doctor -v [✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-x64, locale en) • Flutter version 3.19.6 on channel stable at /Users/jun/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 54e66469a9 (7 days ago), 2024-04-17 13:08:03 -0700 • Engine revision c4cd48e186 • Dart version 3.3.4 • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/jun/Library/Android/sdk • Platform android-34-ext8, build-tools 34.0.0 • ANDROID_HOME = /Users/jun/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.88.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.80.0

[✓] Connected device (3 available) • Jun’s iPad (mobile) • 00008030-0004495422C2202E • ios • iOS 17.4.1 21E236 • macOS (desktop) • macos • darwin-x64 • macOS 14.4.1 23E224 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.78

[✓] Network resources • All expected network resources are available.

• No issues found!

Steps to reproduce the issue

code:

final BottomSheetService _bottomSheetService = locator<BottomSheetService>();

if (_bottomSheetService.isBottomSheetOpen != true) { await _bottomSheetService.showCustomSheet( variant: BottomSheetType.pchat, title: 'Private Chat:', description: nick, ); }

Expected behavior

No response

Screenshots

No response

Additional Context

No response

7NT avatar Apr 24 '24 20:04 7NT

@7NT are you using the Stacked navigator observer?

FilledStacks avatar Apr 25 '24 17:04 FilledStacks

Using navigator service

On Thu, Apr 25, 2024, 1:59 PM Dane Mackier @.***> wrote:

@7NT https://github.com/7NT are you using the Stacked navigator observer?

— Reply to this email directly, view it on GitHub https://github.com/Stacked-Org/stacked/issues/1101#issuecomment-2077849232, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7P5BKLIFMK6JU567L6C2DY7E76LAVCNFSM6AAAAABGXUHNVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZXHA2DSMRTGI . You are receiving this because you were mentioned.Message ID: @.***>

7NT avatar Apr 25 '24 18:04 7NT

good point

On Thu, Apr 25, 2024, 1:59 PM Dane Mackier @.***> wrote:

@7NT https://github.com/7NT are you using the Stacked navigator observer?

— Reply to this email directly, view it on GitHub https://github.com/Stacked-Org/stacked/issues/1101#issuecomment-2077849232, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7P5BKLIFMK6JU567L6C2DY7E76LAVCNFSM6AAAAABGXUHNVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZXHA2DSMRTGI . You are receiving this because you were mentioned.Message ID: @.***>

7NT avatar Apr 26 '24 11:04 7NT

The navigator observer is what keeps an eye on the navigations (view changes, dialogs, bottom sheets shown) if you're not using it in your app then Stacked won't know about anything happening visually in your app.

FilledStacks avatar May 20 '24 13:05 FilledStacks

@7NT Did using the Stacked navigator observer solve the issue?

sebastianbuechler avatar Sep 17 '24 06:09 sebastianbuechler

I worked around with .whenComplete() isVisible = true;

await _bottomSheetService .showCustomSheet( variant: BottomSheetType.pchat, title: 'Private Chat:', description: chat.from, ) .whenComplete(() { isVisible = false; });

On Tue, Sep 17, 2024 at 2:57 AM Sebastian Büchler @.***> wrote:

@7NT https://github.com/7NT Did using the Stacked navigator observer solve the issue?

— Reply to this email directly, view it on GitHub https://github.com/Stacked-Org/stacked/issues/1101#issuecomment-2354700135, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7P5BMQTZXP4CCMQV5AIJTZW7HFHAVCNFSM6AAAAABGXUHNVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJUG4YDAMJTGU . You are receiving this because you were mentioned.Message ID: @.***>

-- Play JBridge, feel different

7NT avatar Sep 22 '24 15:09 7NT