showErrorDialog method

void showErrorDialog({
  1. required String title,
  2. required String content,
  3. Function? onClick,
})

Implementation

void showErrorDialog(
    {required String title, required String content, Function? onClick}) {
  // Nếu nhiều hơn 1 dialog sẽ đóng dialog cũ
  if (_numberDialog > 0) {
    Navigator.of(_context).pop();
  }
  CustomAwesomeDialog(
      context: _context,
      dialogType: DialogType.ERROR,
      animType: AnimType.BOTTOMSLIDE,
      title: title,
      dismissOnBackKeyPress: false,
      desc: content,
      btnCancel: _buildButton('OK', Colors.red, onClick: onClick),
      customHeader: _buildHeader(Icons.close, color: Colors.red))
    ..show();
  _numberDialog++;
}