Skip to content

Commit 748b631

Browse files
Removed document and composer from SuperEditor widget property list (Resolves #2160) (#2163)
1 parent a5f48a8 commit 748b631

File tree

45 files changed

+100
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+100
-182
lines changed

super_editor/clones/quill/lib/editor/editor.dart

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,6 @@ class FeatherEditor extends StatefulWidget {
2828
class _FeatherEditorState extends State<FeatherEditor> {
2929
final _editorFocusNode = FocusNode();
3030

31-
late MutableDocument _document;
32-
late MutableDocumentComposer _composer;
33-
34-
@override
35-
void initState() {
36-
super.initState();
37-
38-
_document = widget.editor.context.find<MutableDocument>(Editor.documentKey);
39-
_composer = widget.editor.context.find<MutableDocumentComposer>(Editor.composerKey);
40-
}
41-
42-
@override
43-
void didUpdateWidget(FeatherEditor oldWidget) {
44-
super.didUpdateWidget(oldWidget);
45-
46-
if (widget.editor != oldWidget.editor) {
47-
_document = widget.editor.context.find<MutableDocument>(Editor.documentKey);
48-
_composer = widget.editor.context.find<MutableDocumentComposer>(Editor.composerKey);
49-
}
50-
}
51-
5231
@override
5332
void dispose() {
5433
_editorFocusNode.dispose();
@@ -90,8 +69,6 @@ class _FeatherEditorState extends State<FeatherEditor> {
9069
child: SuperEditor(
9170
focusNode: _editorFocusNode,
9271
editor: widget.editor,
93-
document: _document,
94-
composer: _composer,
9572
stylesheet: featherStylesheet,
9673
componentBuilders: const [
9774
FeatherBlockquoteComponentBuilder(),

super_editor/example/lib/demos/components/demo_text_with_hint.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ class _TextWithHintDemoState extends State<TextWithHintDemo> {
7171
Widget build(BuildContext context) {
7272
return SuperEditor(
7373
editor: _docEditor,
74-
document: _doc,
75-
composer: _composer,
7674
stylesheet: Stylesheet(
7775
documentPadding: const EdgeInsets.symmetric(vertical: 56, horizontal: 24),
7876
rules: defaultStylesheet.rules,

super_editor/example/lib/demos/components/demo_unselectable_hr.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class _UnselectableHrDemoState extends State<UnselectableHrDemo> {
5252
Widget build(BuildContext context) {
5353
return SuperEditor(
5454
editor: _docEditor,
55-
document: _doc,
56-
composer: _composer,
5755
stylesheet: defaultStylesheet.copyWith(
5856
documentPadding: const EdgeInsets.symmetric(vertical: 56, horizontal: 24),
5957
),

super_editor/example/lib/demos/demo_animated_task_height.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class _AnimatedTaskHeightDemoState extends State<AnimatedTaskHeightDemo> {
5252
print("Building the entire demo");
5353
return SuperEditor(
5454
editor: _docEditor,
55-
document: _doc,
56-
composer: _composer,
5755
stylesheet: defaultStylesheet.copyWith(
5856
documentPadding: const EdgeInsets.symmetric(vertical: 56, horizontal: 24),
5957
),

super_editor/example/lib/demos/demo_app_shortcuts.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ class _AppShortcutsDemoState extends State<AppShortcutsDemo> {
5252
child: Column(
5353
children: [
5454
Expanded(
55-
child: SuperEditor(
56-
editor: _editor,
57-
document: _doc,
58-
composer: _composer,
59-
),
55+
child: SuperEditor(editor: _editor),
6056
),
6157
const TextField(
6258
decoration: InputDecoration(

super_editor/example/lib/demos/demo_document_loses_focus.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class _LoseFocusDemoState extends State<LoseFocusDemo> {
4141
),
4242
child: SuperEditor(
4343
editor: _docEditor,
44-
document: _doc,
45-
composer: _composer,
4644
inputSource: TextInputSource.ime,
4745
stylesheet: defaultStylesheet.copyWith(
4846
documentPadding: const EdgeInsets.symmetric(vertical: 56, horizontal: 24),

super_editor/example/lib/demos/demo_empty_document.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class _EmptyDocumentDemoState extends State<EmptyDocumentDemo> {
3737
return SafeArea(
3838
child: SuperEditor(
3939
editor: _docEditor,
40-
document: _doc,
41-
composer: _composer,
4240
gestureMode: DocumentGestureMode.mouse,
4341
),
4442
);

super_editor/example/lib/demos/demo_markdown_serialization.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ class _MarkdownSerializationDemoState extends State<MarkdownSerializationDemo> {
6666
child: SuperEditor(
6767
key: _docKey,
6868
editor: _docEditor,
69-
document: _doc,
70-
composer: _composer,
7169
componentBuilders: [
7270
TaskComponentBuilder(_docEditor),
7371
...defaultComponentBuilders,

super_editor/example/lib/demos/demo_paragraphs.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class _ParagraphsDemoState extends State<ParagraphsDemo> {
3030
Widget build(BuildContext context) {
3131
return SuperEditor(
3232
editor: _docEditor,
33-
document: _doc,
34-
composer: _composer,
3533
stylesheet: defaultStylesheet.copyWith(
3634
documentPadding: const EdgeInsets.symmetric(vertical: 56, horizontal: 24),
3735
),

super_editor/example/lib/demos/demo_rtl.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class _RTLDemoState extends State<RTLDemo> {
3333
Widget build(BuildContext context) {
3434
return SuperEditor(
3535
editor: _docEditor,
36-
document: _doc,
37-
composer: _composer,
3836
stylesheet: defaultStylesheet.copyWith(
3937
documentPadding: const EdgeInsets.symmetric(vertical: 56, horizontal: 24),
4038
),

0 commit comments

Comments
 (0)