hii i am new flutter and facing following error
final String title;
final String desc;
final String timer;
const ListElement({Key? key, required this.title, required this.desc ,required this.timer}) :
super(key: key);
this is my constructor in which i have passed title desc and timer
Text(title, style: TextStyle(fontWeight: FontWeight.w400 ,
fontSize: 30),),
Text(desc, style: TextStyle(fontWeight: FontWeight.w400 ,
fontSize: 15),),
while getting title and desc i am facing this error
2
Answers
ok i use '${widget.title}' to solve this problem
If your widget is
stateful
then you have to writetitle
as