I am trying to put column() widget inside Flexible and/or Expanded widget, but i am getting following error, i don't know why this is occurring, can anybody please let me know how can i put column() widget inside Flexible Widget.
I am getting following erros:
Evaluation of this constant expression throws an exception.dart(const_eval_throws_exception)
A value of type 'Null' can't be assigned to a parameter of type 'Widget' in a const constructor.
Try using a subtype, or removing the keyword 'const'.dartconst_constructor_param_type_mismatch
The constructor being called isn't a const constructor.
Try removing 'const' from the constructor invocation.dartconst_with_non_const
The values in a const list literal must be constants.
Try removing the keyword 'const' from the list literal.dartnon_constant_list_element
The constructor being called isn't a const constructor.
Try removing 'const' from the constructor invocation.dartconst_with_non_const
The values in a const list literal must be constants.
Try removing the keyword 'const' from the list literal.dartnon_constant_list_element
Flutter Version
Flutter 2.5.0 • channel stable •
CodePudding user response:
remove
const
from UI where you declared in front of the widget. That's also mentioned in your editor dialog.CodePudding user response:
Well, the error is due to using the keyword const for the constructor widget. Just remove it and you will be all good.