Punkkk
Punkkk

Reputation: 53

Flutter build Error after upgrading flutter

My Flutter android app was running without any problems but I upgraded Flutter to 3.3.4 and now I am having the following Error while building app bundle (and apk). Please help me.

The argument type 'EdgeInsets' can't be assigned to the parameter type 'Margins?'.

Code:

style: {
                    'body': Style(
                      margin: EdgeInsets.zero,
                      padding: EdgeInsets.zero,
                      fontSize: const FontSize(16.0),
                      lineHeight: const LineHeight(1.4),
                      color: Colors.white,
                      textAlign: TextAlign.center,
                      fontWeight: FontWeight.bold,
                    ),
                    'figure': Style(
                        margin: EdgeInsets.zero, padding: EdgeInsets.zero),
                  },

Error

and another error:

Error: Cannot invoke a non-'const' constructor where a const expression is expected. Try using a constructor or factory that is 'const'.

                    fontSize: const FontSize(12.0),
                                    ^^^^^^^^

Another Error

Upvotes: 1

Views: 101

Answers (1)

BHARATH T
BHARATH T

Reputation: 682

Replace fontSize: const FontSize(12.0) with fontSize: 12

Post the saved_articles_tile.dart snippet for more help.

Upvotes: 1

Related Questions