safeGetUint8List static method

Uint8List? safeGetUint8List(
  1. Map map,
  2. String key
)

Safely extracts a Uint8List from a map.

This method centralizes the Uint8List extraction pattern that was repeated in image data processing.

map The map to extract from key The key to extract Returns the Uint8List or null if not found

Implementation

static Uint8List? safeGetUint8List(Map<dynamic, dynamic> map, String key) {
  final value = map[key];
  if (value is Uint8List) {
    return value;
  }
  return null;
}