initError method Null safety

dynamic initError()

Implementation

initError() {
  FlutterError.onError = (FlutterErrorDetails details) async {
    if (Dao.inst.isDebug == true) {
      print(
          'Exception: ${details.exception.toString()} \n\n StackTrace:${details.stack.toString()} \n\n ErrorBody: ${details.toString()}');
    } else {
      _liquidService.catchError(details.exception.toString());
      if (Dao.inst.errorAdminEmail != null) {
        _liquidService.sendMail(
            errorAdminEmail!,
            'App Error Email',
            'generalErrorHeader',
            'Exception: ${details.exception.toString()} \n\n StackTrace:${details.stack.toString()} \n\n ErrorBody: ${details.toString()}');
      }
    }
  };
}