TF-3416 Implement preview EML attachment

This commit is contained in:
dab246
2025-01-13 10:02:50 +07:00
committed by Dat H. Pham
parent 7cbdfddb6d
commit d304083b2e
54 changed files with 1489 additions and 148 deletions
@@ -0,0 +1,27 @@
import 'package:collection/collection.dart';
import 'package:tmail_ui_user/features/caching/exceptions/local_storage_exception.dart';
import 'package:universal_html/html.dart' as html;
class LocalStorageManager {
void save(String key, String value) {
html.window.localStorage.addAll({key: value});
}
String get(String key) {
final entry = html.window.localStorage
.entries
.firstWhereOrNull((entry) => entry.key == key);
if (entry != null) {
return entry.value;
} else {
throw NotFoundDataWithThisKeyException();
}
}
void remove(String key) {
html.window.localStorage.remove(key);
}
}