mobile: change content color for local only
This commit is contained in:
parent
1270086b43
commit
46587f8dd8
4 changed files with 22 additions and 4 deletions
|
@ -151,6 +151,7 @@
|
||||||
"delete_dialog_alert_local_non_backed_up": "Some of the items aren't backed up to Immich and will be permanently removed from your device",
|
"delete_dialog_alert_local_non_backed_up": "Some of the items aren't backed up to Immich and will be permanently removed from your device",
|
||||||
"delete_dialog_cancel": "Cancel",
|
"delete_dialog_cancel": "Cancel",
|
||||||
"delete_dialog_ok": "Delete",
|
"delete_dialog_ok": "Delete",
|
||||||
|
"delete_dialog_ok_force": "Delete Anyway",
|
||||||
"delete_dialog_title": "Delete Permanently",
|
"delete_dialog_title": "Delete Permanently",
|
||||||
"delete_shared_link_dialog_content": "Are you sure you want to delete this shared link?",
|
"delete_shared_link_dialog_content": "Are you sure you want to delete this shared link?",
|
||||||
"delete_shared_link_dialog_title": "Delete Shared Link",
|
"delete_shared_link_dialog_title": "Delete Shared Link",
|
||||||
|
|
|
@ -113,7 +113,13 @@ class ControlBottomAppBar extends ConsumerWidget {
|
||||||
content: selectionAssetState.hasLocal
|
content: selectionAssetState.hasLocal
|
||||||
? "delete_dialog_alert_local_non_backed_up"
|
? "delete_dialog_alert_local_non_backed_up"
|
||||||
: "delete_dialog_alert_local",
|
: "delete_dialog_alert_local",
|
||||||
|
ok: selectionAssetState.hasLocal
|
||||||
|
? "delete_dialog_ok_force"
|
||||||
|
: "delete_dialog_ok",
|
||||||
onDelete: onDeleteLocal,
|
onDelete: onDeleteLocal,
|
||||||
|
contentColor: selectionAssetState.hasLocal
|
||||||
|
? Colors.red[400]
|
||||||
|
: null,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,13 +4,19 @@ import 'package:immich_mobile/shared/ui/confirm_dialog.dart';
|
||||||
class DeleteDialog extends ConfirmDialog {
|
class DeleteDialog extends ConfirmDialog {
|
||||||
final Function onDelete;
|
final Function onDelete;
|
||||||
|
|
||||||
const DeleteDialog({Key? key, required this.onDelete, content})
|
const DeleteDialog({
|
||||||
: super(
|
Key? key,
|
||||||
|
required this.onDelete,
|
||||||
|
String? content,
|
||||||
|
String? ok,
|
||||||
|
Color? contentColor,
|
||||||
|
}) : super(
|
||||||
key: key,
|
key: key,
|
||||||
title: "delete_dialog_title",
|
title: "delete_dialog_title",
|
||||||
content: content ?? "delete_dialog_alert",
|
content: content ?? "delete_dialog_alert",
|
||||||
cancel: "delete_dialog_cancel",
|
cancel: "delete_dialog_cancel",
|
||||||
ok: "delete_dialog_ok",
|
ok: ok ?? "delete_dialog_ok",
|
||||||
onOk: onDelete,
|
onOk: onDelete,
|
||||||
|
contentColor: contentColor,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ class ConfirmDialog extends StatelessWidget {
|
||||||
final Function onOk;
|
final Function onOk;
|
||||||
final String title;
|
final String title;
|
||||||
final String content;
|
final String content;
|
||||||
|
final Color? contentColor;
|
||||||
final String cancel;
|
final String cancel;
|
||||||
final String ok;
|
final String ok;
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ class ConfirmDialog extends StatelessWidget {
|
||||||
required this.content,
|
required this.content,
|
||||||
this.cancel = "delete_dialog_cancel",
|
this.cancel = "delete_dialog_cancel",
|
||||||
this.ok = "backup_controller_page_background_battery_info_ok",
|
this.ok = "backup_controller_page_background_battery_info_ok",
|
||||||
|
this.contentColor,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -22,7 +24,10 @@ class ConfirmDialog extends StatelessWidget {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||||
title: Text(title).tr(),
|
title: Text(title).tr(),
|
||||||
content: Text(content).tr(),
|
content: Text(
|
||||||
|
content,
|
||||||
|
style: TextStyle(color: contentColor),
|
||||||
|
).tr(),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () => Navigator.of(context).pop(false),
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
|
|
Loading…
Reference in a new issue