chore(llc, core, ui): bump dio to ^5.2.0.
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -430,16 +430,15 @@ class StreamChannelState extends State<StreamChannel> {
|
||||
],
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasError) {
|
||||
var message = snapshot.error.toString();
|
||||
if (snapshot.error is DioError) {
|
||||
final dioError = snapshot.error as DioError?;
|
||||
if (dioError?.type == DioErrorType.badResponse) {
|
||||
message = dioError!.message ?? 'Bad response';
|
||||
} else {
|
||||
message = 'Check your connection and retry';
|
||||
final error = snapshot.error;
|
||||
if (error is DioException) {
|
||||
if (error.type == DioExceptionType.badResponse) {
|
||||
return Center(child: Text(error.message ?? 'Bad response'));
|
||||
}
|
||||
return const Center(child: Text('Check your connection and retry'));
|
||||
}
|
||||
return Center(child: Text(message));
|
||||
|
||||
return Center(child: Text(error.toString()));
|
||||
}
|
||||
|
||||
final dataLoaded = snapshot.data?.every((it) => it) == true;
|
||||
|
||||
@@ -91,8 +91,8 @@ void main() {
|
||||
);
|
||||
|
||||
const errorMessage = 'Error! Error! Error!';
|
||||
final error = DioError(
|
||||
type: DioErrorType.badResponse,
|
||||
final error = DioException(
|
||||
type: DioExceptionType.badResponse,
|
||||
message: errorMessage,
|
||||
requestOptions: RequestOptions(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user