From 6852ed87a9b900372b43533af6de6e2ee78cc7f5 Mon Sep 17 00:00:00 2001 From: Faiz Hashmi Date: Wed, 31 Jan 2024 11:49:48 +0300 Subject: [PATCH] Final testing after orientation --- .fvm/flutter_sdk | 1 + .fvm/fvm_config.json | 4 ++++ android/app/src/main/AndroidManifest.xml | 6 ++++-- lib/core/api.dart | 2 +- lib/core/base/base_app_client.dart | 12 ++++++------ lib/core/response_models/call_config_model.dart | 2 +- lib/core/response_models/patient_ticket_model.dart | 4 ++-- pubspec.lock | 8 -------- pubspec.yaml | 1 - 9 files changed, 19 insertions(+), 21 deletions(-) create mode 120000 .fvm/flutter_sdk create mode 100644 .fvm/fvm_config.json diff --git a/.fvm/flutter_sdk b/.fvm/flutter_sdk new file mode 120000 index 0000000..598eb2c --- /dev/null +++ b/.fvm/flutter_sdk @@ -0,0 +1 @@ +/Users/zik/fvm/versions/3.7.5 \ No newline at end of file diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json new file mode 100644 index 0000000..cdcbbc3 --- /dev/null +++ b/.fvm/fvm_config.json @@ -0,0 +1,4 @@ +{ + "flutterSdkVersion": "3.7.5", + "flavors": {} +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ee55fc8..5a6de5c 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -3,7 +3,8 @@ package="com.example.queuing_system"> - + + @@ -16,14 +17,15 @@ android:label="queuing_system"> + diff --git a/lib/core/api.dart b/lib/core/api.dart index f72e367..522ec06 100644 --- a/lib/core/api.dart +++ b/lib/core/api.dart @@ -29,7 +29,7 @@ class API { static getCallRequestInfoByClinicInfo(String deviceIp, {required Function(List, List, CallConfig callConfig) onSuccess, required Function(dynamic) onFailure}) async { final body = {"ipAdress": deviceIp, "apiKey": apiKey}; - bool isDevMode = true; + bool isDevMode = false; if (isDevMode) { final Map response = testPatientsData["data"] as Map; diff --git a/lib/core/base/base_app_client.dart b/lib/core/base/base_app_client.dart index a11ad4d..d90dd8d 100644 --- a/lib/core/base/base_app_client.dart +++ b/lib/core/base/base_app_client.dart @@ -11,7 +11,7 @@ class BaseAppClient { url = BASE_URL + endPoint; - try { + // try { log("URL : $url"); log("Body : ${json.encode(body)}"); if (await Utils.checkConnection()) { @@ -36,11 +36,11 @@ class BaseAppClient { onFailure('Please Check The Internet Connection', -1); } } - } catch (e) { - if (onFailure != null) { - onFailure(e.toString(), -1); - } - } + // } catch (e) { + // if (onFailure != null) { + // onFailure(e.toString(), -1); + // } + // } } static get(String endPoint, {Map? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async { diff --git a/lib/core/response_models/call_config_model.dart b/lib/core/response_models/call_config_model.dart index 449797b..ff1e98d 100644 --- a/lib/core/response_models/call_config_model.dart +++ b/lib/core/response_models/call_config_model.dart @@ -139,7 +139,7 @@ class CallConfig { callTypeVaccinationText = json['vaccinationText']; callTypeNebulizationText = json['nebulizationText']; textDirection = json['textDirection'] == 2 ? TextDirection.rtl : TextDirection.ltr; - screenRotationEnum = (json['orientationType'] as int).toScreenOrientationEnum(); + screenRotationEnum = ((json['orientationType'] ?? 1) as int).toScreenOrientationEnum(); // screenRotationEnum = (json['screenRotationId'] as int).toScreenOrientationEnum(); } diff --git a/lib/core/response_models/patient_ticket_model.dart b/lib/core/response_models/patient_ticket_model.dart index b23e0c7..671d83c 100644 --- a/lib/core/response_models/patient_ticket_model.dart +++ b/lib/core/response_models/patient_ticket_model.dart @@ -117,8 +117,8 @@ class PatientTicketModel { roomText = json['roomText']; queueNoText = json['queueNoText']; callForText = json['callForText']; - orientationType = json['orientationType']; - screenRotationEnum = (json['orientationType'] as int).toScreenOrientationEnum(); + orientationType = json['orientationType'] ?? 1; + screenRotationEnum = ((json['orientationType'] ?? 1) as int).toScreenOrientationEnum(); } // "voiceLanguage": 1, diff --git a/pubspec.lock b/pubspec.lock index 8ecea70..17d4c9f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -296,14 +296,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.0" - native_device_orientation: - dependency: "direct main" - description: - name: native_device_orientation - sha256: "744a03030fad5a332a54833cd34f1e2ee51ae9acf477b4ef85bacc8823af9937" - url: "https://pub.dev" - source: hosted - version: "1.2.1" nested: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 95e1a27..e3636e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,7 +47,6 @@ dependencies: signalr_core: ^1.1.1 intl: ^0.18.1 marquee: ^2.2.3 - native_device_orientation: ^1.2.1