TF-888 Add button Cancel on Tablet and Mobile
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:tmail_ui_user/features/manage_account/domain/usecases/get_all_va
|
||||
import 'package:tmail_ui_user/features/manage_account/domain/usecases/update_vacation_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/extensions/vacation_response_extension.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/manage_account_dashboard_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/menu/settings/settings_controller.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/date_type.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/vacation_presentation.dart';
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/vacation/vacation_responder_status.dart';
|
||||
@@ -24,6 +25,7 @@ class VacationController extends BaseController {
|
||||
final _accountDashBoardController = Get.find<ManageAccountDashBoardController>();
|
||||
final _appToast = Get.find<AppToast>();
|
||||
final _imagePaths = Get.find<ImagePaths>();
|
||||
final _settingController = Get.find<SettingsController>();
|
||||
|
||||
final GetAllVacationInteractor _getAllVacationInteractor;
|
||||
final UpdateVacationInteractor _updateVacationInteractor;
|
||||
@@ -296,6 +298,10 @@ class VacationController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
void backToUniversalSettings() {
|
||||
_settingController.backToUniversalSettings();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
messageTextController.dispose();
|
||||
|
||||
@@ -272,20 +272,7 @@ class VacationView extends GetWidget<VacationController> {
|
||||
),
|
||||
)),
|
||||
const SizedBox(height: 24),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: buildTextButton(
|
||||
AppLocalizations.of(context).saveChanges,
|
||||
textStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 16
|
||||
),
|
||||
width: 156,
|
||||
height: 44,
|
||||
radius: 10,
|
||||
onTap: () => controller.saveVacation(context)),
|
||||
)
|
||||
_buildListButtonAction(context)
|
||||
]),
|
||||
)
|
||||
]
|
||||
@@ -295,4 +282,82 @@ class VacationView extends GetWidget<VacationController> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildListButtonAction(BuildContext context) {
|
||||
if (_responsiveUtils.isWebDesktop(context)) {
|
||||
return Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: buildTextButton(
|
||||
AppLocalizations.of(context).saveChanges,
|
||||
textStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 16
|
||||
),
|
||||
width: 156,
|
||||
height: 44,
|
||||
radius: 10,
|
||||
onTap: () => controller.saveVacation(context)),
|
||||
);
|
||||
} else {
|
||||
if (_responsiveUtils.isPortraitMobile(context)) {
|
||||
return Row(children: [
|
||||
Expanded(
|
||||
child: buildTextButton(
|
||||
AppLocalizations.of(context).cancel,
|
||||
textStyle: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 17,
|
||||
color: AppColor.colorTextButton),
|
||||
backgroundColor: AppColor.emailAddressChipColor,
|
||||
width: 156,
|
||||
height: 44,
|
||||
radius: 10,
|
||||
onTap: () => controller.backToUniversalSettings()),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: buildTextButton(
|
||||
AppLocalizations.of(context).saveChanges,
|
||||
textStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 16
|
||||
),
|
||||
width: 156,
|
||||
height: 44,
|
||||
radius: 10,
|
||||
onTap: () => controller.saveVacation(context)),
|
||||
)
|
||||
]);
|
||||
} else {
|
||||
return Row(children: [
|
||||
const Spacer(),
|
||||
buildTextButton(
|
||||
AppLocalizations.of(context).cancel,
|
||||
textStyle: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 17,
|
||||
color: AppColor.colorTextButton),
|
||||
backgroundColor: AppColor.emailAddressChipColor,
|
||||
width: 156,
|
||||
height: 44,
|
||||
radius: 10,
|
||||
onTap: () => controller.backToUniversalSettings()),
|
||||
const SizedBox(width: 12),
|
||||
buildTextButton(
|
||||
AppLocalizations.of(context).saveChanges,
|
||||
textStyle: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.normal,
|
||||
fontSize: 16
|
||||
),
|
||||
width: 156,
|
||||
height: 44,
|
||||
radius: 10,
|
||||
onTap: () => controller.saveVacation(context))
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user