Reputation: 35
The argument type 'String?' can't be assigned to the parameter type 'String'
how can pass the parameter ?
Upvotes: 1
Views: 649
Reputation: 801
You can try this
child: TipsCard(
//
image:tipsPages[i]["image"] as String,//
)
Upvotes: 6
Reputation: 3326
You can do this:
//...
child: TipsCard(
//...
image: tipsPages[i]["image"] ?? "", // Replace this blank "" with a default image url of your choice
),
Upvotes: 2