show eu flag if it is empty

This commit is contained in:
amirrezaghabeli
2025-09-14 11:52:59 +03:30
parent 578c933369
commit 7462d71b33
7 changed files with 29 additions and 27 deletions
+1 -5
View File
@@ -75,11 +75,7 @@ class _CachedSvgState extends State<CachedSvg> {
@override
Widget build(BuildContext context) {
if (_isLoading) {
return SizedBox(
width: widget.width ?? 20,
height: widget.height ?? 20,
child: const Center(child: CircularProgressIndicator()),
);
return SizedBox();
}
if (_svgData == null) {
+12 -11
View File
@@ -11,16 +11,17 @@ class Flag extends StatelessWidget {
@override
Widget build(BuildContext context) {
return countryCode.isNotEmpty
? ClipRRect(
borderRadius: BorderRadius.circular(6),
child: CachedSvg(
url: '${AppConfig.flagUrl}$countryCode',
width: 32.0.w(),
height: 21.0.h(),
fit: BoxFit.cover,
),
)
: const SizedBox();
return ClipRRect(
borderRadius: BorderRadius.circular(6),
child: CachedSvg(
url:
countryCode.isNotEmpty
? '${AppConfig.flagUrl}$countryCode'
: '${AppConfig.flagUrl}EU',
width: 32.0.w(),
height: 21.0.h(),
fit: BoxFit.cover,
),
);
}
}