Closed cgzcgb closed 9 hours ago
This part has an unsafe operation.
/* Get diff operation between old text and new text */
Diff getDiff(String oldText, String newText, int cursorPosition) {
var end = oldText.length;
final delta = newText.length - end;
for (final limit = math.max(0, cursorPosition - delta);
end > limit && oldText[end - 1] == newText[end + delta - 1];
end--) {}
var start = 0;
for (final startLimit = cursorPosition - math.max(0, delta);
start < startLimit && oldText[start] == newText[start];
start++) {}
final deleted = (start >= end) ? '' : oldText.substring(start, end);
final inserted = newText.substring(start, end + delta);
return Diff(
start: start,
deleted: deleted,
inserted: inserted,
);
}
Yeah, also the performance is terrible
Yeah, also the performance is terrible
Same. Using the magnifier literally can crash a slower device. I'm trying to know where or how i can improve some of these parts.
Is there an existing issue for this?
Flutter Quill version
10.4.0
Steps to reproduce
1.
2.Click on QuillEditor Focus
3.Hold down the left mouse button and drag the mouse
Expected results
There shouldn't be any changes
Actual results
Code sample
Code sample
```dart [Paste your code here] ```Additional Context
Screenshots / Video demonstration
[Upload media here]Logs
```console [Paste your logs here] ```