OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
https://pub.dartlang.org/packages/flutter_screenutil
Apache License 2.0
3.88k stars 494 forks source link

ScreenUtil().setWidth(65) error #349

Closed tianshaokai closed 2 years ago

tianshaokai commented 2 years ago

flutter 2.10.2 , Tools • Dart 2.16.1 • DevTools 2.9.2

The constructor being called isn't a const constructor. (Documentation) Try removing 'const' from the constructor invocation. A value of type 'Null' can't be assigned to a parameter of type 'double' in a const constructor. (Documentation) Try using a subtype, or removing the keyword 'const'. Arguments of a constant creation must be constant expressions. (Documentation) Try making the argument a valid constant, or use 'new' to call the constructor.