import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:aslan/chatvibe_managers/app_general_manager.dart'; import 'package:aslan/chatvibe_ui/components/at_compontent.dart'; class ATCountryFlagImage extends StatelessWidget { final String? countryName; final double? width; final double? height; final BorderRadius? borderRadius; final BoxFit? fit; const ATCountryFlagImage({ super.key, required this.countryName, this.width, this.height, this.borderRadius, this.fit, }); @override Widget build(BuildContext context) { return Selector( selector: (_, provider) => provider.getCountryFlagByName(countryName ?? ""), builder: (_, flagUrl, __) { if (flagUrl.isEmpty) { return SizedBox(width: width, height: height ?? width); } return netImage( url: flagUrl, width: width, height: height, borderRadius: borderRadius, fit: fit, ); }, ); } }