From f52aed49fd124e185ffdfd58bb9bc4d37b52bc31 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Wed, 15 Jan 2025 10:29:29 +0300 Subject: [PATCH] WD: gradle changes --- android/app/build.gradle | 12 ++- android/build.gradle | 32 +++--- .../components/SearchByDoctor.dart | 99 ++++++++++--------- 3 files changed, 78 insertions(+), 65 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 98c75fbe..ad02325b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -78,7 +78,7 @@ android { targetSdkVersion 34 versionCode flutterVersionCode.toInteger() versionName flutterVersionName - multiDexEnabled true + multiDexEnabled false } sourceSets.main { @@ -99,6 +99,8 @@ android { debug { debuggable true signingConfig signingConfigs.debug + shrinkResources false + minifyEnabled false // ndk { // abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64' // } @@ -194,11 +196,11 @@ dependencies { annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' // implementation "com.mapbox.maps:android:10.16.6" - implementation 'com.mapbox.maps:android:11.3.1' +// implementation 'com.mapbox.maps:android:11.3.1' - implementation files('libs/PenNavUI.aar') - implementation files('libs/Penguin.aar') - implementation files('libs/PenguinRenderer.aar') +// implementation files('libs/PenNavUI.aar') +// implementation files('libs/Penguin.aar') +// implementation files('libs/PenguinRenderer.aar') // implementation "org.jetbrains.anko:anko-commons:0.10.4" implementation 'com.github.kittinunf.fuel:fuel:2.3.0' //for JVM diff --git a/android/build.gradle b/android/build.gradle index cc067af7..1f7a8c08 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -41,8 +41,9 @@ buildscript { classpath 'com.google.gms:google-services:4.3.8' // classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' classpath 'com.huawei.agconnect:agcp:1.5.2.300' + classpath("com.android.tools:r8:8.2.42") classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.12' - classpath "com.mapbox.gradle.plugins:access-token:0.4.0" +// classpath "com.mapbox.gradle.plugins:access-token:0.4.0" } } @@ -60,20 +61,21 @@ allprojects { maven { url "https://artifactory.ess-dev.com/artifactory/gradle-dev-local" } - maven { - url 'https://api.mapbox.com/downloads/v2/releases/maven' - - credentials { - username = 'mapbox' - password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg" - if (password == null || password == "") { - throw new GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the enviroment variables.") - } - } - authentication { - basic(BasicAuthentication) - } - } +// maven { +// url 'https://api.mapbox.com/downloads/v2/releases/maven' +// +// credentials { +// username = 'mapbox' +//// password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg" +// password = 'pk.eyJ1IjoicndhaWQiLCJhIjoiY2x5cGo4aHNjMGNsbTJyc2djempobGQxaSJ9.RCaC6WrUt4A4YnZNfxnONQ' +// if (password == null || password == "") { +// throw new GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the enviroment variables.") +// } +// } +// authentication { +// basic(BasicAuthentication) +// } +// } } } diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 07e1c1f8..4ff9f1af 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -52,7 +52,8 @@ class _SearchByDoctorState extends State { ), ), ), - inputWidget(TranslationBase.of(context).enterDocName, '', doctorNameController), + inputWidget(TranslationBase.of(context).enterDocName, '', + doctorNameController), ], ), ), @@ -84,7 +85,8 @@ class _SearchByDoctorState extends State { _searchDoctor(context); } }, - child: Text(TranslationBase.of(context).search, style: TextStyle(fontSize: 18.0, color: Colors.white)), + child: Text(TranslationBase.of(context).search, + style: TextStyle(fontSize: 18.0, color: Colors.white)), ), ), ); @@ -98,50 +100,50 @@ class _SearchByDoctorState extends State { var counter = 0; var isHmc = false; - List _patientDoctorAppointmentListHospital = []; + List _patientDoctorAppointmentListHospital = + []; - service.getDoctorsListByName(doctorNameController.text, languageID, context).then((res) async { + service + .getDoctorsListByName(doctorNameController.text, languageID, context) + .then((res) async { // GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { RegionList regionHospitalList = RegionList(); - if (res['DoctorList'].length != 0) { - res['DoctorList'].forEach((v) { - var reg = region[counter%4]; - counter++; - doctorsList.add(new DoctorList.fromJson(v, region: reg,isHMC: isHmc)); - isHmc = !isHmc; - }); - print('the counter is ${ - counter - }'); + if (res['DoctorList'].length != 0) { + res['DoctorList'].forEach((v) { + var reg = region[counter % 4]; + counter++; + doctorsList + .add(new DoctorList.fromJson(v, region: reg, isHMC: isHmc)); + isHmc = !isHmc; + }); + print('the counter is ${counter}'); + regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList); + regionHospitalList = + await DoctorMapper.sortList(true, regionHospitalList); - regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList); - regionHospitalList = await DoctorMapper.sortList(true, regionHospitalList); - -setState(() { - -}); - // doctorsList.forEach((element) { - // List doctorByHospital = - // _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList(); - // - // if (doctorByHospital.length != 0) { - // _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element); - // } else { - // _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList( - // filterName: element.getProjectCompleteName(), - // distanceInKMs: element.projectDistanceInKiloMeters.toString(), - // projectTopName: element.projectTopName, - // projectBottomName: element.projectBottomName, - // patientDoctorAppointment: element)); - // } - // }); - } else { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: res['ErrorSearchMsg']); - } + setState(() {}); + // doctorsList.forEach((element) { + // List doctorByHospital = + // _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList(); + // + // if (doctorByHospital.length != 0) { + // _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element); + // } else { + // _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList( + // filterName: element.getProjectCompleteName(), + // distanceInKMs: element.projectDistanceInKiloMeters.toString(), + // projectTopName: element.projectTopName, + // projectBottomName: element.projectBottomName, + // patientDoctorAppointment: element)); + // } + // }); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: res['ErrorSearchMsg']); + } GifLoaderDialogUtils.hideDialog(context); // navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital); @@ -173,23 +175,30 @@ setState(() { _searchDoctor(BuildContext context) { getDoctorsList(context); - context.read().analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text); + context + .read() + .analytics + .appointment + .book_appointment_doctor_search(query: doctorNameController.text); } navigateToSearchResults(context, RegionList regionHospitalList) { // Navigator.push(context, // FadePage(page: SearchResults(isLiveCareAppointment: false, isDoctorNameSearch: true, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital, isDoctorSearchResult: true,))); - Navigator.push(context, - FadePage(page: - SearchResultsByRegion( + Navigator.push( + context, + FadePage( + page: SearchResultsByRegion( doctorsList: [], - patientDoctorAppointmentListHospital:regionHospitalList, + patientDoctorAppointmentListHospital: regionHospitalList, isLiveCareAppointment: false, isDoctorSearchResult: true, ))); } - Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) { + Widget inputWidget( + String _labelText, String _hintText, TextEditingController _controller, + {String? prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), alignment: Alignment.center,