mobile: change content color for local only

This commit is contained in:
shalong-tanwen 2023-11-05 23:14:37 +05:30
parent 1270086b43
commit 46587f8dd8
4 changed files with 22 additions and 4 deletions

View file

@ -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_cancel": "Cancel",
"delete_dialog_ok": "Delete",
"delete_dialog_ok_force": "Delete Anyway",
"delete_dialog_title": "Delete Permanently",
"delete_shared_link_dialog_content": "Are you sure you want to delete this shared link?",
"delete_shared_link_dialog_title": "Delete Shared Link",

View file

@ -113,7 +113,13 @@ class ControlBottomAppBar extends ConsumerWidget {
content: selectionAssetState.hasLocal
? "delete_dialog_alert_local_non_backed_up"
: "delete_dialog_alert_local",
ok: selectionAssetState.hasLocal
? "delete_dialog_ok_force"
: "delete_dialog_ok",
onDelete: onDeleteLocal,
contentColor: selectionAssetState.hasLocal
? Colors.red[400]
: null,
);
},
);

View file

@ -4,13 +4,19 @@ import 'package:immich_mobile/shared/ui/confirm_dialog.dart';
class DeleteDialog extends ConfirmDialog {
final Function onDelete;
const DeleteDialog({Key? key, required this.onDelete, content})
: super(
const DeleteDialog({
Key? key,
required this.onDelete,
String? content,
String? ok,
Color? contentColor,
}) : super(
key: key,
title: "delete_dialog_title",
content: content ?? "delete_dialog_alert",
cancel: "delete_dialog_cancel",
ok: "delete_dialog_ok",
ok: ok ?? "delete_dialog_ok",
onOk: onDelete,
contentColor: contentColor,
);
}

View file

@ -5,6 +5,7 @@ class ConfirmDialog extends StatelessWidget {
final Function onOk;
final String title;
final String content;
final Color? contentColor;
final String cancel;
final String ok;
@ -15,6 +16,7 @@ class ConfirmDialog extends StatelessWidget {
required this.content,
this.cancel = "delete_dialog_cancel",
this.ok = "backup_controller_page_background_battery_info_ok",
this.contentColor,
}) : super(key: key);
@override
@ -22,7 +24,10 @@ class ConfirmDialog extends StatelessWidget {
return AlertDialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
title: Text(title).tr(),
content: Text(content).tr(),
content: Text(
content,
style: TextStyle(color: contentColor),
).tr(),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(false),