@@ -124,7 +124,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
124
124
/// gives the end of the whole text.
125
125
///
126
126
/// Expressed as a collapsed `TextRange` at the index.
127
- TextRange _insertionIndex () {
127
+ TextRange insertionIndex () {
128
128
final TextRange selection = value.selection;
129
129
final String text = value.text;
130
130
return selection.isValid
@@ -139,13 +139,13 @@ class ComposeContentController extends ComposeController<ContentValidationError>
139
139
/// Assumes [newText] is not empty and consists entirely of complete lines
140
140
/// (each line ends with a newline).
141
141
///
142
- /// Inserts at [_insertionIndex ] . If that's zero, no empty line is added before.
142
+ /// Inserts at [insertionIndex ] . If that's zero, no empty line is added before.
143
143
///
144
144
/// If there is already an empty line before or after, does not add another.
145
145
void insertPadded (String newText) {
146
146
assert (newText.isNotEmpty);
147
147
assert (newText.endsWith ('\n ' ));
148
- final i = _insertionIndex ();
148
+ final i = insertionIndex ();
149
149
final textBefore = text.substring (0 , i.start);
150
150
final String paddingBefore;
151
151
if (textBefore.isEmpty || textBefore == '\n ' || textBefore.endsWith ('\n\n ' )) {
@@ -213,7 +213,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
213
213
final placeholder = inlineLink ('Uploading $filename ...' , null ); // TODO(i18n)
214
214
_uploads[tag] = (filename: filename, placeholder: placeholder);
215
215
notifyListeners (); // _uploads change could affect validationErrors
216
- value = value.replaced (_insertionIndex (), '$placeholder \n\n ' );
216
+ value = value.replaced (insertionIndex (), '$placeholder \n\n ' );
217
217
return tag;
218
218
}
219
219
@@ -228,7 +228,7 @@ class ComposeContentController extends ComposeController<ContentValidationError>
228
228
final int startIndex = text.indexOf (placeholder);
229
229
final replacementRange = startIndex >= 0
230
230
? TextRange (start: startIndex, end: startIndex + placeholder.length)
231
- : _insertionIndex ();
231
+ : insertionIndex ();
232
232
233
233
value = value.replaced (
234
234
replacementRange,
0 commit comments