@@ -145,7 +145,7 @@ String _standardizeImageUrl(String url) {
145
145
146
146
bool _isMobile () => io.Platform .isAndroid || io.Platform .isIOS;
147
147
148
- Widget _defaultEmbedBuilder (
148
+ Widget defaultEmbedBuilder (
149
149
BuildContext context, leaf.Embed node, bool readOnly) {
150
150
assert (! kIsWeb, 'Please provide EmbedBuilder for Web' );
151
151
switch (node.value.type) {
@@ -251,7 +251,7 @@ class QuillEditor extends StatefulWidget {
251
251
this .onSingleLongTapStart,
252
252
this .onSingleLongTapMoveUpdate,
253
253
this .onSingleLongTapEnd,
254
- this .embedBuilder = _defaultEmbedBuilder ,
254
+ this .embedBuilder = defaultEmbedBuilder ,
255
255
this .customStyleBuilder,
256
256
Key ? key});
257
257
@@ -377,51 +377,53 @@ class _QuillEditorState extends State<QuillEditor>
377
377
throw UnimplementedError ();
378
378
}
379
379
380
+ final child = RawEditor (
381
+ key: _editorKey,
382
+ controller: widget.controller,
383
+ focusNode: widget.focusNode,
384
+ scrollController: widget.scrollController,
385
+ scrollable: widget.scrollable,
386
+ scrollBottomInset: widget.scrollBottomInset,
387
+ padding: widget.padding,
388
+ readOnly: widget.readOnly,
389
+ placeholder: widget.placeholder,
390
+ onLaunchUrl: widget.onLaunchUrl,
391
+ toolbarOptions: ToolbarOptions (
392
+ copy: widget.enableInteractiveSelection,
393
+ cut: widget.enableInteractiveSelection,
394
+ paste: widget.enableInteractiveSelection,
395
+ selectAll: widget.enableInteractiveSelection,
396
+ ),
397
+ showSelectionHandles: theme.platform == TargetPlatform .iOS ||
398
+ theme.platform == TargetPlatform .android,
399
+ showCursor: widget.showCursor,
400
+ cursorStyle: CursorStyle (
401
+ color: cursorColor,
402
+ backgroundColor: Colors .grey,
403
+ width: 2 ,
404
+ radius: cursorRadius,
405
+ offset: cursorOffset,
406
+ paintAboveText: widget.paintCursorAboveText ?? paintCursorAboveText,
407
+ opacityAnimates: cursorOpacityAnimates,
408
+ ),
409
+ textCapitalization: widget.textCapitalization,
410
+ minHeight: widget.minHeight,
411
+ maxHeight: widget.maxHeight,
412
+ customStyles: widget.customStyles,
413
+ expands: widget.expands,
414
+ autoFocus: widget.autoFocus,
415
+ selectionColor: selectionColor,
416
+ selectionCtrls: textSelectionControls,
417
+ keyboardAppearance: widget.keyboardAppearance,
418
+ enableInteractiveSelection: widget.enableInteractiveSelection,
419
+ scrollPhysics: widget.scrollPhysics,
420
+ embedBuilder: widget.embedBuilder,
421
+ customStyleBuilder: widget.customStyleBuilder,
422
+ );
423
+
380
424
return _selectionGestureDetectorBuilder.build (
381
425
HitTestBehavior .translucent,
382
- RawEditor (
383
- _editorKey,
384
- widget.controller,
385
- widget.focusNode,
386
- widget.scrollController,
387
- widget.scrollable,
388
- widget.scrollBottomInset,
389
- widget.padding,
390
- widget.readOnly,
391
- widget.placeholder,
392
- widget.onLaunchUrl,
393
- ToolbarOptions (
394
- copy: widget.enableInteractiveSelection,
395
- cut: widget.enableInteractiveSelection,
396
- paste: widget.enableInteractiveSelection,
397
- selectAll: widget.enableInteractiveSelection,
398
- ),
399
- theme.platform == TargetPlatform .iOS ||
400
- theme.platform == TargetPlatform .android,
401
- widget.showCursor,
402
- CursorStyle (
403
- color: cursorColor,
404
- backgroundColor: Colors .grey,
405
- width: 2 ,
406
- radius: cursorRadius,
407
- offset: cursorOffset,
408
- paintAboveText: widget.paintCursorAboveText ?? paintCursorAboveText,
409
- opacityAnimates: cursorOpacityAnimates,
410
- ),
411
- widget.textCapitalization,
412
- widget.maxHeight,
413
- widget.minHeight,
414
- widget.customStyles,
415
- widget.expands,
416
- widget.autoFocus,
417
- selectionColor,
418
- textSelectionControls,
419
- widget.keyboardAppearance,
420
- widget.enableInteractiveSelection,
421
- widget.scrollPhysics,
422
- widget.embedBuilder,
423
- widget.customStyleBuilder,
424
- ),
426
+ child,
425
427
);
426
428
}
427
429
0 commit comments