Remove unneeded function
This commit is contained in:
@@ -211,50 +211,6 @@ class StorageService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reads annotations with metadata for a specific sheet page.
|
|
||||||
///
|
|
||||||
/// Returns [StoredAnnotation] with annotations and lastModified, or null if none exist.
|
|
||||||
Future<StoredAnnotation?> readAnnotationsWithMetadata(
|
|
||||||
String sheetUuid,
|
|
||||||
int pageNumber,
|
|
||||||
) async {
|
|
||||||
final box = await Hive.openBox(_annotationsBox);
|
|
||||||
final value = box.get(_annotationKey(sheetUuid, pageNumber));
|
|
||||||
|
|
||||||
if (value == null) return null;
|
|
||||||
|
|
||||||
// Handle legacy format (plain string) - treat as very old
|
|
||||||
if (value is String) {
|
|
||||||
return StoredAnnotation(
|
|
||||||
annotationsJson: value,
|
|
||||||
lastModified: DateTime.fromMillisecondsSinceEpoch(0),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value is Map) {
|
|
||||||
return StoredAnnotation.fromMap(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Writes annotations for a specific sheet page.
|
|
||||||
///
|
|
||||||
/// Pass null or empty string to delete annotations for that page.
|
|
||||||
/// Automatically sets lastModified to current time.
|
|
||||||
Future<void> writeAnnotations(
|
|
||||||
String sheetUuid,
|
|
||||||
int pageNumber,
|
|
||||||
String? annotationsJson,
|
|
||||||
) async {
|
|
||||||
await writeAnnotationsWithMetadata(
|
|
||||||
sheetUuid,
|
|
||||||
pageNumber,
|
|
||||||
annotationsJson,
|
|
||||||
DateTime.now(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Writes annotations with a specific lastModified timestamp.
|
/// Writes annotations with a specific lastModified timestamp.
|
||||||
///
|
///
|
||||||
/// Used when syncing from server to preserve server's timestamp.
|
/// Used when syncing from server to preserve server's timestamp.
|
||||||
|
|||||||
Reference in New Issue
Block a user