Skip to content

Commit 2316fdf

Browse files
authored
Merge pull request #22 from CoderJava/feature/tampilkan-dialog-konfirmasi-ketika-delete-track
Feature - Tampilkan dialog konfirmasi ketika hapus data track di halaman report screenshot
2 parents 118a3ba + 1967586 commit 2316fdf

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

lib/feature/presentation/page/report_screenshot/report_screenshot_page.dart

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -822,11 +822,36 @@ class _ReportScreenshotPageState extends State<ReportScreenshotPage> {
822822
return;
823823
}
824824

825-
trackingBloc.add(
826-
DeleteTrackUserTrackingEvent(
827-
trackId: trackId,
828-
),
829-
);
825+
showDialog<bool?>(
826+
context: context,
827+
builder: (context) {
828+
return AlertDialog(
829+
title: Text('title_delete_track'.tr()),
830+
content: Text('content_delete_track'.tr()),
831+
actions: [
832+
TextButton(
833+
onPressed: () => context.pop(false),
834+
child: Text('cancel'.tr()),
835+
),
836+
TextButton(
837+
onPressed: () => context.pop(true),
838+
style: TextButton.styleFrom(
839+
foregroundColor: Colors.red,
840+
),
841+
child: Text('delete'.tr()),
842+
),
843+
],
844+
);
845+
},
846+
).then((value) {
847+
if (value != null && value) {
848+
trackingBloc.add(
849+
DeleteTrackUserTrackingEvent(
850+
trackId: trackId,
851+
),
852+
);
853+
}
854+
});
830855
},
831856
child: const Padding(
832857
padding: EdgeInsets.all(8.0),

0 commit comments

Comments
 (0)