removed country flags package and read flags from server and implement svg cahce structure
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/views/shared/cached_svg.dart';
|
||||
|
||||
import '../../core/config/app_config.dart';
|
||||
|
||||
class Flag extends StatelessWidget {
|
||||
const Flag({required this.countryCode, super.key});
|
||||
|
||||
final String countryCode;
|
||||
|
||||
@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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user