import 'package:flutter/material.dart';

import 'AppPermissionHandler.dart';

Future<ConfirmAction?> showConfirmDialogs(
    context, msg, positiveText, negativeText) async {
  return showDialog<ConfirmAction>(
    context: context,
    barrierDismissible: false,
    builder: (context) {
      return AlertDialog(
        backgroundColor: Colors.white,
        title: Text(msg, style: TextStyle(fontSize: 16)),
        actions: <Widget>[
          TextButton(
            child: Text(
              negativeText,
            ),
            onPressed: () {
              Navigator.of(context).pop(ConfirmAction.CANCEL);
            },
          ),
          TextButton(
            child: Text(
              positiveText,
            ),
            onPressed: () {
              Navigator.of(context).pop(ConfirmAction.ACCEPT);
            },
          )
        ],
      );
    },
  );
}
