Revert "formatted all files."

This reverts commit 04250ebc98.
This commit is contained in:
Faris Armoush
2025-06-12 16:04:49 +03:00
parent 218f43bacb
commit c642ba2644
473 changed files with 4335 additions and 5417 deletions

View File

@ -17,34 +17,34 @@ class ServerFailure extends Failure {
factory ServerFailure.fromDioError(DioException dioError) {
switch (dioError.type) {
case DioExceptionType.connectionTimeout:
return ServerFailure('Connection timeout with the Server.');
return ServerFailure("Connection timeout with the Server.");
case DioExceptionType.sendTimeout:
return ServerFailure('Send timeout with the Server.');
return ServerFailure("Send timeout with the Server.");
case DioExceptionType.receiveTimeout:
return ServerFailure('Receive timeout with the Server.');
return ServerFailure("Receive timeout with the Server.");
case DioExceptionType.badCertificate:
return ServerFailure('Bad certificate!');
return ServerFailure("Bad certificate!");
case DioExceptionType.badResponse:
{
// var document = parser.parse(dioError.response!.data.toString());
// var message = document.body!.text;
return ServerFailure.fromResponse(dioError.response!.statusCode,
dioError.response?.data['message'] ?? 'Error');
return ServerFailure.fromResponse(dioError.response!.statusCode!,
dioError.response?.data['message'] ?? "Error");
}
case DioExceptionType.cancel:
return ServerFailure('The request to ApiServer was canceled');
return ServerFailure("The request to ApiServer was canceled");
case DioExceptionType.connectionError:
return ServerFailure('No Internet Connection');
return ServerFailure("No Internet Connection");
case DioExceptionType.unknown:
return ServerFailure('Unexpected Error, Please try again!');
return ServerFailure("Unexpected Error, Please try again!");
default:
return ServerFailure('Unexpected Error, Please try again!');
return ServerFailure("Unexpected Error, Please try again!");
}
}
@ -54,9 +54,9 @@ class ServerFailure extends Failure {
case 403:
return ServerFailure(responseMessage);
case 400:
final errors = <String>[];
List<String> errors = [];
if (responseMessage is List) {
for (final error in responseMessage) {
for (var error in responseMessage) {
errors.add(error);
}
} else {
@ -64,11 +64,11 @@ class ServerFailure extends Failure {
}
return ServerFailure(errors.join('\n'));
case 404:
return ServerFailure('');
return ServerFailure("");
case 500:
return ServerFailure(responseMessage);
default:
return ServerFailure('Opps there was an Error, Please try again!');
return ServerFailure("Opps there was an Error, Please try again!");
}
}
}