record method

Future<void> record(
  1. AppSnapshot snapshot
)

Save an AppSnapshot to persistent storage.

Implementation

Future<void> record(AppSnapshot snapshot) async {
  try {
    final prefs = await SharedPreferences.getInstance();
    await prefs.setString(_snapshotKey, jsonEncode(snapshot.toJson()));
  } catch (e) {
    debugPrint('[Trinity] Failed to record snapshot: $e');
  }
}