2022-11-09 15:49:37 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2021-06-20 21:08:52 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-11-09 15:49:37 +00:00
|
|
|
import 'package:selfprivacy/config/get_it_config.dart';
|
2023-03-27 17:02:44 +00:00
|
|
|
import 'package:selfprivacy/ui/components/buttons/dialog_action_button.dart';
|
2022-11-09 15:49:37 +00:00
|
|
|
|
|
|
|
void showPopUpAlert({
|
|
|
|
required final String description,
|
|
|
|
required final String actionButtonTitle,
|
|
|
|
required final void Function() actionButtonOnPressed,
|
|
|
|
final void Function()? cancelButtonOnPressed,
|
|
|
|
final String? alertTitle,
|
|
|
|
final String? cancelButtonTitle,
|
|
|
|
}) {
|
|
|
|
getIt.get<NavigationService>().showPopUpDialog(
|
2023-03-31 14:17:22 +00:00
|
|
|
AlertDialog(
|
|
|
|
title: Text(alertTitle ?? 'basis.alert'.tr()),
|
|
|
|
content: Text(description),
|
2022-11-09 15:49:37 +00:00
|
|
|
actions: [
|
2023-03-27 17:02:44 +00:00
|
|
|
DialogActionButton(
|
2022-11-09 15:49:37 +00:00
|
|
|
text: actionButtonTitle,
|
|
|
|
isRed: true,
|
|
|
|
onPressed: actionButtonOnPressed,
|
|
|
|
),
|
2023-03-27 17:02:44 +00:00
|
|
|
DialogActionButton(
|
2022-11-09 15:49:37 +00:00
|
|
|
text: cancelButtonTitle ?? 'basis.cancel'.tr(),
|
|
|
|
onPressed: cancelButtonOnPressed,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|