Format code
This commit is contained in:
@@ -30,19 +30,19 @@ class Change {
|
||||
|
||||
/// Serializes this change to a map for storage.
|
||||
Map<String, dynamic> toMap() => {
|
||||
'type': type.index,
|
||||
'sheetUuid': sheetUuid,
|
||||
'value': value,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
};
|
||||
'type': type.index,
|
||||
'sheetUuid': sheetUuid,
|
||||
'value': value,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
};
|
||||
|
||||
/// Serializes this change to JSON for API requests.
|
||||
Map<String, dynamic> toJson() => {
|
||||
'type': type.name,
|
||||
'sheetUuid': sheetUuid,
|
||||
'value': value,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
};
|
||||
'type': type.name,
|
||||
'sheetUuid': sheetUuid,
|
||||
'value': value,
|
||||
'createdAt': createdAt.toIso8601String(),
|
||||
};
|
||||
|
||||
/// Deserializes a change from a stored map.
|
||||
///
|
||||
@@ -91,9 +91,8 @@ class ChangeQueue {
|
||||
for (final change in _queue) {
|
||||
final sheet = sheets.firstWhere(
|
||||
(s) => s.uuid == change.sheetUuid,
|
||||
orElse: () => throw StateError(
|
||||
'Sheet with UUID ${change.sheetUuid} not found',
|
||||
),
|
||||
orElse: () =>
|
||||
throw StateError('Sheet with UUID ${change.sheetUuid} not found'),
|
||||
);
|
||||
|
||||
switch (change.type) {
|
||||
|
||||
Reference in New Issue
Block a user