getBannerIP function

dynamic getBannerIP(
  1. String bannerPath, {
  2. Uint8List? bannerByte,
  3. double? width,
  4. double? height,
})

Implementation

getBannerIP(String bannerPath, {Uint8List? bannerByte, double? width, double? height}) {
  try {
    if (bannerByte!=null) {
      return MemoryImage(bannerByte);
    }
    if( bannerPath.isNotEmpty) {
      bool link = isUrl(bannerPath);
      if (link) {
        return CachedNetworkImageProvider(bannerPath);
      }
      bool base64 = isBase64(bannerPath);
      if (base64) {
        return MemoryImage(base64Decode(bannerPath));
      }
    }
  } catch (ex, trace) {
    DialogView.showToast('msg_TraitementImpossible'.tr);
    logError(ex, trace: trace, position: 'openFileImageExplorer');
  }
  return Image.asset(ImageIconResources.placeholder, width: width, height: height, fit: BoxFit.cover);
}