AppFlowy/frontend/appflowy_flutter/lib/util/file_extension.dart
Lucas.Xu 792573f46d
feat: optimize image block (#4553)
* feat: add tooltip for maximum image size

* feat: add maximum upload image size tooltip

* feat: limit image size to 10MB

* fix: disable copy link option for cloud image

* fix: disable copy link option for cloud image

* feat: use regex to match the appflowy.cloud image
2024-01-30 22:39:42 +08:00

12 lines
200 B
Dart

import 'dart:io';
extension FileSizeExtension on String {
int? get fileSize {
final file = File(this);
if (file.existsSync()) {
return file.lengthSync();
}
return null;
}
}