getSelectedContent method
Copies the selected contents of all Selectables.
Implementation
@override
SelectedContent? getSelectedContent() {
final List<SelectedContent> selections = <SelectedContent>[];
for (final Selectable selectable in selectables) {
final allSelectedContent = getAllSelectables(selectable)
.map((e) => e.getSelectedContent())
.nonNulls;
selections.addAll(allSelectedContent);
}
if (selections.isEmpty) {
return null;
}
return SelectedContent(
plainText: transform(selections.map((s) => s.plainText)),
);
}