copyAllAsJson method
Implementation
Future<String?> copyAllAsJson() async {
if (!canCopyJson) return null;
copyingJson = true;
notifyListeners();
try {
final rows = await _fetchAllActiveRows();
final exportRows = rows
.map(
(row) => Map<String, Object?>.from(
withoutRowIdEntry(Map<String, dynamic>.from(row)),
),
)
.toList();
copyingJson = false;
notifyListeners();
return jsonEncode(exportRows);
} catch (error) {
copyingJson = false;
_copyError = 'Failed to copy JSON: $error';
notifyListeners();
return null;
}
}