[Async Attachment Upload] Initial implementation

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-16 21:21:15 +05:30
parent 628542f99b
commit 0a6948cf32
54 changed files with 2561 additions and 1328 deletions
@@ -0,0 +1,15 @@
import 'package:http_parser/http_parser.dart' as http_parser;
import 'package:mime/mime.dart';
/// Useful extension functions for [String]
extension StringX on String {
/// Returns the mime type from the passed file name.
http_parser.MediaType get mimeType {
if (this == null) return null;
if (toLowerCase().endsWith('heic')) {
return http_parser.MediaType.parse('image/heic');
} else {
return http_parser.MediaType.parse(lookupMimeType(this));
}
}
}