TF-888 Add button Cancel on Tablet and Mobile

This commit is contained in:
dab246
2022-09-09 19:20:37 +07:00
committed by Dat H. Pham
parent 67865fd1a2
commit 8d23606e98
2 changed files with 85 additions and 14 deletions
@@ -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))
]);
}
}
}
}