refactor: enhance navigation robustness by introducing popSafe and safePushNamedAndRemoveUntil methods and updating their usage.
This commit is contained in:
@@ -227,12 +227,12 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
|
||||
content: Text(i18n.message),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Modular.to.pop(),
|
||||
onPressed: () => Modular.to.popSafe(),
|
||||
child: Text(Translations.of(context).common.cancel),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Modular.to.pop();
|
||||
Modular.to.popSafe();
|
||||
_showApplyingDialog(context, shift);
|
||||
BlocProvider.of<ShiftDetailsBloc>(context).add(
|
||||
BookShiftDetailsEvent(
|
||||
@@ -317,7 +317,11 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
|
||||
children: [
|
||||
const Icon(UiIcons.warning, color: UiColors.error),
|
||||
const SizedBox(width: UiConstants.space2),
|
||||
Expanded(child: Text(context.t.staff_shifts.shift_details.eligibility_requirements)),
|
||||
Expanded(
|
||||
child: Text(
|
||||
context.t.staff_shifts.shift_details.eligibility_requirements,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
content: Text(
|
||||
@@ -333,7 +337,7 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
|
||||
text: "Go to Certificates",
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
Modular.to.pushNamed(StaffPaths.certificates);
|
||||
Modular.to.toCertificates();
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user