Alexandre Marques
Alexandre Marques

Reputation: 89

Flutter overlay_support widget Not Initialized

I'm trying to create a notification on top using the overlay_support 1.2.1 widget. I did everything based on the example, but I always get a boot error as shown in the image below.

Image error

Upvotes: 0

Views: 2649

Answers (3)

Anandh Krishnan
Anandh Krishnan

Reputation: 6022

From

void main() {
  runApp(MaterialApp(
    home: MyApp()),
   );
}

To

void main() {
  runApp(
    OverlaySupport.global((
      child: MaterialApp(
      home: MyApp()),
    ),
   );
}

Upvotes: 0

kayode emmanuel
kayode emmanuel

Reputation: 15

I encounter error too but you can wrap your material app with OverlaySupport.global(). Note if you're dealing with multiple screen, you will wrap the main screen i.e. the first screen.

Upvotes: 0

Anonymous4272
Anonymous4272

Reputation: 31

wrap your material app with OverlaySupport.global()picture showing what i mentioned

Upvotes: 3

Related Questions