INNER CODE UNIT · Dart
newValue
Im-Kevin/cool_ui · lib/keyboards/keyboard_controller.dart:39
newValue = newValue.copyWith( // 修正由于默认值导致的Bug
composing: TextRange(
start: newValue.composing.start < 0 ? 0: newValue.composing.start,
end: newValue.composing.end < 0 ? 0: newValue.composing.end
),
selection: newValue.selection.copyWith(
baseOffset: newValue.selection.baseOffset < 0 ? 0: newValue.selection.baseOffset,
extentOffset: newValue.selection.extentOffset < 0 ? 0: newValue.selection.extentOffset
)
);
super.value = newValue;
}
/// Set the [value] to empty.
///
/// After calling this function, [text] will be the empty string and the
/// selection will be invalid.