-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recreate Renzo-Olivares's simplistic_editor
fix
#1996
Conversation
@Renzo-Olivares please check that I have recreated #1979 faithfully. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for taking care of this!
@Renzo-Olivares Can the |
From my knowledge |
I'm setting this PR up as a patch to land when the Q4 stable release happens. Assuming |
In that case then @override
bool get searchWebEnabled {
if (defaultTargetPlatform != TargetPlatform.iOS) {
return false;
}
return !textEditingValue.selection.isCollapsed
&& textEditingValue.selection.textInside(textEditingValue.text).trim() != '';
}
@override
bool get shareEnabled {
if (defaultTargetPlatform != TargetPlatform.iOS) {
return false;
}
return !textEditingValue.selection.isCollapsed
&& textEditingValue.selection.textInside(textEditingValue.text).trim() != '';
}
/// Launch a web search on the current selection,
/// as in the "Search Web" edit menu button on iOS.
///
/// Currently this is only implemented for iOS.
Future<void> _searchWebForSelection(SelectionChangedCause cause) async {
final String text = textEditingValue.selection.textInside(textEditingValue.text);
if (text.isNotEmpty) {
await SystemChannels.platform.invokeMethod(
'SearchWeb.invoke',
text,
);
}
}
/// Launch the share interface for the current selection,
/// as in the "Share" edit menu button on iOS.
///
/// Currently this is only implemented for iOS.
Future<void> _shareSelection(SelectionChangedCause cause) async {
final String text = textEditingValue.selection.textInside(textEditingValue.text);
if (text.isNotEmpty) {
await SystemChannels.platform.invokeMethod(
'Share.invoke',
text,
);
}
} |
…stic-editor-fix
Replaces #1979
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-devrel channel on Discord.