filePrefix static method

String filePrefix(
  1. String? ext, {
  2. required MessageType fallbackType,
})

Maps a file ext to a short storage prefix (img / aud / vid / txt).

Falls back to the canonical prefix for fallbackType when ext is not in the map.

Implementation

static String filePrefix(String? ext, {required MessageType fallbackType}) {
  return _extensionToPrefix[ext] ?? _fallbackPrefix(fallbackType);
}