CircleAvatar(
radius: 30,
backgroundImage: fromAsset
? AssetImage(pic ?? '')
: CachedNetworkImageProvider(pic ?? ''),
),
In this sampel code I have this error:
The argument type ‘Object’ can’t be assigned to the parameter type
fromAsset : a boolian that specifies if should return circle with asset or network in this widget.
>Solution :
It can be solved this way:
CircleAvatar(
radius: 30,
backgroundImage: fromAsset
? AssetImage(pic ?? '')
: CachedNetworkImageProvider(pic ?? '') as ImageProvider,
),