TechnoUrmish / Sizer

A flutter plugin for Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple.
MIT License
240 stars 73 forks source link

height or width is not initialed isue #31

Open ramazan351 opened 2 years ago

ramazan351 commented 2 years ago

(LateInitializationError: Field 'width' has not been initialized.)

hieugia3030 commented 2 years ago

You forgot to wrap the root widget with Sizer Widget:

return Sizer(
      builder: (_, __, ___) {
        return MaterialApp(
          title: 'Flutter Demo',
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: MyHomePage(),
        );
      },
    );

I had the same problem, this solution worked for me ;)