refactor: replace Navigator with Modular for dialog dismissal in client hubs and settings actions

This commit is contained in:
Achintha Isuru
2026-02-03 22:59:00 -05:00
parent 9e764ab2e4
commit 2083b5dbff
2 changed files with 3 additions and 3 deletions

View File

@@ -248,15 +248,15 @@ class ClientHubsPage extends StatelessWidget {
), ),
actions: <Widget>[ actions: <Widget>[
TextButton( TextButton(
onPressed: () => Navigator.of(dialogContext).pop(), onPressed: () => Modular.to.pop(),
child: const Text('Cancel'), child: const Text('Cancel'),
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {
Navigator.of(dialogContext).pop();
BlocProvider.of<ClientHubsBloc>( BlocProvider.of<ClientHubsBloc>(
context, context,
).add(ClientHubsDeleteRequested(hub.id)); ).add(ClientHubsDeleteRequested(hub.id));
Modular.to.pop();
}, },
style: TextButton.styleFrom( style: TextButton.styleFrom(
foregroundColor: UiColors.destructive, foregroundColor: UiColors.destructive,

View File

@@ -83,7 +83,7 @@ class SettingsActions extends StatelessWidget {
// Cancel button // Cancel button
UiButton.secondary( UiButton.secondary(
text: t.common.cancel, text: t.common.cancel,
onPressed: () => Navigator.of(dialogContext).pop(), onPressed: () => Modular.to.pop(),
), ),
], ],
), ),