refactor: replace Navigator with Modular for dialog dismissal in client hubs and settings actions
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user