Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SPEC CHECKSUMS:
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
fluttertoast: 74526702fea2c060ea55dde75895b7e1bde1c86b
fluttertoast: eb263d302cc92e04176c053d2385237e9f43fad0
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
SDWebImage: b9a731e1d6307f44ca703b3976d18c24ca561e84
SwiftyGif: 6c3eafd0ce693cad58bb63d2b2fb9bacb8552780
Expand Down
4 changes: 3 additions & 1 deletion ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -200,6 +200,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -231,6 +232,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
16 changes: 8 additions & 8 deletions lib/vaahextendflutter/services/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Api {
}

// Here response error means server sends error response. eg 401: unauthorised
else if (error.type == DioErrorType.response) {
else if (error.type == DioErrorType.badResponse) {
await _handleResponseError(
error,
showAlert,
Expand Down Expand Up @@ -233,8 +233,8 @@ class Api {
}) async {
Response? response;
final Options options = await _getOptions();
options.sendTimeout = customTimeoutLimit ?? _config.timeoutLimit;
options.receiveTimeout = customTimeoutLimit ?? _config.timeoutLimit;
options.sendTimeout = Duration(milliseconds: customTimeoutLimit ?? _config.timeoutLimit);
options.receiveTimeout = Duration(milliseconds: customTimeoutLimit ?? _config.timeoutLimit);
if (headers != null && headers.isNotEmpty) {
if (options.headers != null) {
for (Map<String, String> element in headers) {
Expand Down Expand Up @@ -430,7 +430,7 @@ class Api {
bool showAlert,
String alertType,
) async {
if (error is DioError && error.type == DioErrorType.response) {
if (error is DioError && error.type == DioErrorType.badResponse) {
final Response<dynamic>? response = error.response;
try {
// By pass dio header error code to get response content
Expand Down Expand Up @@ -460,9 +460,9 @@ class Api {
error: res.statusMessage,
);
} catch (e) {
if (error.type == DioErrorType.response) {
if (error.type == DioErrorType.badResponse) {
String errorCode = 'unknown';
List<String> errors = [error.message];
List<String> errors = error.message == null ? [] : [error.message!];
String? debug;
if (error.response?.statusCode == 401) {
errorCode = 'unauthorized';
Expand Down Expand Up @@ -496,15 +496,15 @@ class Api {
if (Alerts.showErrorDialog != null) {
await Alerts.showErrorDialog!(
title: 'Error',
messages: errors,
messages: errors.isEmpty ? null : errors,
hint: debug,
);
return;
}
Console.danger(errors.toString());
_showDialog(
title: 'Error',
content: errors,
content: errors.isEmpty ? null : errors,
hint: debug,
);
} else {
Expand Down
Loading