Skip to content

Instantly share code, notes, and snippets.

@TobiCrackIT
Created May 24, 2022 11:34
Show Gist options
  • Save TobiCrackIT/be9228d99109aeee66b912dcb7f5b703 to your computer and use it in GitHub Desktop.
Save TobiCrackIT/be9228d99109aeee66b912dcb7f5b703 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:zoro/app/app.logger.dart';
import 'package:get/get.dart';
import 'package:zoro/ui/widgets/dialog/custom_dialog.dart';
class CustomDialogService {
final log = getLogger('CustomDialogService');
showCustomDialog({String? title, String? description,Function()? onPressed}) {
showDialog(
context: Get.overlayContext!,
barrierDismissible: true,
barrierColor: Color.fromRGBO(0, 0, 0, 0.4),
builder: (_) => CustomDialog(
title: title!,
description: description!,
onPositiveButtonPressed:onPressed ,
),
);
}
showAutoSaveDialog({String? title, String? description,Function()? onPressed}) {
showDialog(
context: Get.overlayContext!,
barrierDismissible: true,
barrierColor: Color.fromRGBO(0, 0, 0, 0.4),
builder: (_) => AutoSaveDialog(
title: title!,
description: description!,
onPositiveButtonPressed:onPressed ,
),
);
}
showWithdrawalDialog({String? title, String? description,Function()? onPressed}) {
showDialog(
context: Get.overlayContext!,
barrierDismissible: false,
barrierColor: Color.fromRGBO(0, 0, 0, 0.4),
builder: (_) => WithdrawalDialog(
title: title!,
description: description!,
onPositiveButtonPressed:onPressed ,
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment