My flutter project used to run fine but after I update my flutter sdk to 3.3.4 I am getting two errors and couldn't compile the project.
The argument type 'EdgeInsets' can't be assigned to the parameter type 'Margins?'.
FittedBox(
child: Html(
data: article.title,
style: {
'body': Style(
margin: EdgeInsets.zero,
padding: EdgeInsets.zero,
fontSize: _articleTileFont(context),
lineHeight: const LineHeight(1.4),
fontWeight: FontWeight.bold,
maxLines: 3,
textOverflow: TextOverflow.ellipsis,
),
I am using EdgeInsets.zero in multiple files but it is always throwing a error after I have updated.
Another Error I am getting is:
The constructor being called isn't a const constructor.
FontSize _articleTileFont(BuildContext context) {
if (Responsive.isMobile(context)) {
return const FontSize(25);
} else if (Responsive.isTabletPortrait(context)) {
return const FontSize(48);
} else if (Responsive.isTablet(context)) {
return const FontSize(65);
} else {
return const FontSize(25);
}
}
There is the same error on many pages. Please help me.
Style
norFontSize
are classes in the flutter framework. It must be from some package you use. Upgrading flutter is not what caused this, but the upgrading of that package