This commit is contained in:
Gaurav Kumar
2025-09-09 08:45:46 +05:30
parent 01be9df2ed
commit f9043173c0
25 changed files with 3632 additions and 4 deletions

View File

@@ -0,0 +1,37 @@
import 'dart:typed_data';
/// Temporary in-memory store for complex field data (e.g., uploads)
/// Keyed by fieldKey. Values are dynamic but expected shapes are documented.
class EntityFieldStore {
EntityFieldStore._();
static final EntityFieldStore instance = EntityFieldStore._();
final Map<String, dynamic> _data = {};
void set(String fieldKey, dynamic value) {
_data[fieldKey] = value;
}
T? get<T>(String fieldKey) {
final value = _data[fieldKey];
if (value is T) return value as T;
return null;
}
void remove(String fieldKey) {
_data.remove(fieldKey);
}
void clear() {
_data.clear();
}
}
/// Expected value shapes:
/// - For multi-file uploads: List<UploadItem>
class UploadItem {
final String fileName;
final Uint8List bytes;
UploadItem({required this.fileName, required this.bytes});
}