Skip to content

[bug]: Snackbar does't work in flutter 3.38.1 #1178

@ajnaf

Description

@ajnaf

Describe the bug

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: No Overlay widget found. Some widgets require an Overlay widget ancestor for correct operation. The most common way to add an Overlay to an application is to include a MaterialApp, CupertinoApp or Navigator widget in the runApp() call. The context from which that widget was searching for an overlay was: _Theater

What operating system do you use?

macOS

Information about the installed tooling

✓] Flutter (Channel stable, 3.38.1, on macOS 26.1 25B78 darwin-arm64, locale en-LY) [563ms]
• Flutter version 3.38.1 on channel stable at /Users/a.elajnaf/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b45fa18946 (27 hours ago), 2025-11-12 22:09:06 -0600
• Engine revision b5990e5ccc
• Dart version 3.10.0
• DevTools version 2.51.1
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging

[!] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [1,619ms]
• Android SDK at /Users/a.elajnaf/Library/Android/sdk
• Emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
✗ Flutter requires Android SDK 36 and the Android BuildTools 28.0.3
To update the Android SDK visit https://flutter.dev/to/macos-android-setup for detailed instructions.
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

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

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

[✓] Connected device (2 available) [10.6s]
• macOS (desktop) • macos • darwin-arm64 • macOS 26.1 25B78 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.162

Steps to reproduce the issue

  1. Install flutter 3.38.1
  2. Call a snackbar

Expected behavior

No response

Screenshots

No response

Additional Context

I fixed it by adding the code below to MaterialApp.router in main.dart
builder: (context, child) { return Overlay( initialEntries: [OverlayEntry(builder: (context) => child!)], ); },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions