showWarningDialog function

void showWarningDialog(
  1. BuildContext context, {
  2. dynamic title,
  3. dynamic message,
  4. dynamic titlestye,
  5. dynamic messagestyle,
})

Implementation

void showWarningDialog(
  BuildContext context, {
  title,
  message,
  titlestye,
  messagestyle,
}) {
  showDialog(
    context: context,
    builder: (BuildContext context) {
      return AlertDialog(
        title: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            const Icon(Icons.warning, color: Colors.red),
            const SizedBox(width: 10),
            Text(
              title ?? "",
              style:
                  titlestye ??
                  const TextStyle(
                    fontSize: 16,
                    fontWeight: FontWeight.bold,
                    color: Colors.black,
                  ),
            ),
          ],
        ),
        content: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              message ?? "",
              style:
                  messagestyle ??
                  const TextStyle(
                    fontSize: 12,
                    fontWeight: FontWeight.w400,
                    color: Colors.black,
                  ),
              //"Your trial version has expired. Please upgrade to the full version to continue using the app."
            ),
            const SizedBox(height: 10),
            const Text("Contact : +91 89789 09666"),
          ],
        ),
        actions: <Widget>[
          FilledButton.icon(
            onPressed: () {
              Navigator.pop(context);
            },
            label: Text("Ok"),
          ),
        ],
      );
    },
    barrierDismissible: false,
    barrierLabel: "Warning",
  );
}