loadLogo static method

Future<void> loadLogo(
  1. String? imageUrl
)

Lädt das Bild nur einmal und speichert es

Implementation

static Future<void> loadLogo(String? imageUrl) async {
  if (imageUrl == null) {
    return;
  }
  if (_logoBytes.containsKey(imageUrl)) {
    return;
  }

  try {
    final response = await http.get(Uri.parse(imageUrl));
    if (response.statusCode == 200) {
      _logoBytes[imageUrl] = response.bodyBytes;
    }
  } catch (e) {
    if (kDebugMode) {
      print('Fehler beim Laden des Bildes: $e');
    }
  }
}