|
|
|
@ -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, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
@ -374,46 +377,48 @@ class _QuillEditorState extends State<QuillEditor> |
|
|
|
|
return _selectionGestureDetectorBuilder.build( |
|
|
|
|
HitTestBehavior.translucent, |
|
|
|
|
RawEditor( |
|
|
|
|
_editorKey, |
|
|
|
|
widget.controller, |
|
|
|
|
widget.focusNode, |
|
|
|
|
widget.scrollController, |
|
|
|
|
widget.scrollable, |
|
|
|
|
widget.scrollBottomInset, |
|
|
|
|
widget.padding, |
|
|
|
|
widget.readOnly, |
|
|
|
|
widget.placeholder, |
|
|
|
|
widget.onLaunchUrl, |
|
|
|
|
ToolbarOptions( |
|
|
|
|
copy: widget.enableInteractiveSelection, |
|
|
|
|
cut: widget.enableInteractiveSelection, |
|
|
|
|
paste: widget.enableInteractiveSelection, |
|
|
|
|
selectAll: widget.enableInteractiveSelection, |
|
|
|
|
), |
|
|
|
|
theme.platform == TargetPlatform.iOS || |
|
|
|
|
theme.platform == TargetPlatform.android, |
|
|
|
|
widget.showCursor, |
|
|
|
|
CursorStyle( |
|
|
|
|
color: cursorColor, |
|
|
|
|
backgroundColor: Colors.grey, |
|
|
|
|
width: 2, |
|
|
|
|
radius: cursorRadius, |
|
|
|
|
offset: cursorOffset, |
|
|
|
|
paintAboveText: widget.paintCursorAboveText ?? paintCursorAboveText, |
|
|
|
|
opacityAnimates: cursorOpacityAnimates, |
|
|
|
|
), |
|
|
|
|
widget.textCapitalization, |
|
|
|
|
widget.maxHeight, |
|
|
|
|
widget.minHeight, |
|
|
|
|
widget.customStyles, |
|
|
|
|
widget.expands, |
|
|
|
|
widget.autoFocus, |
|
|
|
|
selectionColor, |
|
|
|
|
textSelectionControls, |
|
|
|
|
widget.keyboardAppearance, |
|
|
|
|
widget.enableInteractiveSelection, |
|
|
|
|
widget.scrollPhysics, |
|
|
|
|
widget.embedBuilder), |
|
|
|
|
_editorKey, |
|
|
|
|
widget.controller, |
|
|
|
|
widget.focusNode, |
|
|
|
|
widget.scrollController, |
|
|
|
|
widget.scrollable, |
|
|
|
|
widget.scrollBottomInset, |
|
|
|
|
widget.padding, |
|
|
|
|
widget.readOnly, |
|
|
|
|
widget.placeholder, |
|
|
|
|
widget.onLaunchUrl, |
|
|
|
|
ToolbarOptions( |
|
|
|
|
copy: widget.enableInteractiveSelection, |
|
|
|
|
cut: widget.enableInteractiveSelection, |
|
|
|
|
paste: widget.enableInteractiveSelection, |
|
|
|
|
selectAll: widget.enableInteractiveSelection, |
|
|
|
|
), |
|
|
|
|
theme.platform == TargetPlatform.iOS || |
|
|
|
|
theme.platform == TargetPlatform.android, |
|
|
|
|
widget.showCursor, |
|
|
|
|
CursorStyle( |
|
|
|
|
color: cursorColor, |
|
|
|
|
backgroundColor: Colors.grey, |
|
|
|
|
width: 2, |
|
|
|
|
radius: cursorRadius, |
|
|
|
|
offset: cursorOffset, |
|
|
|
|
paintAboveText: widget.paintCursorAboveText ?? paintCursorAboveText, |
|
|
|
|
opacityAnimates: cursorOpacityAnimates, |
|
|
|
|
), |
|
|
|
|
widget.textCapitalization, |
|
|
|
|
widget.maxHeight, |
|
|
|
|
widget.minHeight, |
|
|
|
|
widget.customStyles, |
|
|
|
|
widget.expands, |
|
|
|
|
widget.autoFocus, |
|
|
|
|
selectionColor, |
|
|
|
|
textSelectionControls, |
|
|
|
|
widget.keyboardAppearance, |
|
|
|
|
widget.enableInteractiveSelection, |
|
|
|
|
widget.scrollPhysics, |
|
|
|
|
widget.embedBuilder, |
|
|
|
|
widget.styleBuilder, |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|