Olá pessoal,
Por alguma razão, minha classe 'HttṕException' não possui o atributo 'statusCode'. Isso pode ser resultado de alguma atualização do flutter?
Não encontrei outra forma de obté-lo atraves do erro capturado, então queira saber se essa outra forma existe.
I/flutter (11251):
I/flutter (11251): Response
I/flutter (11251): └> status code: 404
I/flutter (11251): └> headers: {content-type: application/json;charset=UTF-8, date: Wed, 28 Jul 2021 01:32:18 GMT, transfer-encoding: chunked}
I/flutter (11251): └> body:
I/flutter (11251): {
I/flutter (11251): "timestamp": "2021-07-28T01:32:18.849+0000",
I/flutter (11251): "status": 404,
I/flutter (11251): "error": "Not Found",
I/flutter (11251): "message": "No message available",
I/flutter (11251): "path": "/transactions1"
I/flutter (11251): }
I/flutter (11251):
E/flutter (11251): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: NoSuchMethodError: Class 'HttpException' has no instance getter 'statusCode'.
E/flutter (11251): Receiver: Instance of 'HttpException'
E/flutter (11251): Tried calling: statusCode
E/flutter (11251): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
E/flutter (11251): #1 _TransactionFormState._send.<anonymous closure> (package:bytebank_crashlytics/screens/transaction_form.dart:143:64)
E/flutter (11251): #2 _rootRunUnary (dart:async/zone.dart:1362:47)
E/flutter (11251): #3 _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (11251): #4 _FutureListener.handleError (dart:async/future_impl.dart:172:20)
E/flutter (11251): #5 Future._propagateToListeners.handleError (dart:async/future_impl.dart:719:47)
E/flutter (11251): #6 Future._propagateToListeners (dart:async/future_impl.dart:740:24)
E/flutter (11251): #7 Future._completeError (dart:async/future_impl.dart:550:5)
E/flutter (11251): #8 _completeOnAsyncError (dart:async-patch/async_patch.dart:274:13)
E/flutter (11251): #9 TransactionWebClient.save (package:bytebank_crashlytics/http/webclients/transaction_webclient.dart)
E/flutter (11251): <asynchronous suspension>
E/flutter (11251):