TF-899 Implement create mailbox folder in destination picker
This commit is contained in:
@@ -30,6 +30,7 @@ class MailboxCreatorController extends BaseController {
|
||||
final newNameMailbox = Rxn<String>();
|
||||
|
||||
FocusNode? nameInputFocusNode;
|
||||
TextEditingController? nameInputController;
|
||||
|
||||
MailboxCreatorArguments? arguments;
|
||||
AccountId? accountId;
|
||||
@@ -48,12 +49,12 @@ class MailboxCreatorController extends BaseController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
nameInputFocusNode = FocusNode();
|
||||
nameInputController = TextEditingController();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
log('MailboxCreatorController::onReady(): ');
|
||||
if (arguments != null) {
|
||||
folderMailboxTree = arguments!.folderMailboxTree;
|
||||
defaultMailboxTree = arguments!.defaultMailboxTree;
|
||||
@@ -71,7 +72,7 @@ class MailboxCreatorController extends BaseController {
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
nameInputFocusNode?.dispose();
|
||||
_disposeWidget();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
@@ -184,6 +185,13 @@ class MailboxCreatorController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
void _disposeWidget() {
|
||||
nameInputFocusNode?.dispose();
|
||||
nameInputFocusNode = null;
|
||||
nameInputController?.dispose();
|
||||
nameInputController = null;
|
||||
}
|
||||
|
||||
void createNewMailbox(BuildContext context) {
|
||||
FocusScope.of(context).unfocus();
|
||||
|
||||
@@ -194,9 +202,7 @@ class MailboxCreatorController extends BaseController {
|
||||
mailboxLocation: selectedMailbox.value);
|
||||
|
||||
if (BuildUtils.isWeb) {
|
||||
nameInputFocusNode?.dispose();
|
||||
nameInputFocusNode = null;
|
||||
|
||||
_disposeWidget();
|
||||
onCreatedMailboxCallback?.call(newMailboxArguments);
|
||||
} else {
|
||||
popBack(result: newMailboxArguments);
|
||||
@@ -208,9 +214,7 @@ class MailboxCreatorController extends BaseController {
|
||||
FocusScope.of(context).unfocus();
|
||||
|
||||
if (BuildUtils.isWeb) {
|
||||
nameInputFocusNode?.dispose();
|
||||
nameInputFocusNode = null;
|
||||
|
||||
_disposeWidget();
|
||||
onDismissMailboxCreator?.call();
|
||||
} else {
|
||||
popBack();
|
||||
|
||||
@@ -84,6 +84,7 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
||||
right: !BuildUtils.isWeb && _responsiveUtils.isLandscapeMobile(context),
|
||||
child: Column(children: [
|
||||
_buildAppBar(context),
|
||||
const Divider(color: AppColor.colorDividerDestinationPicker, height: 1),
|
||||
_buildCreateMailboxNameInput(context),
|
||||
_buildMailboxLocation(context),
|
||||
]),
|
||||
@@ -116,6 +117,7 @@ class MailboxCreatorView extends GetWidget<MailboxCreatorController> {
|
||||
..onChange((value) => controller.setNewNameMailbox(value))
|
||||
..keyboardType(TextInputType.visiblePassword)
|
||||
..cursorColor(AppColor.colorTextButton)
|
||||
..addController(controller.nameInputController)
|
||||
..maxLines(1)
|
||||
..textStyle(const TextStyle(
|
||||
color: AppColor.colorNameEmail,
|
||||
|
||||
Reference in New Issue
Block a user