buildFlagIconForFinancialInstrument function
Implementation
Widget? buildFlagIconForFinancialInstrument(
String instrument, {
Widget Function(String)? flagIconBuilder,
bool hasShadow = true,
double? height,
double? width,
}) {
final iconKey = toCamelCase(instrument);
final isCountry = kFastImageFlagMap.containsKey(iconKey);
if (isCountry) {
return buildFlagIconForCountry(
instrument,
flagIconBuilder: flagIconBuilder,
hasShadow: hasShadow,
height: height,
width: width,
);
}
final isCommodity = kFastImageCommodityMap.containsKey(iconKey);
if (isCommodity) {
return buildFlagIconForCommodity(
instrument,
flagIconBuilder: flagIconBuilder,
hasShadow: hasShadow,
height: height,
width: width,
);
}
final isCrypto = kFastImageCryptoMap.containsKey(iconKey);
if (isCrypto) {
return buildFlagIconForCrypto(
instrument,
flagIconBuilder: flagIconBuilder,
hasShadow: hasShadow,
height: height,
width: width,
);
}
debugLog('No flag icon found for instrument: $instrument');
return null;
}