From 785365ec74bde080350c34a5f346428f08842828 Mon Sep 17 00:00:00 2001 From: Amoghhosamane Date: Sat, 16 May 2026 19:48:08 +0530 Subject: [PATCH] fix: add BACK button to error dialog (closes #298) All error dialogs from showErrDialog now include a BACK button so users can dismiss the alert and return to the previous view without requiring navigation via the app bar or nav bar. Adds ButtonLabel.back ('BACK') as first action alongside the existing 'OK' button in the AlertDialog returned by showErrDialog(). Imports notepod/constants/ui.dart for the ButtonLabel constant. --- lib/widgets/err_dialogs.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/widgets/err_dialogs.dart b/lib/widgets/err_dialogs.dart index 0edc9c4..2d5a8e2 100644 --- a/lib/widgets/err_dialogs.dart +++ b/lib/widgets/err_dialogs.dart @@ -27,6 +27,8 @@ library; import 'package:flutter/material.dart'; +import 'package:notepod/constants/ui.dart'; + Future showErrDialog(BuildContext context, String errMsg) async { return showDialog( context: context, @@ -49,6 +51,12 @@ Future showErrDialog(BuildContext context, String errMsg) async { ), ), actions: [ + TextButton( + child: const Text(ButtonLabel.back), + onPressed: () { + Navigator.of(context).pop(); + }, + ), TextButton( child: const Text('OK'), onPressed: () {