Skip to content

Commit

Permalink
fixed fetch issue
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverbytes committed Jan 30, 2021
1 parent de04d16 commit 9cfe598
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
1 change: 1 addition & 0 deletions .fvm/flutter_sdk
3 changes: 3 additions & 0 deletions .fvm/fvm_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutterSdkVersion": "stable"
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dart.flutterSdkPath": "/Users/nemoryoliver/fvm/versions/stable"
}
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.10.0
COCOAPODS: 1.10.1
11 changes: 8 additions & 3 deletions lib/core/apis/base.api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,21 @@ class BaseAPI extends GetxController {
return Right(response.data);
} on dio.DioError catch (e) {
logger.e(
'dio error. function: $function, error: ${e.error}, data: ${e.response.data}');
if (e.response.data != null) {
'dio error. function: $function, error: ${e.error}, data: ${e.response?.data}');

if (e.response == null) {
return Left(ApiError(code: 1, message: 'Null Response'));
}

if (e.response?.data != null) {
return Left(ApiError.fromJson(e.response.data));
}

return Left(
ApiError(
code: 1,
message:
'Status: ${e.response.statusCode}, Error: ${e.error}, Data: ${e.response.data}',
'Status: ${e.response.statusCode}, Error: ${e.error}, Data: ${e.response?.data}',
),
);
} catch (e) {
Expand Down
15 changes: 4 additions & 11 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ packages:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.11"
version: "1.11.0"
build_runner_core:
dependency: transitive
description:
Expand Down Expand Up @@ -162,13 +162,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.3"
color:
dependency: transitive
description:
name: color
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
connectivity:
dependency: "direct main"
description:
Expand Down Expand Up @@ -334,7 +327,7 @@ packages:
name: flutter_native_splash
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.9"
version: "0.2.9"
flutter_spinkit:
dependency: "direct main"
description:
Expand Down Expand Up @@ -535,7 +528,7 @@ packages:
name: package_info
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3+2"
version: "0.4.3+4"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -946,7 +939,7 @@ packages:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
version: "4.5.1"
yaml:
dependency: transitive
description:
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
either_option: 1.0.6
#INFO
device_info: 1.0.0
package_info: 0.4.3+2
package_info: 0.4.3+4
#MEDIA
cached_network_image: 2.5.0
flutter_spinkit: 4.1.2+1
Expand All @@ -40,10 +40,10 @@ dependencies:

# DEVELOPER DEPENDENCIES
dev_dependencies:
build_runner: 1.10.11
build_runner: 1.11.0
flutter_launcher_icons: 0.8.1
hive_generator: 0.8.2
flutter_native_splash: 0.1.9
flutter_native_splash: 0.2.9

# SPLASH SCREEN GENERATOR
flutter_native_splash:
Expand Down

0 comments on commit 9cfe598

Please sign in to comment.