@@ -6,6 +6,7 @@ import 'package:super_editor/src/core/edit_context.dart';
6
6
import 'package:super_editor/src/core/editor.dart' ;
7
7
import 'package:super_editor/src/core/styles.dart' ;
8
8
import 'package:super_editor/src/default_editor/attributions.dart' ;
9
+ import 'package:super_editor/src/default_editor/blocks/indentation.dart' ;
9
10
import 'package:super_editor/src/infrastructure/_logging.dart' ;
10
11
import 'package:super_editor/src/infrastructure/attributed_text_styles.dart' ;
11
12
import 'package:super_editor/src/infrastructure/keyboard.dart' ;
@@ -399,7 +400,7 @@ class UnorderedListItemComponent extends StatefulWidget {
399
400
this .dotBuilder = _defaultUnorderedListItemDotBuilder,
400
401
this .dotStyle,
401
402
this .indent = 0 ,
402
- this .indentCalculator = _defaultIndentCalculator ,
403
+ this .indentCalculator = defaultListItemIndentCalculator ,
403
404
this .textSelection,
404
405
this .selectionColor = Colors .lightBlueAccent,
405
406
this .showCaret = false ,
@@ -563,7 +564,7 @@ class OrderedListItemComponent extends StatefulWidget {
563
564
this .numeralBuilder = _defaultOrderedListItemNumeralBuilder,
564
565
this .numeralStyle = OrderedListNumeralStyle .arabic,
565
566
this .indent = 0 ,
566
- this .indentCalculator = _defaultIndentCalculator ,
567
+ this .indentCalculator = defaultListItemIndentCalculator ,
567
568
this .textSelection,
568
569
this .selectionColor = Colors .lightBlueAccent,
569
570
this .showCaret = false ,
@@ -581,7 +582,7 @@ class OrderedListItemComponent extends StatefulWidget {
581
582
final OrderedListItemNumeralBuilder numeralBuilder;
582
583
final OrderedListNumeralStyle numeralStyle;
583
584
final int indent;
584
- final double Function ( TextStyle , int indent) indentCalculator;
585
+ final TextBlockIndentCalculator indentCalculator;
585
586
final TextSelection ? textSelection;
586
587
final Color selectionColor;
587
588
final bool showCaret;
@@ -659,7 +660,8 @@ class _OrderedListItemComponentState extends State<OrderedListItemComponent> {
659
660
660
661
typedef OrderedListItemNumeralBuilder = Widget Function (BuildContext , OrderedListItemComponent );
661
662
662
- double _defaultIndentCalculator (TextStyle textStyle, int indent) {
663
+ /// The standard [TextBlockIndentCalculator] used by list items in `SuperEditor` .
664
+ double defaultListItemIndentCalculator (TextStyle textStyle, int indent) {
663
665
return (textStyle.fontSize! * 0.60 ) * 4 * (indent + 1 );
664
666
}
665
667
0 commit comments