feat(fleather): add iPad Scribble support - #586
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #586 +/- ##
==========================================
+ Coverage 88.11% 88.23% +0.12%
==========================================
Files 63 63
Lines 10899 11156 +257
==========================================
+ Hits 9604 9844 +240
- Misses 1295 1312 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| void _updateUndoState() { | ||
| if (defaultTargetPlatform == TargetPlatform.iOS && |
There was a problem hiding this comment.
I believe we should skip the check for iOS platform here. If we are the client, we should update the state anyway.
| class _FleatherHistoryState extends State<FleatherHistory> { | ||
| class _FleatherHistoryState extends State<FleatherHistory> | ||
| with UndoManagerClient { | ||
| Timer? _historyStateTimer; |
There was a problem hiding this comment.
I don't see a reason for introducing a timer and periodically updating the undo state as the undo state is retrieved from the controller and it would notify the listeners if the state changes. Am I missing something?
| final size = Size( | ||
| min(renderEditor.size.width, | ||
| renderEditor.maxContentWidth ?? double.infinity) - | ||
| renderEditor.padding.horizontal, |
There was a problem hiding this comment.
I think we should just use the renderEditor.size here and not take padding or content width into account as user should be able to write with stylus anywhere within the editor area. This is also what Flutter's EditableText does:
void _updateSizeAndTransform() {
final Size size = renderEditable.size;
final Matrix4 transform = renderEditable.getTransformTo(null);
_textInputConnection!.setEditableSizeAndTransform(size, transform);
}| @override | ||
| GlobalKey<EditorState> get editableTextKey => widget.editorKey ?? _editorKey!; | ||
|
|
||
| FocusNode get effectiveFocusNode => |
There was a problem hiding this comment.
I think it's better to make the focus node required and non-optional for the RawEditor now that we have lifted the internal focus node creation up. It's gonna be a breaking change but I don't think many would be affected. WDYT? @amantoux
Changes:
stylusHandwritingEnabledfromFleatherEditor,FleatherField, andRawEditor;ScribbleClientlifecycle for editable iOS editors;