I know this kind of questions has already been asked, but I still can’t find the solution.
I’m getting flag images from the server and getting this exception, but the flag images can still be loaded.
Unable to load asset: “https://***.com/content/icons/AE.png”.
The asset does not exist or has empty data.
I checked my pubspec.yaml
file as well but it seems to be fine
Here is my pubspec.yaml
file
name:
description: "A new Flutter project."
version: 1.0.1+5
environment:
sdk: '>=3.2.5 <4.0.0'
dependencies:
flutter:
sdk: flutter
cached_network_image: ^3.3.1
camera: ^0.10.5+9
carousel_slider: ^4.2.1
http: ^1.2.0
image_picker: ^1.1.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_localizations:
sdk: flutter
flutter_lints: ^2.0.0
dependency_overrides:
intl: any
flutter:
uses-material-design: true
assets:
- assets/svg/
- assets/png/
Here is also how i am getting images
ListView.separated(
separatorBuilder: (_, __) => const Divider(color: Color(0XFFDCDFEA)),
itemCount: controller.countryList.length,
itemBuilder: (context, position) {
var item = controller.countryList[position];
return ListTile(
contentPadding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
dense: false,
leading: Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(color: const Color(0xffA0A0A0).withOpacity(0.2), blurRadius: 25),
],
),
child: CachedNetworkImage(
imageUrl: item.icon,
height: 25.r,
width: 33.r,
fit: BoxFit.cover,
placeholder: (context, url) =>
SvgPicture.asset('assets/svg/ic_flag_placeholder.svg'),
errorWidget: (context, url, error) =>
SvgPicture.asset('assets/svg/ic_flag_placeholder.svg'),
),
),
onTap: () => controller.onCountrySelectedAndMove(item),
title: Text(
item.countryName,
style: AppTextTheme.so4_12(),
),
);
},
)