buildFlagIconForCommodity function

Widget? buildFlagIconForCommodity(
  1. String key, {
  2. Widget flagIconBuilder(
    1. String
    )?,
  3. bool hasShadow = true,
  4. double? height,
  5. double? width,
})

Implementation

Widget? buildFlagIconForCommodity(
  String key, {
  Widget Function(String)? flagIconBuilder,
  bool hasShadow = true,
  double? height,
  double? width,
}) {
  final iconKey = toCamelCase(key);
  final hasIcon = kFastImageCommodityMap.containsKey(iconKey);

  if (!hasIcon) {
    debugLog('No flag icon found for commodity: $key');
    return null;
  }

  return buildFlagIcon(
    key,
    kFastImageCommodityMap,
    flagIconBuilder: flagIconBuilder,
    hasShadow: hasShadow,
    height: height,
    width: width,
  );
}