diff --git a/lib/src/widgets/toolbar/image_video_utils.dart b/lib/src/widgets/toolbar/image_video_utils.dart index 4dad48cb..1bfa7e03 100644 --- a/lib/src/widgets/toolbar/image_video_utils.dart +++ b/lib/src/widgets/toolbar/image_video_utils.dart @@ -37,6 +37,8 @@ class LinkDialogState extends State { return AlertDialog( backgroundColor: widget.dialogTheme?.dialogBackgroundColor, content: TextField( + keyboardType: TextInputType.multiline, + maxLines: null, style: widget.dialogTheme?.inputTextStyle, decoration: InputDecoration( labelText: 'Paste a link'.i18n, @@ -65,7 +67,7 @@ class LinkDialogState extends State { } void _applyLink() { - Navigator.pop(context, _link); + Navigator.pop(context, _link.trim()); } } diff --git a/lib/src/widgets/toolbar/link_style_button.dart b/lib/src/widgets/toolbar/link_style_button.dart index 8b75601d..e2bea77c 100644 --- a/lib/src/widgets/toolbar/link_style_button.dart +++ b/lib/src/widgets/toolbar/link_style_button.dart @@ -133,7 +133,7 @@ class _LinkStyleButtonState extends State { void _linkSubmitted(dynamic value) { // text.isNotEmpty && link.isNotEmpty final String text = (value as Tuple2).item1; - final String link = value.item2; + final String link = value.item2.trim(); var index = widget.controller.selection.baseOffset; var length = widget.controller.selection.extentOffset - index; @@ -185,6 +185,8 @@ class _LinkDialogState extends State<_LinkDialog> { content: Column( children: [ TextField( + keyboardType: TextInputType.multiline, + maxLines: null, style: widget.dialogTheme?.inputTextStyle, decoration: InputDecoration( labelText: 'Text'.i18n, @@ -195,6 +197,8 @@ class _LinkDialogState extends State<_LinkDialog> { controller: _textController, ), TextField( + keyboardType: TextInputType.multiline, + maxLines: null, style: widget.dialogTheme?.inputTextStyle, decoration: InputDecoration( labelText: 'Link'.i18n, @@ -243,6 +247,6 @@ class _LinkDialogState extends State<_LinkDialog> { } void _applyLink() { - Navigator.pop(context, Tuple2(_text, _link)); + Navigator.pop(context, Tuple2(_text.trim(), _link.trim())); } }