Remove SnackBar 'What is entered is not a link'

pull/602/head
X Code 3 years ago
parent a2c19dfcff
commit 984260b3df
  1. 6
      lib/src/widgets/toolbar/link_style_button.dart

@ -101,10 +101,11 @@ class _LinkStyleButtonState extends State<LinkStyleButton> {
context: context,
builder: (ctx) {
final link = _getLinkAttributeValue();
final index = widget.controller.selection.baseOffset;
if (link != null) {
// TODO: text should be the link's corresponding text, not selection
}
final index = widget.controller.selection.baseOffset;
final text = widget.controller.document
.toPlainText()
.substring(index, widget.controller.selection.extentOffset);
@ -206,10 +207,9 @@ class _LinkDialogState extends State<_LinkDialog> {
}
if (!AutoFormatMultipleLinksRule.linkRegExp.hasMatch(_link)) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('What is entered is not a link'.i18n)));
return false;
}
return true;
}

Loading…
Cancel
Save