TF-831: add list email forward
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M9 0.5C9.55229 0.5 10 0.947716 10 1.5L10 8H16.5C17.0523 8 17.5 8.44772 17.5 9C17.5 9.55228 17.0523 10 16.5 10H10L10 16.5001C10 17.0524 9.55229 17.5001 9 17.5001C8.44772 17.5001 8 17.0524 8 16.5001L7.999 10H1.5C0.947715 10 0.5 9.55228 0.5 9C0.5 8.44772 0.947715 8 1.5 8H7.999L8 1.5C8 0.947716 8.44772 0.5 9 0.5Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 439 B |
@@ -159,6 +159,7 @@ class ImagePaths {
|
||||
String get icSwitchOff => _getImagePath('ic_switch_off.svg');
|
||||
String get icClock => _getImagePath('ic_clock.svg');
|
||||
String get icCalendar => _getImagePath('ic_calendar.svg');
|
||||
String get icAddEmailForward => _getImagePath('ic_add_email_forwards.svg');
|
||||
|
||||
String _getImagePath(String imageName) {
|
||||
return AssetsPaths.images + imageName;
|
||||
|
||||
@@ -20,6 +20,7 @@ import 'package:tmail_ui_user/features/manage_account/presentation/extensions/tm
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/recipient_forward.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
import 'package:tmail_ui_user/main/routes/app_routes.dart';
|
||||
import 'package:tmail_ui_user/main/routes/route_navigation.dart';
|
||||
|
||||
class ForwardController extends BaseController {
|
||||
@@ -211,4 +212,22 @@ class ForwardController extends BaseController {
|
||||
.map((recipient) => recipient.enableSelection())
|
||||
.toList();
|
||||
}
|
||||
|
||||
void goToAddEmailsForward() async {
|
||||
final accountId = _accountDashBoardController.accountId.value;
|
||||
if (accountId != null) {
|
||||
// final newEmailRuleFilter = await push(
|
||||
// AppRoutes.EMAILS_FORWARD_CREATOR,
|
||||
// arguments: RulesFilterCreatorArguments(accountId));
|
||||
//
|
||||
// if (newEmailRuleFilter is TMailRule) {
|
||||
// _createNewRuleFilterAction(
|
||||
// accountId,
|
||||
// CreateNewEmailRuleFilterRequest(
|
||||
// listEmailRule,
|
||||
// newEmailRuleFilter)
|
||||
// );
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/mixin/app_loader_mixin.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/forward/forward_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/forward/widgets/forward_header_widget.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/forward/widgets/list_email_forward_widget.dart';
|
||||
|
||||
class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
final _responsiveUtils = Get.find<ResponsiveUtils>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
|
||||
ForwardView({Key? key}) : super(key: key);
|
||||
|
||||
@@ -22,6 +24,12 @@ class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ForwardHeaderWidget(
|
||||
imagePaths: _imagePaths,
|
||||
responsiveUtils: _responsiveUtils,
|
||||
addEmailForward: () => controller.goToAddEmailsForward(),
|
||||
),
|
||||
SizedBox(height: _responsiveUtils.isWebDesktop(context) ? 24 : 16),
|
||||
_buildLoadingView(),
|
||||
Expanded(child: ListEmailForwardsWidget())
|
||||
],
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:core/presentation/views/button/button_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
class ForwardHeaderWidget extends StatelessWidget {
|
||||
const ForwardHeaderWidget({
|
||||
Key? key,
|
||||
required this.addEmailForward,
|
||||
required this.imagePaths,
|
||||
required this.responsiveUtils,
|
||||
}) : super(key: key);
|
||||
|
||||
final VoidCallback addEmailForward;
|
||||
final ImagePaths imagePaths;
|
||||
final ResponsiveUtils responsiveUtils;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.colorBackgroundWrapIconStyleCode,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(AppLocalizations.of(context).forwarding,
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black)),
|
||||
const SizedBox(height: 4),
|
||||
const SizedBox(height: 24),
|
||||
_buildButtonAddNewEmailsForward(context),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildButtonAddNewEmailsForward(BuildContext context) {
|
||||
if (!responsiveUtils.isMobile(context)) {
|
||||
return (ButtonBuilder(imagePaths.icAddEmailForward)
|
||||
..key(const Key('button_add_emails_forward'))
|
||||
..decoration(BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: AppColor.colorTextButton))
|
||||
..paddingIcon(const EdgeInsets.only(right: 8))
|
||||
..iconColor(Colors.white)
|
||||
..maxWidth(130)
|
||||
..size(20)
|
||||
..radiusSplash(10)
|
||||
..padding(const EdgeInsets.symmetric(vertical: 12))
|
||||
..textStyle(const TextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
))
|
||||
..onPressActionClick(() => addEmailForward.call())
|
||||
..text(
|
||||
AppLocalizations.of(context).addEmailForward,
|
||||
isVertical: false,
|
||||
))
|
||||
.build();
|
||||
} else {
|
||||
return (ButtonBuilder(imagePaths.icAddEmailForward)
|
||||
..key(const Key('button_add_emails_forward'))
|
||||
..decoration(BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: AppColor.colorTextButton))
|
||||
..paddingIcon(const EdgeInsets.only(right: 8))
|
||||
..iconColor(Colors.white)
|
||||
..size(20)
|
||||
..radiusSplash(10)
|
||||
..padding(const EdgeInsets.symmetric(vertical: 12))
|
||||
..textStyle(const TextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
))
|
||||
..onPressActionClick(() => addEmailForward.call())
|
||||
..text(
|
||||
AppLocalizations.of(context).addEmailForward,
|
||||
isVertical: false,
|
||||
))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2133,4 +2133,11 @@ class AppLocalizations {
|
||||
name: 'messageConfirmationDialogDeleteAllRecipientForward'
|
||||
);
|
||||
}
|
||||
|
||||
String get addEmailForward {
|
||||
return Intl.message(
|
||||
'Add Email',
|
||||
name: 'addEmailForward',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user