refactor: Improve delete device UX flow

This commit is contained in:
krille-chan 2024-10-13 09:06:34 +02:00
commit d14698ee94
No known key found for this signature in database
3 changed files with 18 additions and 33 deletions

View file

@ -96,8 +96,7 @@ class DevicesSettingsView extends StatelessWidget {
width: double.infinity,
child: TextButton.icon(
label: Text(
controller.errorDeletingDevices ??
L10n.of(context).removeAllOtherDevices,
L10n.of(context).removeAllOtherDevices,
),
style: TextButton.styleFrom(
foregroundColor:
@ -105,16 +104,10 @@ class DevicesSettingsView extends StatelessWidget {
backgroundColor:
theme.colorScheme.errorContainer,
),
icon: controller.loadingDeletingDevices
? const CircularProgressIndicator.adaptive(
strokeWidth: 2,
)
: const Icon(Icons.delete_outline),
onPressed: controller.loadingDeletingDevices
? null
: () => controller.removeDevicesAction(
controller.notThisDevice,
),
icon: const Icon(Icons.delete_outline),
onPressed: () => controller.removeDevicesAction(
controller.notThisDevice,
),
),
),
)