this is my complete code...
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class DialogHelper{
//show error dialog
static void showErrorDialog({String title='error',String description='Something went wrong'})
{
Get.dialog(
Dialog(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(title,style: Get.textTheme.headline4,),
Text(description,style: Get.textTheme.headline6,),
ElevatedButton(onPressed: () {
if (Get.isDialogOpen) Get.back();
},
child: Text('okay')),
],
),
),
),
);
}
}
And I got this error
19:25: Error: A value of type 'bool?' can't be assigned to a variable of type 'bool' because 'bool?' is nullable and 'bool' isn't. if (Get.isDialogOpen) Get.back();
I got error on the line if condition Get.isDialogOpen