MSameer
MSameer

Reputation: 35

The argument type 'String"?"' can't be assigned to the parameter type 'String'

The argument type 'String?' can't be assigned to the parameter type 'String'

how can pass the parameter ?

enter image description here

enter image description here

Upvotes: 1

Views: 649

Answers (2)

Rasathurai Karan
Rasathurai Karan

Reputation: 801

You can try this

child: TipsCard(
//
image:tipsPages[i]["image"] as String,//
)

Upvotes: 6

Bach
Bach

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

Related Questions