@@ -192,21 +192,23 @@ class QuillEditorState extends State<QuillEditor>
192
192
193
193
QuillController get controller => widget.controller;
194
194
195
+ @Deprecated ('Use config instead' )
195
196
QuillEditorConfig get configurations => widget.config;
197
+ QuillEditorConfig get config => widget.config;
196
198
197
199
@override
198
200
void initState () {
199
201
super .initState ();
200
- _editorKey = configurations .editorKey ?? GlobalKey <EditorState >();
202
+ _editorKey = config .editorKey ?? GlobalKey <EditorState >();
201
203
_selectionGestureDetectorBuilder =
202
204
_QuillEditorSelectionGestureDetectorBuilder (
203
205
this ,
204
- configurations .detectWordBoundary,
206
+ config .detectWordBoundary,
205
207
);
206
208
207
209
final focusNode = widget.focusNode;
208
210
209
- if (configurations .autoFocus) {
211
+ if (config .autoFocus) {
210
212
focusNode.requestFocus ();
211
213
}
212
214
@@ -222,7 +224,7 @@ class QuillEditorState extends State<QuillEditor>
222
224
Widget build (BuildContext context) {
223
225
final theme = Theme .of (context);
224
226
final selectionTheme =
225
- configurations .textSelectionThemeData ?? TextSelectionTheme .of (context);
227
+ config .textSelectionThemeData ?? TextSelectionTheme .of (context);
226
228
227
229
TextSelectionControls textSelectionControls;
228
230
bool paintCursorAboveText;
@@ -252,8 +254,8 @@ class QuillEditorState extends State<QuillEditor>
252
254
theme.colorScheme.primary.withValues (alpha: 0.40 );
253
255
}
254
256
255
- final showSelectionToolbar = configurations.enableInteractiveSelection &&
256
- configurations .enableSelectionToolbar;
257
+ final showSelectionToolbar =
258
+ config.enableInteractiveSelection && config .enableSelectionToolbar;
257
259
258
260
final child = QuillRawEditor (
259
261
key: _editorKey,
@@ -265,71 +267,68 @@ class QuillEditorState extends State<QuillEditor>
265
267
customLeadingBuilder: widget.config.customLeadingBlockBuilder,
266
268
focusNode: widget.focusNode,
267
269
scrollController: widget.scrollController,
268
- scrollable: configurations .scrollable,
269
- enableAlwaysIndentOnTab: configurations .enableAlwaysIndentOnTab,
270
- scrollBottomInset: configurations .scrollBottomInset,
271
- padding: configurations .padding,
270
+ scrollable: config .scrollable,
271
+ enableAlwaysIndentOnTab: config .enableAlwaysIndentOnTab,
272
+ scrollBottomInset: config .scrollBottomInset,
273
+ padding: config .padding,
272
274
readOnly: controller.readOnly,
273
- checkBoxReadOnly: configurations .checkBoxReadOnly,
274
- disableClipboard: configurations .disableClipboard,
275
- placeholder: configurations .placeholder,
276
- onLaunchUrl: configurations .onLaunchUrl,
275
+ checkBoxReadOnly: config .checkBoxReadOnly,
276
+ disableClipboard: config .disableClipboard,
277
+ placeholder: config .placeholder,
278
+ onLaunchUrl: config .onLaunchUrl,
277
279
contextMenuBuilder: showSelectionToolbar
278
- ? (configurations .contextMenuBuilder ??
280
+ ? (config .contextMenuBuilder ??
279
281
QuillRawEditorConfig .defaultContextMenuBuilder)
280
282
: null ,
281
283
showSelectionHandles: isMobile,
282
- showCursor: configurations .showCursor ?? true ,
284
+ showCursor: config .showCursor ?? true ,
283
285
cursorStyle: CursorStyle (
284
286
color: cursorColor,
285
287
backgroundColor: Colors .grey,
286
288
width: 2 ,
287
289
radius: cursorRadius,
288
290
offset: cursorOffset,
289
- paintAboveText:
290
- configurations.paintCursorAboveText ?? paintCursorAboveText,
291
+ paintAboveText: config.paintCursorAboveText ?? paintCursorAboveText,
291
292
opacityAnimates: cursorOpacityAnimates,
292
293
),
293
- textCapitalization: configurations .textCapitalization,
294
- minHeight: configurations .minHeight,
295
- maxHeight: configurations .maxHeight,
296
- maxContentWidth: configurations .maxContentWidth,
297
- customStyles: configurations .customStyles,
298
- expands: configurations .expands,
299
- autoFocus: configurations .autoFocus,
294
+ textCapitalization: config .textCapitalization,
295
+ minHeight: config .minHeight,
296
+ maxHeight: config .maxHeight,
297
+ maxContentWidth: config .maxContentWidth,
298
+ customStyles: config .customStyles,
299
+ expands: config .expands,
300
+ autoFocus: config .autoFocus,
300
301
selectionColor: selectionColor,
301
- selectionCtrls:
302
- configurations.textSelectionControls ?? textSelectionControls,
303
- keyboardAppearance: configurations.keyboardAppearance,
304
- enableInteractiveSelection: configurations.enableInteractiveSelection,
305
- scrollPhysics: configurations.scrollPhysics,
302
+ selectionCtrls: config.textSelectionControls ?? textSelectionControls,
303
+ keyboardAppearance: config.keyboardAppearance,
304
+ enableInteractiveSelection: config.enableInteractiveSelection,
305
+ scrollPhysics: config.scrollPhysics,
306
306
embedBuilder: _getEmbedBuilder,
307
- textSpanBuilder: configurations.textSpanBuilder,
308
- linkActionPickerDelegate: configurations.linkActionPickerDelegate,
309
- customStyleBuilder: configurations.customStyleBuilder,
310
- customRecognizerBuilder: configurations.customRecognizerBuilder,
311
- floatingCursorDisabled: configurations.floatingCursorDisabled,
312
- customShortcuts: configurations.customShortcuts,
313
- customActions: configurations.customActions,
314
- customLinkPrefixes: configurations.customLinkPrefixes,
315
- onTapOutsideEnabled: configurations.onTapOutsideEnabled,
316
- onTapOutside: configurations.onTapOutside,
317
- dialogTheme: configurations.dialogTheme,
318
- contentInsertionConfiguration:
319
- configurations.contentInsertionConfiguration,
320
- enableScribble: configurations.enableScribble,
321
- onScribbleActivated: configurations.onScribbleActivated,
322
- scribbleAreaInsets: configurations.scribbleAreaInsets,
323
- readOnlyMouseCursor: configurations.readOnlyMouseCursor,
324
- textInputAction: configurations.textInputAction,
325
- onPerformAction: configurations.onPerformAction,
307
+ textSpanBuilder: config.textSpanBuilder,
308
+ linkActionPickerDelegate: config.linkActionPickerDelegate,
309
+ customStyleBuilder: config.customStyleBuilder,
310
+ customRecognizerBuilder: config.customRecognizerBuilder,
311
+ floatingCursorDisabled: config.floatingCursorDisabled,
312
+ customShortcuts: config.customShortcuts,
313
+ customActions: config.customActions,
314
+ customLinkPrefixes: config.customLinkPrefixes,
315
+ onTapOutsideEnabled: config.onTapOutsideEnabled,
316
+ onTapOutside: config.onTapOutside,
317
+ dialogTheme: config.dialogTheme,
318
+ contentInsertionConfiguration: config.contentInsertionConfiguration,
319
+ enableScribble: config.enableScribble,
320
+ onScribbleActivated: config.onScribbleActivated,
321
+ scribbleAreaInsets: config.scribbleAreaInsets,
322
+ readOnlyMouseCursor: config.readOnlyMouseCursor,
323
+ textInputAction: config.textInputAction,
324
+ onPerformAction: config.onPerformAction,
326
325
),
327
326
);
328
327
329
328
final editor = selectionEnabled
330
329
? _selectionGestureDetectorBuilder.build (
331
330
behavior: HitTestBehavior .translucent,
332
- detectWordBoundary: configurations .detectWordBoundary,
331
+ detectWordBoundary: config .detectWordBoundary,
333
332
child: child,
334
333
)
335
334
: child;
@@ -352,7 +351,7 @@ class QuillEditorState extends State<QuillEditor>
352
351
}
353
352
354
353
EmbedBuilder _getEmbedBuilder (Embed node) {
355
- final builders = configurations .embedBuilders;
354
+ final builders = config .embedBuilders;
356
355
357
356
if (builders != null ) {
358
357
for (final builder in builders) {
@@ -362,7 +361,7 @@ class QuillEditorState extends State<QuillEditor>
362
361
}
363
362
}
364
363
365
- final unknownEmbedBuilder = configurations .unknownEmbedBuilder;
364
+ final unknownEmbedBuilder = config .unknownEmbedBuilder;
366
365
if (unknownEmbedBuilder != null ) {
367
366
return unknownEmbedBuilder;
368
367
}
@@ -382,7 +381,7 @@ class QuillEditorState extends State<QuillEditor>
382
381
bool get forcePressEnabled => false ;
383
382
384
383
@override
385
- bool get selectionEnabled => configurations .enableInteractiveSelection;
384
+ bool get selectionEnabled => config .enableInteractiveSelection;
386
385
387
386
/// Throws [StateError] if [_editorKey] is not connected to [QuillRawEditor] correctly.
388
387
///
@@ -423,9 +422,9 @@ class _QuillEditorSelectionGestureDetectorBuilder
423
422
424
423
@override
425
424
void onSingleLongTapMoveUpdate (LongPressMoveUpdateDetails details) {
426
- if (_state.configurations .onSingleLongTapMoveUpdate != null ) {
425
+ if (_state.config .onSingleLongTapMoveUpdate != null ) {
427
426
if (renderEditor != null &&
428
- _state.configurations .onSingleLongTapMoveUpdate !(
427
+ _state.config .onSingleLongTapMoveUpdate !(
429
428
details,
430
429
renderEditor! .getPositionForOffset,
431
430
)) {
@@ -474,9 +473,9 @@ class _QuillEditorSelectionGestureDetectorBuilder
474
473
475
474
@override
476
475
void onTapDown (TapDownDetails details) {
477
- if (_state.configurations .onTapDown != null ) {
476
+ if (_state.config .onTapDown != null ) {
478
477
if (renderEditor != null &&
479
- _state.configurations .onTapDown !(
478
+ _state.config .onTapDown !(
480
479
details,
481
480
renderEditor! .getPositionForOffset,
482
481
)) {
@@ -495,9 +494,9 @@ class _QuillEditorSelectionGestureDetectorBuilder
495
494
496
495
@override
497
496
void onSingleTapUp (TapUpDetails details) {
498
- if (_state.configurations .onTapUp != null &&
497
+ if (_state.config .onTapUp != null &&
499
498
renderEditor != null &&
500
- _state.configurations .onTapUp !(
499
+ _state.config .onTapUp !(
501
500
details,
502
501
renderEditor! .getPositionForOffset,
503
502
)) {
@@ -583,9 +582,9 @@ class _QuillEditorSelectionGestureDetectorBuilder
583
582
584
583
@override
585
584
void onSingleLongTapStart (LongPressStartDetails details) {
586
- if (_state.configurations .onSingleLongTapStart != null ) {
585
+ if (_state.config .onSingleLongTapStart != null ) {
587
586
if (renderEditor != null &&
588
- _state.configurations .onSingleLongTapStart !(
587
+ _state.config .onSingleLongTapStart !(
589
588
details,
590
589
renderEditor! .getPositionForOffset,
591
590
)) {
@@ -608,9 +607,9 @@ class _QuillEditorSelectionGestureDetectorBuilder
608
607
609
608
@override
610
609
void onSingleLongTapEnd (LongPressEndDetails details) {
611
- if (_state.configurations .onSingleLongTapEnd != null ) {
610
+ if (_state.config .onSingleLongTapEnd != null ) {
612
611
if (renderEditor != null ) {
613
- if (_state.configurations .onSingleLongTapEnd !(
612
+ if (_state.config .onSingleLongTapEnd !(
614
613
details,
615
614
renderEditor! .getPositionForOffset,
616
615
)) {
0 commit comments