errorException method

Future<void> errorException(
  1. BuildContext context,
  2. dynamic error, {
  3. bool realyError = true,
})

Implementation

Future<void> errorException(BuildContext context, dynamic error,
    {bool realyError = true}) async {
  String message = 'Erro desconhecido';

  print(error.toString());

  message = error.toString();
  message = message.replaceAll('Exception:', '');

  try {
    return showDialog<void>(
      context: context,
      barrierDismissible: false,
      builder: (BuildContext context) {
        return OmegaErrorDialogWidget(
          description: message,
          textColor: OmegaLibConfig.dialogFieldStyle.textColor,
          bgColor: OmegaLibConfig.dialogFieldStyle.bgColor,
        );
      },
    );
  } catch (error) {
    print(error);
  }
}