updateTargets method
Implementation
void updateTargets(Iterable<TextSelectionTarget> targets) {
final next = targets.where((t) => t.selectionEnabled).toList();
// Freeze reading order during a selection; transforms may animate.
if (next.length != _targets.length ||
next.any((target) => !_targets.contains(target))) {
clear();
_targets = next;
} else if (!isActive) {
_targets = next;
}
validate();
_useAppearance(
_appearanceOverride ??
(_targets.isEmpty
? const SelectionAppearance()
: _targets.first.selectionAppearance),
);
}