Refactor code

pull/13/head
singerdmx 4 years ago
parent e8bd79a80e
commit d9d1f6762c
  1. 29
      lib/utils/diff_delta.dart
  2. 59
      lib/widgets/editor.dart

@ -2,6 +2,35 @@ import 'dart:math' as math;
import 'package:quill_delta/quill_delta.dart';
const Set<int> WHITE_SPACE = {
0x9,
0xA,
0xB,
0xC,
0xD,
0x1C,
0x1D,
0x1E,
0x1F,
0x20,
0xA0,
0x1680,
0x2000,
0x2001,
0x2002,
0x2003,
0x2004,
0x2005,
0x2006,
0x2007,
0x2008,
0x2009,
0x200A,
0x202F,
0x205F,
0x3000
};
// Diff between two texts - old text and new text
class Diff {
// Start index in old text at which changes begin.

@ -17,34 +17,21 @@ import 'cursor.dart';
import 'delegate.dart';
import 'keyboard_listener.dart';
const Set<int> WHITE_SPACE = {
0x9,
0xA,
0xB,
0xC,
0xD,
0x1C,
0x1D,
0x1E,
0x1F,
0x20,
0xA0,
0x1680,
0x2000,
0x2001,
0x2002,
0x2003,
0x2004,
0x2005,
0x2006,
0x2007,
0x2008,
0x2009,
0x200A,
0x202F,
0x205F,
0x3000
};
abstract class EditorState extends State<RawEditor> {
TextEditingValue getTextEditingValue();
void setTextEditingValue(TextEditingValue value);
RenderEditor getRenderEditor();
EditorTextSelectionOverlay getSelectionOverlay();
bool showToolbar();
void hideToolbar();
void requestKeyboard();
}
abstract class RenderAbstractEditor {
TextSelection selectWordAtPosition(TextPosition position);
@ -1150,19 +1137,3 @@ class RenderEditableContainerBox extends RenderBox
_resolvedPadding.top;
}
}
abstract class EditorState extends State<RawEditor> {
TextEditingValue getTextEditingValue();
void setTextEditingValue(TextEditingValue value);
RenderEditor getRenderEditor();
EditorTextSelectionOverlay getSelectionOverlay();
bool showToolbar();
void hideToolbar();
void requestKeyboard();
}

Loading…
Cancel
Save