///I got the same issue while I am checking image is null or not I am using a container to show the image Hope this will help you,Thanks
//////image inside a container
Container(
height: 120,
width: 120,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
image:DecorationImage(
fit: BoxFit.cover,
image: provider.currentLoggedInUser!.profilePicture!= null?
NetworkImage(provider.currentLoggedInUser!.profilePicture.toString())
:AssetImage('assets/managerPicture.jpeg') as ImageProvider),
border: Border.all(
color: AppColors.white, width: 2.0),
),
),
],
),
////you can also use the CachedNetworkImage plugin
ChachedNetworkImage
CachedNetworkImage(
maxHeightDiskCache: 100,
imageUrl: provider.currentLoggedInUser!.profilePicture.toString(),
imageBuilder: (context, imageProvider) => Container(
height: 120,
width: 120,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: imageProvider, fit: BoxFit.cover),
border: Border.all(
color: AppColors.white, width: 2.0),
),
),
placeholder: (context, url) =>
const CircularProgressIndicator(),
errorWidget: (context, url, error) => Container(
height: 120,
width: 120,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
image:DecorationImage(
fit: BoxFit.cover,
image: AssetImage('assets/managerPicture.jpeg')),
border: Border.all(
color: AppColors.white, width: 2.0),
),
),
fadeOutDuration: const Duration(seconds: 1),
fadeInDuration: const Duration(seconds: 3),
),