I have used the flutter_screenutil package. But when I set width to a widget using ".w" and font size which is "18.sp" is not working. Below is the code
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.w),
child: Column(
children: [
Text(
"Sign Up to Surfyard",
style: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w700,
color: darkTextColor,
),
),
],
),
In this, I cannot set the horizontal padding. "20.w" is not working and the following error shows
Invalid constant value.dart(invalid_constant)
These are the packages which I have installed
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
flutter_screenutil: ^5.0.0+2
google_fonts: ^2.1.0