TF-1544: Support can TAB another field in composer
(cherry picked from commit 38f24da4295f4e6231eb77af18b2181496ad78f8)
This commit is contained in:
@@ -12,6 +12,7 @@ import 'package:filesize/filesize.dart';
|
||||
import 'package:fk_user_agent/fk_user_agent.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
@@ -346,7 +347,15 @@ class ComposerController extends BaseController {
|
||||
|
||||
void createFocusNodeInput() {
|
||||
toAddressFocusNode = FocusNode();
|
||||
subjectEmailInputFocusNode = FocusNode();
|
||||
subjectEmailInputFocusNode = FocusNode(
|
||||
onKey: (focus, event) {
|
||||
if (event is RawKeyDownEvent && event.logicalKey == LogicalKeyboardKey.tab) {
|
||||
richTextWebController.editorController.setFocus();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
);
|
||||
ccAddressFocusNode = FocusNode();
|
||||
bccAddressFocusNode = FocusNode();
|
||||
|
||||
@@ -1198,9 +1207,11 @@ class ComposerController extends BaseController {
|
||||
updateListEmailAddress(prefixEmailAddress, <EmailAddress>[]);
|
||||
switch(prefixEmailAddress) {
|
||||
case PrefixEmailAddress.cc:
|
||||
ccAddressFocusNode = FocusNode();
|
||||
ccEmailAddressController.clear();
|
||||
break;
|
||||
case PrefixEmailAddress.bcc:
|
||||
bccAddressFocusNode = FocusNode();
|
||||
bccEmailAddressController.clear();
|
||||
break;
|
||||
default:
|
||||
@@ -1632,4 +1643,26 @@ class ComposerController extends BaseController {
|
||||
Navigator.maybePop(context);
|
||||
onEditorFocusChange(true);
|
||||
}
|
||||
|
||||
FocusNode? getNextFocusOfToEmailAddress() {
|
||||
if (listEmailAddressType.contains(PrefixEmailAddress.cc) == true) {
|
||||
return ccAddressFocusNode;
|
||||
} else if (listEmailAddressType.contains(PrefixEmailAddress.bcc) == true) {
|
||||
return bccAddressFocusNode;
|
||||
} else {
|
||||
return subjectEmailInputFocusNode;
|
||||
}
|
||||
}
|
||||
|
||||
FocusNode? getNextFocusOfCcEmailAddress() {
|
||||
if (listEmailAddressType.contains(PrefixEmailAddress.bcc) == true) {
|
||||
return bccAddressFocusNode;
|
||||
} else {
|
||||
return subjectEmailInputFocusNode;
|
||||
}
|
||||
}
|
||||
|
||||
void handleFocusNextAddressAction() {
|
||||
_autoCreateEmailTag();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user