'Flutter - Edge and Chrome pages always appear blank when not running the given standard main file

every time I run a debug session (may it be on chrome or on edge) the page appears entirely blank, but no errors are thrown.

So far I´ve tried:

  • reducing the code to a minimum to exclude errors in the widgets code
  • running on different devices
  • running via flutter run -d chrome --web-port=8080 --web-hostname=the value of IPv4 Address
  • adding localhost to my "safe-list" on my antivirus

Here you can see my flutter doctor -v:

[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19043.1237], locale de-DE)
    • Flutter version 2.2.3 at C:\src\flutter
    • Framework revision f4abaa0735 (3 months ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\marcu\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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
    • android-studio-dir = C:\Program Files\Android\Android Studio
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2019.1.2
    • 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

[√] VS Code (version 1.60.2)
    • VS Code at C:\Users\marcu\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.27.0

[√] Connected device (2 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61
    • Edge (web)   • edge   • web-javascript • Microsoft Edge 94.0.992.38

• No issues found!

Also my code in textform:

import 'package:flutter/material.dart';

void main() {
  runApp(TestingWidget());
}

class TestingWidget extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    print("Performing test on testwidget.dart");
    return MaterialApp(
        home: Scaffold(body: Text("Testwidget") //MethodWidget(),
            )
        //home: Text("test")
        );
  }
}

I am sorry if I provided anything in the wrong way, it is my first time writing on stackoverflow.

Thank you for your help!



Solution 1:[1]

I just had this issue, and It turned out to be a poor internet connection, ran out of subscription in the middle of building the application. Restored my internet and it built successfully

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 CSD