restart device dialog

This commit is contained in:
NicKoehler 2023-02-28 15:57:25 +01:00
parent 75e3f1c363
commit 7bf728bdad
No known key found for this signature in database
GPG Key ID: BAE01394EB51AC58
2 changed files with 42 additions and 12 deletions

View File

@ -661,7 +661,13 @@ abstract class BasePeerCard extends StatelessWidget {
}
return CustomAlertDialog(
title: Text(translate('Rename')),
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.edit_rounded, color: MyTheme.accent),
Text(translate('Rename')).paddingOnly(left: 10),
],
),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -722,7 +728,18 @@ abstract class BasePeerCard extends StatelessWidget {
}
return CustomAlertDialog(
title: Text(translate('Delete')),
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.delete_rounded,
color: Colors.red,
),
Text(translate('Delete')).paddingOnly(
left: 10,
),
],
),
content: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

View File

@ -25,19 +25,32 @@ void showRestartRemoteDevice(
final res =
await dialogManager.show<bool>((setState, close) => CustomAlertDialog(
title: Row(children: [
Icon(Icons.warning_amber_sharp,
color: Colors.redAccent, size: 28),
SizedBox(width: 10),
Text(translate("Restart Remote Device")),
Icon(Icons.warning_rounded, color: Colors.redAccent, size: 28),
Text(translate("Restart Remote Device")).paddingOnly(left: 10),
]),
content: Text(
"${translate('Are you sure you want to restart')} \n${pi.username}@${pi.hostname}($id) ?"),
content: Column(
children: [
Text(
"${translate('Are you sure you want to restart')} \n${pi.username}@${pi.hostname}($id) ?"),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton.icon(
icon: Icon(Icons.close_rounded),
label: Text(translate("Cancel")),
onPressed: close,
),
ElevatedButton.icon(
icon: Icon(Icons.done_rounded),
label: Text(translate("Ok")),
onPressed: () => close(true),
),
],
).paddingOnly(top: 20)
],
),
onCancel: close,
onSubmit: () => close(true),
actions: [
dialogButton("Cancel", onPressed: close, isOutline: true),
dialogButton("OK", onPressed: () => close(true)),
],
));
if (res == true) bind.sessionRestartRemoteDevice(id: id);
}