I have this error when I try to run Alignment.
2
The final keyword stands for constant. Since it is a constant, not a variable, initialization is required. Remove the final keyword.
final
Because final is a constant keyword, its value cannot be changed.
There are two main keywords for constants: const and final. const is defined at compile time and final is defined at runtime.
const
Just Remove final keyword .
otherwise you can not assign any value to alignment variable.
like this.
AlignmentDirectional alignment;
Click here to cancel reply.
2
Answers
The
final
keyword stands for constant. Since it is a constant, not a variable, initialization is required. Remove thefinal
keyword.Because
final
is a constant keyword, its value cannot be changed.There are two main keywords for constants:
const
andfinal
.const
is defined at compile time andfinal
is defined at runtime.Just Remove final keyword .
otherwise you can not assign any value to alignment variable.
like this.