Hotfix center identity creator loading
This commit is contained in:
@@ -42,130 +42,138 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget bodyCreatorView = NotificationListener<ScrollNotification>(
|
Widget bodyCreatorView = SingleChildScrollView(
|
||||||
onNotification: (scrollInfo) {
|
controller: controller.scrollController,
|
||||||
if (scrollInfo is ScrollEndNotification &&
|
physics: const ClampingScrollPhysics(),
|
||||||
scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent) {
|
child: Padding(
|
||||||
controller.clearFocusEditor(context);
|
padding: const EdgeInsetsDirectional.symmetric(vertical: 12, horizontal: 24),
|
||||||
}
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||||
return false;
|
Obx(() => IdentityInputFieldBuilder(
|
||||||
},
|
AppLocalizations.of(context).name,
|
||||||
child: SingleChildScrollView(
|
controller.errorNameIdentity.value,
|
||||||
controller: controller.scrollController,
|
AppLocalizations.of(context).required,
|
||||||
physics: const ClampingScrollPhysics(),
|
editingController: controller.inputNameIdentityController,
|
||||||
child: Padding(
|
focusNode: controller.inputNameIdentityFocusNode,
|
||||||
padding: const EdgeInsetsDirectional.symmetric(vertical: 12, horizontal: 24),
|
isMandatory: true,
|
||||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
onChangeInputNameAction: (value) => controller.updateNameIdentity(context, value)
|
||||||
Obx(() => IdentityInputFieldBuilder(
|
)),
|
||||||
AppLocalizations.of(context).name,
|
const SizedBox(height: 24),
|
||||||
controller.errorNameIdentity.value,
|
Obx(() {
|
||||||
AppLocalizations.of(context).required,
|
if (controller.actionType.value == IdentityActionType.create) {
|
||||||
editingController: controller.inputNameIdentityController,
|
return IdentityDropListFieldBuilder(
|
||||||
focusNode: controller.inputNameIdentityFocusNode,
|
controller.imagePaths,
|
||||||
isMandatory: true,
|
AppLocalizations.of(context).email.inCaps,
|
||||||
onChangeInputNameAction: (value) => controller.updateNameIdentity(context, value)
|
controller.emailOfIdentity.value,
|
||||||
)),
|
controller.listEmailAddressDefault,
|
||||||
const SizedBox(height: 24),
|
onSelectItemDropList: (emailAddress) => controller.updateEmailOfIdentity(context, emailAddress)
|
||||||
Obx(() {
|
);
|
||||||
if (controller.actionType.value == IdentityActionType.create) {
|
} else {
|
||||||
return IdentityDropListFieldBuilder(
|
return IdentityFieldNoEditableBuilder(
|
||||||
controller.imagePaths,
|
AppLocalizations.of(context).email.inCaps,
|
||||||
AppLocalizations.of(context).email.inCaps,
|
controller.emailOfIdentity.value
|
||||||
controller.emailOfIdentity.value,
|
);
|
||||||
controller.listEmailAddressDefault,
|
}
|
||||||
onSelectItemDropList: (emailAddress) => controller.updateEmailOfIdentity(context, emailAddress)
|
}),
|
||||||
);
|
const SizedBox(height: 24),
|
||||||
|
Obx(() => IdentityDropListFieldBuilder(
|
||||||
|
controller.imagePaths,
|
||||||
|
AppLocalizations.of(context).reply_to,
|
||||||
|
controller.replyToOfIdentity.value,
|
||||||
|
controller.listEmailAddressOfReplyTo,
|
||||||
|
onSelectItemDropList: (emailAddress) => controller.updaterReplyToOfIdentity(context, emailAddress)
|
||||||
|
)),
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
Obx(() => IdentityInputWithDropListFieldBuilder(
|
||||||
|
AppLocalizations.of(context).bcc_to,
|
||||||
|
controller.errorBccIdentity.value,
|
||||||
|
controller.inputBccIdentityController,
|
||||||
|
focusNode: controller.inputBccIdentityFocusNode,
|
||||||
|
onSelectedSuggestionAction: (newEmailAddress) {
|
||||||
|
controller.inputBccIdentityController.text = newEmailAddress?.email ?? '';
|
||||||
|
controller.updateBccOfIdentity(newEmailAddress);
|
||||||
|
},
|
||||||
|
onChangeInputSuggestionAction: (pattern) {
|
||||||
|
controller.validateInputBccAddress(context, pattern);
|
||||||
|
if (pattern == null || pattern.trim().isEmpty) {
|
||||||
|
controller.updateBccOfIdentity(null);
|
||||||
} else {
|
} else {
|
||||||
return IdentityFieldNoEditableBuilder(
|
controller.updateBccOfIdentity(EmailAddress(null, pattern));
|
||||||
AppLocalizations.of(context).email.inCaps,
|
|
||||||
controller.emailOfIdentity.value
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}),
|
},
|
||||||
const SizedBox(height: 24),
|
onSuggestionCallbackAction: controller.getSuggestionEmailAddress
|
||||||
Obx(() => IdentityDropListFieldBuilder(
|
)),
|
||||||
controller.imagePaths,
|
const SizedBox(height: 32),
|
||||||
AppLocalizations.of(context).reply_to,
|
Text(AppLocalizations.of(context).signature,
|
||||||
controller.replyToOfIdentity.value,
|
style: const TextStyle(
|
||||||
controller.listEmailAddressOfReplyTo,
|
fontWeight: FontWeight.normal,
|
||||||
onSelectItemDropList: (emailAddress) => controller.updaterReplyToOfIdentity(context, emailAddress)
|
fontSize: 14,
|
||||||
)),
|
color: AppColor.colorContentEmail,
|
||||||
const SizedBox(height: 24),
|
|
||||||
Obx(() => IdentityInputWithDropListFieldBuilder(
|
|
||||||
AppLocalizations.of(context).bcc_to,
|
|
||||||
controller.errorBccIdentity.value,
|
|
||||||
controller.inputBccIdentityController,
|
|
||||||
focusNode: controller.inputBccIdentityFocusNode,
|
|
||||||
onSelectedSuggestionAction: (newEmailAddress) {
|
|
||||||
controller.inputBccIdentityController.text = newEmailAddress?.email ?? '';
|
|
||||||
controller.updateBccOfIdentity(newEmailAddress);
|
|
||||||
},
|
|
||||||
onChangeInputSuggestionAction: (pattern) {
|
|
||||||
controller.validateInputBccAddress(context, pattern);
|
|
||||||
if (pattern == null || pattern.trim().isEmpty) {
|
|
||||||
controller.updateBccOfIdentity(null);
|
|
||||||
} else {
|
|
||||||
controller.updateBccOfIdentity(EmailAddress(null, pattern));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onSuggestionCallbackAction: controller.getSuggestionEmailAddress
|
|
||||||
)),
|
|
||||||
const SizedBox(height: 32),
|
|
||||||
Text(AppLocalizations.of(context).signature,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.normal,
|
|
||||||
fontSize: 14,
|
|
||||||
color: AppColor.colorContentEmail,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
),
|
||||||
LayoutBuilder(
|
const SizedBox(height: 8),
|
||||||
builder: (context, constraintsEditor) {
|
LayoutBuilder(
|
||||||
return Stack(
|
builder: (context, constraintsEditor) {
|
||||||
children: [
|
return Stack(
|
||||||
Container(
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
children: [
|
||||||
borderRadius: BorderRadius.circular(12),
|
Container(
|
||||||
border: Border.all(color: AppColor.colorInputBorderCreateMailbox),
|
decoration: BoxDecoration(
|
||||||
),
|
borderRadius: BorderRadius.circular(12),
|
||||||
padding: const EdgeInsetsDirectional.all(16),
|
border: Border.all(color: AppColor.colorInputBorderCreateMailbox),
|
||||||
child: _buildSignatureHtmlTemplate(context, constraintsEditor.maxWidth),
|
|
||||||
),
|
),
|
||||||
Obx(() {
|
padding: const EdgeInsetsDirectional.all(16),
|
||||||
if (controller.draggableAppState.value == DraggableAppState.inActive) {
|
child: _buildSignatureHtmlTemplate(context, constraintsEditor.maxWidth),
|
||||||
return const SizedBox.shrink();
|
),
|
||||||
}
|
Obx(() {
|
||||||
|
if (controller.draggableAppState.value == DraggableAppState.inActive) {
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
}
|
||||||
|
|
||||||
return Positioned.fill(
|
return Positioned.fill(
|
||||||
child: PointerInterceptor(
|
child: PointerInterceptor(
|
||||||
child: LocalFileDropZoneWidget(
|
child: LocalFileDropZoneWidget(
|
||||||
imagePaths: controller.imagePaths,
|
imagePaths: controller.imagePaths,
|
||||||
width: constraintsEditor.maxWidth,
|
width: constraintsEditor.maxWidth,
|
||||||
height: constraintsEditor.maxHeight,
|
height: constraintsEditor.maxHeight,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
onLocalFileDropZoneListener: (details) =>
|
onLocalFileDropZoneListener: (details) =>
|
||||||
controller.onLocalFileDropZoneListener(
|
controller.onLocalFileDropZoneListener(
|
||||||
context: context,
|
context: context,
|
||||||
details: details,
|
details: details,
|
||||||
maxWidth: constraintsEditor.maxWidth,
|
maxWidth: constraintsEditor.maxWidth,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
})
|
}),
|
||||||
],
|
Obx(() {
|
||||||
);
|
bool isInserting = controller.publicAssetController?.isUploading.isTrue == true
|
||||||
}
|
|| controller.isCompressingInlineImage.isTrue;
|
||||||
),
|
return InsertImageLoadingIndicator(isInserting: isInserting);
|
||||||
const SizedBox(height: 12),
|
})
|
||||||
if (controller.isMobile(context))
|
],
|
||||||
_buildActionButtonMobile(context)
|
);
|
||||||
]),
|
}
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
if (controller.isMobile(context))
|
||||||
|
_buildActionButtonMobile(context)
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (PlatformInfo.isWeb) {
|
if (PlatformInfo.isWeb) {
|
||||||
|
bodyCreatorView = NotificationListener<ScrollNotification>(
|
||||||
|
onNotification: (scrollInfo) {
|
||||||
|
if (scrollInfo is ScrollEndNotification &&
|
||||||
|
scrollInfo.metrics.pixels == scrollInfo.metrics.maxScrollExtent) {
|
||||||
|
controller.clearFocusEditor(context);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
child: bodyCreatorView,
|
||||||
|
);
|
||||||
|
|
||||||
return PointerInterceptor(
|
return PointerInterceptor(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () => controller.clearFocusEditor(context),
|
onTap: () => controller.clearFocusEditor(context),
|
||||||
@@ -464,34 +472,16 @@ class IdentityCreatorView extends GetWidget<IdentityCreatorController>
|
|||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
Stack(
|
_buildHtmlEditorWeb(
|
||||||
children: [
|
context,
|
||||||
_buildHtmlEditorWeb(
|
controller.contentHtmlEditor,
|
||||||
context,
|
maxWidth),
|
||||||
controller.contentHtmlEditor,
|
|
||||||
maxWidth),
|
|
||||||
Obx(() {
|
|
||||||
bool isInserting = controller.publicAssetController?.isUploading.isTrue == true
|
|
||||||
|| controller.isCompressingInlineImage.isTrue;
|
|
||||||
return InsertImageLoadingIndicator(isInserting: isInserting);
|
|
||||||
})
|
|
||||||
]
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return Stack(
|
return _buildHtmlEditor(
|
||||||
children: [
|
context,
|
||||||
_buildHtmlEditor(
|
initialContent: controller.contentHtmlEditor);
|
||||||
context,
|
|
||||||
initialContent: controller.contentHtmlEditor),
|
|
||||||
Obx(() {
|
|
||||||
bool isInserting = controller.publicAssetController?.isUploading.isTrue == true
|
|
||||||
|| controller.isCompressingInlineImage.isTrue;
|
|
||||||
return InsertImageLoadingIndicator(isInserting: isInserting);
|
|
||||||
})
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ class InsertImageLoadingIndicator extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (isInserting) {
|
if (isInserting) {
|
||||||
return const Align(
|
return const Align(
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.center,
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
color: AppColor.primaryColor
|
color: AppColor.primaryColor
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user