forked from AppFlowy-IO/appflowy-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: keep keyboard appearance as same brightness as system theme (App…
- Loading branch information
Showing
7 changed files
with
85 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
lib/src/editor/editor_component/service/ime/text_input_service.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
|
||
abstract class TextInputService { | ||
TextInputService({ | ||
required this.onInsert, | ||
required this.onDelete, | ||
required this.onReplace, | ||
required this.onNonTextUpdate, | ||
required this.onPerformAction, | ||
}); | ||
|
||
Future<void> Function(TextEditingDeltaInsertion insertion) onInsert; | ||
Future<void> Function(TextEditingDeltaDeletion deletion) onDelete; | ||
Future<void> Function(TextEditingDeltaReplacement replacement) onReplace; | ||
Future<void> Function(TextEditingDeltaNonTextUpdate nonTextUpdate) | ||
onNonTextUpdate; | ||
Future<void> Function(TextInputAction action) onPerformAction; | ||
|
||
TextRange? get composingTextRange; | ||
bool get attached; | ||
|
||
void updateCaretPosition(Size size, Matrix4 transform, Rect rect); | ||
|
||
/// Updates the [TextEditingValue] of the text currently being edited. | ||
/// | ||
/// Note that if there are IME-related requirements, | ||
/// please config `composing` value within [TextEditingValue] | ||
/// | ||
/// [BuildContext] is used to get current keyboard appearance(light or dark) | ||
void attach( | ||
TextEditingValue textEditingValue, | ||
TextInputConfiguration configuration, | ||
); | ||
|
||
/// Applies insertion, deletion and replacement | ||
/// to the text currently being edited. | ||
/// | ||
/// For more information, please check [TextEditingDelta]. | ||
Future<void> apply(List<TextEditingDelta> deltas); | ||
|
||
/// Closes the editing state of the text currently being edited. | ||
void close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters