Open arpit999 opened 4 years ago
When I pass the argument it says both are compulsory. Maybe they changed it in flutter SDK I could not find the solution for that.
Help me thanks.
My Custom Widget Class
class ReusableCard extends StatelessWidget { ReusableCard(@required this.colour, this.cardChild); final Widget cardChild; final Color colour; @override Widget build(BuildContext context) { return Container( child: cardChild, margin: EdgeInsets.all(15.0), decoration: BoxDecoration( color: colour, borderRadius: BorderRadius.circular(10), ), ); } }
Here is the implement of the widget
Expanded( child: Row( children: <Widget>[ Expanded( child: ReusableCard(activeCardColor), ), ], ), ),
@arpit999 better make it this way
ReusableCard({@required this.colour, this.cardChild});
then you can implement it this way
ReusableCard(colour: activeCardColor)
When I pass the argument it says both are compulsory. Maybe they changed it in flutter SDK I could not find the solution for that.
Help me thanks.
My Custom Widget Class
Here is the implement of the widget