TF-2026 Add SaveToDraftAndClose method
(cherry picked from commit f319001c5e30ea33175476aefb9942464b540c8f)
This commit is contained in:
@@ -433,7 +433,7 @@ abstract class BaseComposerView extends GetWidget<ComposerController>
|
|||||||
),
|
),
|
||||||
iconPadding: EdgeInsets.zero,
|
iconPadding: EdgeInsets.zero,
|
||||||
tooltip: AppLocalizations.of(context).saveAndClose,
|
tooltip: AppLocalizations.of(context).saveAndClose,
|
||||||
onTap: () => controller.saveEmailAsDrafts(context)
|
onTap: () => controller.saveToDraftAndClose(context)
|
||||||
),
|
),
|
||||||
Expanded(child: buildTitleComposer(context)),
|
Expanded(child: buildTitleComposer(context)),
|
||||||
if (responsiveUtils.isScreenWithShortestSide(context))
|
if (responsiveUtils.isScreenWithShortestSide(context))
|
||||||
@@ -513,7 +513,7 @@ abstract class BaseComposerView extends GetWidget<ComposerController>
|
|||||||
width: 150,
|
width: 150,
|
||||||
height: 44,
|
height: 44,
|
||||||
radius: 10,
|
radius: 10,
|
||||||
onTap: () => controller.saveEmailAsDrafts(context)
|
onTap: () => controller.saveToDraft(context)
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
const SizedBox(width: 12),
|
||||||
buildTextButton(
|
buildTextButton(
|
||||||
|
|||||||
@@ -1016,7 +1016,7 @@ class ComposerController extends BaseController {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void saveEmailAsDrafts(BuildContext context, {bool canPop = true}) async {
|
void saveToDraftAndClose(BuildContext context, {bool canPop = true}) async {
|
||||||
clearFocusEditor(context);
|
clearFocusEditor(context);
|
||||||
|
|
||||||
final arguments = composerArguments.value;
|
final arguments = composerArguments.value;
|
||||||
@@ -1083,6 +1083,8 @@ class ComposerController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void saveToDraft(BuildContext context) {}
|
||||||
|
|
||||||
File _covertSharedMediaFileToFile(SharedMediaFile sharedMediaFile) {
|
File _covertSharedMediaFileToFile(SharedMediaFile sharedMediaFile) {
|
||||||
return File(
|
return File(
|
||||||
Platform.isIOS
|
Platform.isIOS
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class ComposerView extends BaseComposerView {
|
|||||||
Widget _buildComposerViewForMobile(BuildContext context) {
|
Widget _buildComposerViewForMobile(BuildContext context) {
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
controller.saveEmailAsDrafts(context, canPop: false);
|
controller.saveToDraftAndClose(context, canPop: false);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
@@ -91,7 +91,7 @@ class ComposerView extends BaseComposerView {
|
|||||||
Widget _buildComposerViewForTablet(BuildContext context) {
|
Widget _buildComposerViewForTablet(BuildContext context) {
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
controller.saveEmailAsDrafts(context, canPop: false);
|
controller.saveToDraftAndClose(context, canPop: false);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class ComposerView extends BaseComposerView {
|
|||||||
child: buildIconWeb(
|
child: buildIconWeb(
|
||||||
icon: SvgPicture.asset(imagePaths.icCloseMailbox, fit: BoxFit.fill),
|
icon: SvgPicture.asset(imagePaths.icCloseMailbox, fit: BoxFit.fill),
|
||||||
tooltip: AppLocalizations.of(context).saveAndClose,
|
tooltip: AppLocalizations.of(context).saveAndClose,
|
||||||
onTap: () => controller.saveEmailAsDrafts(context)
|
onTap: () => controller.saveToDraftAndClose(context)
|
||||||
)),
|
)),
|
||||||
buildIconWeb(
|
buildIconWeb(
|
||||||
icon: SvgPicture.asset(imagePaths.icFullScreenComposer, fit: BoxFit.fill),
|
icon: SvgPicture.asset(imagePaths.icFullScreenComposer, fit: BoxFit.fill),
|
||||||
@@ -176,7 +176,7 @@ class ComposerView extends BaseComposerView {
|
|||||||
iconPadding: EdgeInsets.zero,
|
iconPadding: EdgeInsets.zero,
|
||||||
icon: SvgPicture.asset(imagePaths.icCloseMailbox, fit: BoxFit.fill),
|
icon: SvgPicture.asset(imagePaths.icCloseMailbox, fit: BoxFit.fill),
|
||||||
tooltip: AppLocalizations.of(context).saveAndClose,
|
tooltip: AppLocalizations.of(context).saveAndClose,
|
||||||
onTap: () => controller.saveEmailAsDrafts(context)
|
onTap: () => controller.saveToDraftAndClose(context)
|
||||||
),
|
),
|
||||||
if (responsiveUtils.isDesktop(context))
|
if (responsiveUtils.isDesktop(context))
|
||||||
...[
|
...[
|
||||||
|
|||||||
Reference in New Issue
Block a user