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

LateInitializationError #25

Open Djihanegh opened 3 years ago

Djihanegh commented 3 years ago

Hello, i'm starting to use Sizer, thank for for this plugin, but im having an issue though, i tried to make my Text widget like this :

 Text(
                                      "Ajouter au panier",
                                      style: TextStyle(
                                          color: Colors.white, fontSize: 20.sp),
                                    ),

In order to make the fontSize responsive, but i got this error :

LateInitializationError: Field 'width' has not been initialized.

What's the problem with that ? Thank you in advance.

Yogesh-333 commented 3 years ago

Iam also facing same issue any help "LateInitializationError: Field 'deviceType' has not been initialized."

ryanrahmans26 commented 3 years ago

screenshot-1625639674194

Same

i think i want to go back use version 1

zamizayn commented 2 years ago

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

you can fix it by wrapping it with Sizer on the root