TF-1033: apply auto scroll to identity , composer , vacation screen
This commit is contained in:
@@ -66,6 +66,7 @@ class IdentityCreatorController extends BaseController {
|
||||
String? _contentHtmlEditor;
|
||||
|
||||
final ScrollController scrollController = ScrollController();
|
||||
double currentPositionYHTMLEditor = 250;
|
||||
|
||||
void updateNameIdentity(BuildContext context, String? value) {
|
||||
_nameIdentity = value;
|
||||
@@ -403,4 +404,20 @@ class IdentityCreatorController extends BaseController {
|
||||
popBack();
|
||||
}
|
||||
}
|
||||
|
||||
void onFocusHTMLEditor() {
|
||||
scrollController.animateTo(
|
||||
currentPositionYHTMLEditor,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.linear,
|
||||
);
|
||||
}
|
||||
|
||||
void onEnterKeyDown() {
|
||||
scrollController.animateTo(
|
||||
currentPositionYHTMLEditor - keyboardRichTextController.currentLine * 20,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.linear,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -510,12 +510,13 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController> {
|
||||
);
|
||||
} else {
|
||||
return html_editor_mobile.HtmlEditor(
|
||||
key: const Key('signature_html_editor_mobile'),
|
||||
key:const Key('html_editor_mobile'),
|
||||
minHeight: 230,
|
||||
onCreated: (htmlEditorController) {
|
||||
controller.keyboardRichTextController.onCreateHTMLEditor(
|
||||
htmlEditorController,
|
||||
scrollController:controller.scrollController,
|
||||
onFocus: controller.onFocusHTMLEditor,
|
||||
onEnterKeyDown: controller.onEnterKeyDown,
|
||||
);
|
||||
controller.signatureHtmlEditorMobileController = htmlEditorController;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user