Skip to content

[bug]: showCustomSnackBar doesn’t display #1163

@YJxxx

Description

@YJxxx

Describe the bug

I’m using the example from this repository:
https://github.com/Stacked-Org/services/tree/main/example

When I add a Future.delayed before calling showCustomSnackBar, the snackbar does not appear.

What operating system do you use?

macOS

Information about the installed tooling

[✓] Flutter (Channel stable, 3.32.1, on macOS 15.5 24F74 darwin-arm64, locale
en-CN) [1,124ms]
• Flutter version 3.32.1 on channel stable at
/opt/homebrew/Caskroom/flutter/3.24.5/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b25305a883 (5 days ago), 2025-05-29 10:40:06 -0700
• Engine revision 1425e5e9ec
• Dart version 3.8.1
• DevTools version 2.45.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn

[✗] Android toolchain - develop for Android devices [1,079ms]
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/to/macos-android-setup for detailed
instructions).
If the Android SDK has been installed to a custom location, please use
flutter config --android-sdk to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [1,687ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16F6
• CocoaPods version 1.16.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [8ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[!] Android Studio (not installed) [7ms]
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/macos-android-setup for detailed
instructions).

[✓] VS Code (version 1.100.2) [7ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.112.0

[✓] Connected device (1 available) [5.6s]
• iPhone 16 Plus (mobile) • 738AA5B2-341D-B7AF-4DDE-7E1152A54637 •
ios • com.apple.CoreSimulator.SimRuntime.iOS-18-5 (simulator)
• macOS (desktop) • macos •
darwin-arm64 • macOS 15.5 24F74 darwin-arm64

[✓] Network resources [1,604ms]
• All expected network resources are available.

Steps to reproduce the issue

1.	Clone and run the example project.
2.	Modify the snackbar button like this:
          OutlinedButton(
            onPressed: () async {

              // add delay code
              await Future.delayed(Duration(seconds: 1), () {
                print('Showing blue and yellow snackbar after a delay');
              });

              _snackbarService.showCustomSnackBar(
                variant: SnackbarType.blueAndYellow,
                message: 'Blue and yellow',
                title: 'The message is the message',
                onTap: (_) {
                  print('snackbar tapped');
                },
                mainButtonTitle: 'Undo',
                onMainButtonTapped: () => print('Undo the action!'),
              );
            },
            child: Text(
              'Show Blue and Yellow Snackbar',
            ),
          ),

Expected behavior

No response

Screenshots

Image

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feedback RequestedWaiting for new information from the OP

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions