selectAllEnabled property
override
Whether select all is enabled.
Implementation
@override
bool get selectAllEnabled {
if (widget.selectionControls is! TextSelectionHandleControls) {
return widget.toolbarOptions.selectAll &&
(!widget.readOnly || !widget.obscureText) &&
widget.enableInteractiveSelection;
}
if (!widget.enableInteractiveSelection || (widget.readOnly && widget.obscureText)) {
return false;
}
switch (defaultTargetPlatform) {
case TargetPlatform.macOS:
return false;
case TargetPlatform.iOS:
return textEditingValue.text.isNotEmpty && textEditingValue.selection.isCollapsed;
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.linux:
case TargetPlatform.windows:
return textEditingValue.text.isNotEmpty &&
!(textEditingValue.selection.start == 0 &&
textEditingValue.selection.end == textEditingValue.text.length);
}
}