Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: required named parameter 'onLiveTextInput' must be provided #488

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.4.1
* fix: build error on Flutter 3.13 by @LucasXu0 in ([#488](https://github.com/AppFlowy-IO/appflowy-editor/pull/488))

## 1.4.0
* feat: adjust the loading large document optimization in mobile platform by @LucasXu0 in ([#474](https://github.com/AppFlowy-IO/appflowy-editor/pull/474))
* feat: simplify auto scroll behavior in ScrollServiceWidget by @LucasXu0 in ([#437](https://github.com/AppFlowy-IO/appflowy-editor/pull/437))
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/desktop_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class _DesktopEditorState extends State<DesktopEditor> {
);
// customize the padding
map.forEach((key, value) {
value.configuration = BlockComponentConfiguration(
value.configuration = value.configuration.copyWith(
padding: (_) => const EdgeInsets.symmetric(vertical: 8.0),
);
});
Expand Down
17 changes: 17 additions & 0 deletions example/lib/pages/mobile_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ class _MobileEditorState extends State<MobileEditor> {
child: MobileFloatingToolbar(
editorState: editorState,
editorScrollController: editorScrollController,
toolbarBuilder: (context, anchor) {
return AdaptiveTextSelectionToolbar.editable(
clipboardStatus: ClipboardStatus.pasteable,
onCopy: () => copyCommand.execute(editorState),
onCut: () => cutCommand.execute(editorState),
onPaste: () => pasteCommand.execute(editorState),
onSelectAll: () => selectAllCommand.execute(editorState),
anchors: TextSelectionToolbarAnchors(
primaryAnchor: anchor,
),
);
},
child: AppFlowyEditor(
editorStyle: editorStyle,
editorState: editorState,
Expand Down Expand Up @@ -128,6 +140,11 @@ class _MobileEditorState extends State<MobileEditor> {
fontWeight: FontWeight.w600,
),
);
map[ParagraphBlockKeys.type] = TextBlockComponentBuilder(
configuration: BlockComponentConfiguration(
placeholderText: (node) => 'Type something...',
),
);
return map;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
required this.editorState,
required this.editorScrollController,
required this.child,
required this.toolbarBuilder,
});

final EditorState editorState;
final EditorScrollController editorScrollController;
final Widget child;
final Widget Function(BuildContext context, Offset anchor) toolbarBuilder;

@override
State<MobileFloatingToolbar> createState() => _MobileFloatingToolbarState();
Expand Down Expand Up @@ -149,18 +151,9 @@

Widget _buildToolbar(
BuildContext context,
Offset? offset,
Offset offset,
) {
return AdaptiveTextSelectionToolbar.editable(
clipboardStatus: ClipboardStatus.pasteable,
onCopy: () => copyCommand.execute(editorState),
onCut: () => cutCommand.execute(editorState),
onPaste: () => pasteCommand.execute(editorState),
onSelectAll: () => selectAllCommand.execute(editorState),
anchors: TextSelectionToolbarAnchors(
primaryAnchor: offset ?? Offset.zero,
),
);
return widget.toolbarBuilder(context, offset);

Check warning on line 156 in lib/src/editor/toolbar/mobile/mobile_floating_toolbar/mobile_floating_toolbar.dart

View check run for this annotation

Codecov / codecov/patch

lib/src/editor/toolbar/mobile/mobile_floating_toolbar/mobile_floating_toolbar.dart#L156

Added line #L156 was not covered by tests
}

Rect _findSuitableRect(Iterable<Rect> rects) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: appflowy_editor
description: A highly customizable rich-text editor for Flutter. The AppFlowy Editor project for AppFlowy and beyond.
version: 1.4.0
version: 1.4.1
homepage: https://github.com/AppFlowy-IO/appflowy-editor

platforms:
Expand Down