17

I am working on a flutter application. Recently I have enabled this application for web and its running fine if I run it from Android Studio by clicking on Run button. The problem is when I run it on localhost or I build it for release it gives en error that is Another exception was thrown: Instance of 'minified:bV<void> and the page appears blank in gray color.

In the page that is broken, I have used flower kind of layout. I have modified this library. It was working fine on localhost too before but, its breaking now.

Please suggest.

Below are the details:

Flutter Version - v1.14.6 (Beta)

Commands: I use below commands to run the app on localhost.

cd build/web
flutter build web -t lib/main_web.dart
flutter pub global activate dhttpd
flutter pub global run dhttpd

Thanks in advance.

Ashish Tiwari
  • 2,168
  • 4
  • 30
  • 54
  • 1
    Hi, have you found any solution? I'm having the same grey screen problem. In my case the problem is caused by a platform check. Here is my question if you wanna have a look at it. https://stackoverflow.com/questions/62215215/another-exception-was-thrown-instance-of-errorsummary-when-performing-platfor Cheers – Vincenzo Jun 05 '20 at 12:30

6 Answers6

4

My console displayed a similar error message to yours, as well as a blank grey screen. After searching for few days, I found out that the error could be due to an expanded or flexible widget.

solution:

just try to remove or replace Expanded widget, it worked for me

Thank you

Tarun Jain
  • 411
  • 5
  • 17
  • 1
    Bro.. How to use expanded or flexible then? – MBK Sep 21 '21 at 08:59
  • Sorry I am not that professional in flutter it just using the above sol I resolved the issue and here I just shared mine experience, But give me some time I'll try to find some better solution soon or substitute for using expanded. Thank you!! – Tarun Jain Sep 21 '21 at 09:30
  • I thought @Wesley answer will work but fortunately, Tarun solution worked for me. I am also using .dotenv package but it does not give me any errors. – ᴅ ᴇ ʙ ᴊ ᴇᴇ ᴛ Jan 23 '23 at 10:12
3

For me, it meant I had a null value somewhere. After searching deeper, it was .env_prod files that work for web on local builds in Chrome, but not once published. i had to use "dotenv_prod" for my variable files.

Wesley Barnes
  • 554
  • 4
  • 18
2

I had the same error. I don't know enough flutter on a technical level but what fixed it for me was changing the root widget of the web page to a Scaffold .

kiwiidb
  • 331
  • 2
  • 10
0

I had the same issue using FlutterFlow.io and using a Custom Widget on a page. FlutterFlow exposes a widget property: "Enforce width & Height". When this property is set, FlutterFlow generates the code for a new Container and places the Custom Widget in that container.

Which means that Custom Widget I was using was causing a lot of screen overflow errors w/o this new Container.

So it seems that this error is caused by Flutter not being able to figure out how to bound the widget (?).
Add a container and see...

Sheshadri Mantha
  • 491
  • 5
  • 14
0

The problem comes from the usage of dotenv package. You can use in your code the environment variable like this.

class Environment {
  static String get appEnv =>
      const String.fromEnvironment(
          'APP_ENV',
          defaultValue: 'dev'
      );
}

and build your app with this argument :

flutter build web --dart-define=APP_ENV=staging
0

I had the same problem. I couldn't trace it back to what caused it. In the end, two things "fixed" it: When building my app I had to

  1. use Flutter's canvas renderer (https://docs.flutter.dev/platform-integration/web/renderers)
  2. use --release switch

I used the command flutter build web --web-renderer canvaskit --release to build my app and the error went away.

speedi33
  • 136
  • 1
  • 7