class ReusableCard extends StatelessWidget {
ReusableCard({required this.colour, this.cardChild});
final Color colour;
final Widget cardChild;
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(15.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: colour,
),
// child: cardChild,
);
}
}
This is the error :
" The parameter ‘cardChild’ can’t have a value of ‘null’ because of its type, but the implicit default value is ‘null’. "
4
Answers
I don’t know what your
cardChild
code is, but I think the answer you are looking for is this.