File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
2626apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
2727
2828android {
29- compileSdkVersion flutter . compileSdkVersion
29+ compileSdkVersion 33
3030
3131 compileOptions {
3232 sourceCompatibility JavaVersion . VERSION_1_8
@@ -44,8 +44,8 @@ android {
4444 defaultConfig {
4545 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4646 applicationId " com.hoc.node_auth"
47- minSdkVersion flutter . minSdkVersion
48- targetSdkVersion flutter . targetSdkVersion
47+ minSdkVersion 21
48+ targetSdkVersion 33
4949 versionCode flutterVersionCode. toInteger()
5050 versionName flutterVersionName
5151 multiDexEnabled true
Original file line number Diff line number Diff line change @@ -28,8 +28,16 @@ class ApiService implements RemoteDataSource {
2828 rethrow ;
2929 } on SocketException catch (e, s) {
3030 throw RemoteDataSourceException ('No internet connection' , e, s);
31- } on SimpleHttpClientException catch (e, s) {
32- throw RemoteDataSourceException ('Http error' , e, s);
31+ } on SimpleTimeoutException catch (e, s) {
32+ throw RemoteDataSourceException ('Timeout error' , e, s);
33+ } on SimpleErrorResponseException catch (e, s) {
34+ String message;
35+ try {
36+ message = jsonDecode (e.errorResponseBody)['message' ] as String ;
37+ } catch (_) {
38+ message = 'Http error' ;
39+ }
40+ throw RemoteDataSourceException (message, e, s);
3341 } catch (e, s) {
3442 throw RemoteDataSourceException ('Other error' , e, s);
3543 }
You can’t perform that action at this time.
0 commit comments