I Hello, I need help in my code, why I am getting this error, I copied the code from another project but there is no error there.
@override
Widget build(BuildContext context) {
dynamic screenWidth = MediaQuery.of(context).size.width;
dynamic screenHeight = MediaQuery.of(context).size.height;
ScreenUtil.init(
BoxConstraints(maxWidth: screenWidth, maxHeight: screenHeight),
designSize: const Size(360, 690),
orientation: Orientation.portrait);
return Scaffold(
CodePudding user response:
ScreenUtil.init
's 1st argument is of type BuildContext
.
ScreenUtil.init(
context,
deviceSize: Size(screenWidth, screenHeight),
designSize: const Size(360, 690),
orientation: Orientation.portrait,
);