Skip to content

Commit 8a4900e

Browse files
gnpricechrisbobbe
authored andcommitted
msglist [nfc]: Reorder methods to group mutators together
This messageContentChanged method goes logically next to the various event-handling methods, rather than separated from them by notifyListeners and its siblings.
1 parent 5e12050 commit 8a4900e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/model/message_list.dart

+11-11
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,17 @@ class MessageListView with ChangeNotifier, _MessageSequence {
474474
notifyListeners();
475475
}
476476

477+
/// Update data derived from the content of the given message.
478+
///
479+
/// This does not notify listeners.
480+
/// The caller should ensure that happens later.
481+
void messageContentChanged(int messageId) {
482+
final index = _findMessageWithId(messageId);
483+
if (index != -1) {
484+
_reparseContent(index);
485+
}
486+
}
487+
477488
// Repeal the `@protected` annotation that applies on the base implementation,
478489
// so we can call this method from [MessageStoreImpl].
479490
@override
@@ -497,17 +508,6 @@ class MessageListView with ChangeNotifier, _MessageSequence {
497508
}
498509
}
499510

500-
/// Update data derived from the content of the given message.
501-
///
502-
/// This does not notify listeners.
503-
/// The caller should ensure that happens later.
504-
void messageContentChanged(int messageId) {
505-
final index = _findMessageWithId(messageId);
506-
if (index != -1) {
507-
_reparseContent(index);
508-
}
509-
}
510-
511511
/// Called when the app is reassembled during debugging, e.g. for hot reload.
512512
///
513513
/// This will redo from scratch any computations we can, such as parsing

0 commit comments

Comments
 (0)