showErrorDialog static method

void showErrorDialog({
  1. String? title = 'Error',
  2. String? desc = 'Something went wrong',
})

Implementation

static void showErrorDialog(
    {String? title = 'Error', String? desc = 'Something went wrong'}) {
  Get.dialog(
    Dialog(
      child: Padding(
        padding: const EdgeInsets.all(15.0),
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            Text(
              title ?? '',
              style: Get.textTheme.headline4,
            ),
            SizedBox(
              height: 10.0,
            ),
            Text(
              desc ?? '',
              style: Get.textTheme.headline6,
            ),
            SizedBox(
              height: 25.0,
            ),
            ElevatedButton(
              onPressed: () {
                if (Get.isDialogOpen == true) Get.back();
              },
              child: Text('Okay'),
            )
          ],
        ),
      ),
    ),
  );
}