|
|
|
@ -144,7 +144,7 @@ String _standardizeImageUrl(String url) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool _isMobile() => io.Platform.isAndroid || io.Platform.isIOS; |
|
|
|
|
|
|
|
|
|
TextStyle _defaultStyleBuilder(_)=>const TextStyle(); |
|
|
|
|
Widget _defaultEmbedBuilder( |
|
|
|
|
BuildContext context, leaf.Embed node, bool readOnly) { |
|
|
|
|
assert(!kIsWeb, 'Please provide EmbedBuilder for Web'); |
|
|
|
@ -225,33 +225,35 @@ Widget _defaultEmbedBuilder( |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class QuillEditor extends StatefulWidget { |
|
|
|
|
const QuillEditor( |
|
|
|
|
{required this.controller, |
|
|
|
|
required this.focusNode, |
|
|
|
|
required this.scrollController, |
|
|
|
|
required this.scrollable, |
|
|
|
|
required this.padding, |
|
|
|
|
required this.autoFocus, |
|
|
|
|
required this.readOnly, |
|
|
|
|
required this.expands, |
|
|
|
|
this.showCursor, |
|
|
|
|
this.paintCursorAboveText, |
|
|
|
|
this.placeholder, |
|
|
|
|
this.enableInteractiveSelection = true, |
|
|
|
|
this.scrollBottomInset = 0, |
|
|
|
|
this.minHeight, |
|
|
|
|
this.maxHeight, |
|
|
|
|
this.customStyles, |
|
|
|
|
this.textCapitalization = TextCapitalization.sentences, |
|
|
|
|
this.keyboardAppearance = Brightness.light, |
|
|
|
|
this.scrollPhysics, |
|
|
|
|
this.onLaunchUrl, |
|
|
|
|
this.onTapDown, |
|
|
|
|
this.onTapUp, |
|
|
|
|
this.onSingleLongTapStart, |
|
|
|
|
this.onSingleLongTapMoveUpdate, |
|
|
|
|
this.onSingleLongTapEnd, |
|
|
|
|
this.embedBuilder = _defaultEmbedBuilder}); |
|
|
|
|
const QuillEditor({ |
|
|
|
|
required this.controller, |
|
|
|
|
required this.focusNode, |
|
|
|
|
required this.scrollController, |
|
|
|
|
required this.scrollable, |
|
|
|
|
required this.padding, |
|
|
|
|
required this.autoFocus, |
|
|
|
|
required this.readOnly, |
|
|
|
|
required this.expands, |
|
|
|
|
this.showCursor, |
|
|
|
|
this.paintCursorAboveText, |
|
|
|
|
this.placeholder, |
|
|
|
|
this.enableInteractiveSelection = true, |
|
|
|
|
this.scrollBottomInset = 0, |
|
|
|
|
this.minHeight, |
|
|
|
|
this.maxHeight, |
|
|
|
|
this.customStyles, |
|
|
|
|
this.textCapitalization = TextCapitalization.sentences, |
|
|
|
|
this.keyboardAppearance = Brightness.light, |
|
|
|
|
this.scrollPhysics, |
|
|
|
|
this.onLaunchUrl, |
|
|
|
|
this.onTapDown, |
|
|
|
|
this.onTapUp, |
|
|
|
|
this.onSingleLongTapStart, |
|
|
|
|
this.onSingleLongTapMoveUpdate, |
|
|
|
|
this.onSingleLongTapEnd, |
|
|
|
|
this.embedBuilder = _defaultEmbedBuilder, |
|
|
|
|
this.styleBuilder = _defaultStyleBuilder, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
factory QuillEditor.basic({ |
|
|
|
|
required QuillController controller, |
|
|
|
@ -310,6 +312,7 @@ class QuillEditor extends StatefulWidget { |
|
|
|
|
onSingleLongTapEnd; |
|
|
|
|
|
|
|
|
|
final EmbedBuilder embedBuilder; |
|
|
|
|
final StyleBuilder styleBuilder; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
_QuillEditorState createState() => _QuillEditorState(); |
|
|
|
@ -413,7 +416,9 @@ class _QuillEditorState extends State<QuillEditor> |
|
|
|
|
widget.keyboardAppearance, |
|
|
|
|
widget.enableInteractiveSelection, |
|
|
|
|
widget.scrollPhysics, |
|
|
|
|
widget.embedBuilder), |
|
|
|
|
widget.embedBuilder, |
|
|
|
|
widget.styleBuilder, |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|