Skip to content

i have crash when i put stream build in my code #185745

@auth-hu

Description

@auth-hu

Steps to reproduce

hello, i am working in my app so i complete everything...
when i add Stream Build in my code and test it my app close and i have lost connect with debug app
my code is:

StreamBuilder(
                    stream: FirebaseFirestore.instance.collection('post').snapshots(), 
                    builder: (context, snapshot) {
                      if(snapshot.connectionState == ConnectionState.waiting){
                        return Center(
                          child: Text(
                            "جاري التحميل"
                          ),
                        );
                      }

                      if(snapshot.hasError){
                        return Center(
                          child: Text(
                            "لا يوجد اتصال بالأنترنيت"
                          ),
                        );
                      }``

                      if(!snapshot.hasData || snapshot.data!.docs.isEmpty){
                        return Center(
                          child: Text(
                            "لا يوجد بيانات حالياً"
                          ),
                        );
                      }

                      final post = snapshot.data!.docs;
                      return Center(
                        child: Text(
                          "$post['name']"
                        ),
                      );
                    },
                    )

Actual results

the windows exe debug lost conniction

Logs

Logs
Launching lib\main.dart on Windows in debug mode...
√ Built build\windows\x64\runner\Debug\atel.exe
Connecting to VM Service at ws://127.0.0.1:57774/j9PWDVXam1w=/ws
Connected to the VM Service.
Lost connection to device.

Exited.

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.41.7, on Microsoft Windows [Version 10.0.19045.6466], locale en-US) [1,552ms]
    • Flutter version 3.41.7 on channel stable at C:\Users\Authh\develop\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision cc0734ac71 (13 days ago), 2026-04-15 21:21:08 -0700
    • Engine revision 59aa584fdf
    • Dart version 3.11.5
    • DevTools version 2.54.2
    • 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, enable-uiscene-migration

[√] Windows Version (10 Home 64-bit, 22H2, 2009) [14.6s]

[√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [38.4s]
    • Android SDK at C:\Users\Authh\AppData\Local\Android\sdk
    • Emulator version 36.5.10.0 (build_id 15081367) (CL:N/A)
    • Platform android-36.1, build-tools 36.1.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    [978ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.5.0) [976ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
    • Visual Studio Community 2026 version 18.5.11709.299
    • Windows 10 SDK version 10.0.26100.0

[√] Connected device (2 available) [1,024ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.6466]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 147.0.3912.86

[√] Network resources [4.4s]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: invalidIssue is closed as not valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions