-1

enter image description here

Here body1 is Textstyle . its always shows error. when I try to add const keyword , its shows another error like below

enter image description here

How can I override this issue?.

1 Answers1

1

go to the declaration of body1 variable and make it constant

For example:

const TextStyle body1 = TextStyle(
    fontSize: 15,
    fontWeight: FontWeight.normal,
    //or whatever styling you want
    //Please note that every style you will apply should be constant too
  );