Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added dialog if users click on unselect image button #2427 #3707

Merged
merged 5 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/smooth_app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,12 @@
"ask_me_later_button_label": "Later",
"@ask_me_later": {
"description": "Button to ignore the camera permission request"

monsieurtanuki marked this conversation as resolved.
Show resolved Hide resolved
},
"are_you_sure": "Are you sure?",
"@are_you_sure": {
"description": "Are you sure?"

monsieurtanuki marked this conversation as resolved.
Show resolved Hide resolved
},
"knowledge_panel_text_source": "Go further on {sourceName}",
"@knowledge_panel_text_source": {
Expand Down Expand Up @@ -969,6 +975,7 @@
"@camera_mode_title": {
"description": "Title for the mode for the camera/scanner"
},

monsieurtanuki marked this conversation as resolved.
Show resolved Hide resolved
"camera_mode_subtitle": "Only change this value, if you have some issues with the scanner (unable to decode barcodes). Tap to switch between the two modes.\nThe current one is: {mode}",
"@camera_mode_subtitle": {
"description": "SubTitle for the mode for the camera/scanner",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,41 @@ class _ProductImageViewerState extends State<ProductImageViewer> {
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: SMALL_SPACE),
child: _getUnselectImageButton(appLocalizations),
child: (imageProvider == null)
BhuvanAde marked this conversation as resolved.
Show resolved Hide resolved
? Container()
: EditImageButton(
BhuvanAde marked this conversation as resolved.
Show resolved Hide resolved
iconData: Icons.do_disturb_on,
label: appLocalizations
.edit_photo_unselect_button_label,
onPressed: () async {
final bool? confirmed = await showDialog<bool>(
context: context,
builder: (BuildContext context) {
return SmoothAlertDialog(
title:
appLocalizations.confirm_button_label,
body: Text(
appLocalizations.are_you_sure,
),
close: true,
positiveAction: SmoothActionButton(
text: appLocalizations.yes,
onPressed: () =>
Navigator.of(context).pop(true)),
negativeAction: SmoothActionButton(
text: appLocalizations.no,
onPressed: () => Navigator.of(context)
.pop(false)));
},
);
if (confirmed == true) {
await BackgroundTaskUnselect.addTask(
_barcode,
imageField: widget.imageField,
widget: this,
);
}
}),
),
),
Expanded(
Expand Down