SelectionContainer's listeners can remove itself during listener call… (#124624)

When swapping out delegate of  selectioncontainer, if the newly passed in delegate doesn't have any selectable content(which is usually the case), the selectioncontainerstate will notify all of the listeners. One of the listener would be SelectionRegistrant._updateSelectionRegistrarSubscription, and since it doesn't have content, it would remove itself from the listener which causes concurrent modification
This commit is contained in:
chunhtai
2023-04-17 16:19:11 -07:00
committed by GitHub
parent 15cb1f84d7
commit cc9ffd3f3b
8 changed files with 105 additions and 17 deletions

View File

@@ -18,7 +18,7 @@ void main() {
expect(BrowserContextMenu.enabled, !kIsWeb);
// Allow the selection overlay geometry to be created.
await tester.pump();
await tester.pumpAndSettle();
expect(find.byType(AdaptiveTextSelectionToolbar), findsNothing);