TF-912: Support rich text for signature htmlBody of identity

This commit is contained in:
ManhNTX
2022-09-30 12:55:45 +07:00
committed by Dat H. Pham
parent 00f781b67f
commit e7429b9fd5
5 changed files with 161 additions and 107 deletions
@@ -291,6 +291,7 @@ class ComposerView extends GetWidget<ComposerController>
onFocusChange: (focus) {
if(focus) {
controller.htmlEditorApi?.unfocus();
controller.keyboardRichTextController.hideRichTextView();
}
},
child: Column(
@@ -362,28 +363,36 @@ class ComposerView extends GetWidget<ComposerController>
}
Widget _buildSubjectEmail(BuildContext context) {
return Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(
'${AppLocalizations.of(context).subject_email}:',
style: const TextStyle(fontSize: 15, color: AppColor.colorHintEmailAddressInput))),
Expanded(
child: FocusScope(child: Focus(
onFocusChange: (focus) => controller.onSubjectEmailFocusChange(focus),
child: (TextFieldBuilder()
..key(const Key('subject_email_input'))
..cursorColor(AppColor.colorTextButton)
..maxLines(responsiveUtils.isMobile(context) ? null : 1)
..onChange((value) => controller.setSubjectEmail(value))
..textStyle(const TextStyle(color: Colors.black, fontSize: 15, fontWeight: FontWeight.normal))
..textDecoration(const InputDecoration(contentPadding: EdgeInsets.zero, border: InputBorder.none))
..addController(controller.subjectEmailInputController))
.build(),
))
)
]
return Focus(
onFocusChange: (focus) {
if(focus) {
controller.htmlEditorApi?.unfocus();
controller.keyboardRichTextController.hideRichTextView();
}
},
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(right: 8),
child: Text(
'${AppLocalizations.of(context).subject_email}:',
style: const TextStyle(fontSize: 15, color: AppColor.colorHintEmailAddressInput))),
Expanded(
child: FocusScope(child: Focus(
onFocusChange: (focus) => controller.onSubjectEmailFocusChange(focus),
child: (TextFieldBuilder()
..key(const Key('subject_email_input'))
..cursorColor(AppColor.colorTextButton)
..maxLines(responsiveUtils.isMobile(context) ? null : 1)
..onChange((value) => controller.setSubjectEmail(value))
..textStyle(const TextStyle(color: Colors.black, fontSize: 15, fontWeight: FontWeight.normal))
..textDecoration(const InputDecoration(contentPadding: EdgeInsets.zero, border: InputBorder.none))
..addController(controller.subjectEmailInputController))
.build(),
))
)
]
),
);
}