Example, I have a Wrap widget, and in children I have some code like:
listTask.map((e) {
if (e.day!.contains(value))
return Padding(
padding: const EdgeInsets.all(4.0),
child: Container(
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.black),
height: 20,
width: 20,
),
);
}).toList()
I want it return Padding whenever it pass if statement, but it get error The argument type 'List<Padding?>' can't be assigned to the parameter type 'List<Widget>'
. How can I solve it? Thank you.