From 8bdcfcb7647cfdac67ba96445112bfadb43e4247 Mon Sep 17 00:00:00 2001 From: devamirsaleemahmad Date: Thu, 9 Nov 2023 16:18:28 +0300 Subject: [PATCH] Changes & Latest Merges 3.3 --- lib/core/service/client/base_app_client.dart | 154 +++++++++--------- .../PackagesOffersServices.dart | 4 +- lib/pages/BookAppointment/BookSuccess.dart | 2 +- lib/pages/BookAppointment/QRCode.dart | 2 +- lib/pages/ToDoList/widgets/paymentDialog.dart | 67 ++++---- .../rate_appointment_doctor.dart | 2 +- pubspec.yaml | 4 +- 7 files changed, 116 insertions(+), 119 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 5cc3a1d4..03aee0a7 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -172,7 +172,7 @@ class BaseAppClient { onFailure!('Error While Fetching data', statusCode); logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); } else { - // var decoded = utf8.decode(response.bodyBytes); + // var decoded = utf8.decode(response.bodyBytes); var parsed = json.decode(utf8.decode(response.bodyBytes)); // print("Response: $parsed"); @@ -349,53 +349,53 @@ class BaseAppClient { final int statusCode = response.statusCode; // print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + onFailure!('Error While Fetching data', statusCode); logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); if (parsed['Response_Message'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } if (isAllowAny) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['MessageStatus'] == 1) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['Result'] == 'OK') { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, 'session logged out', statusCode); logout(); } } } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", statusCode); + onFailure!("Server Error found with no available message", statusCode); logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); } else { - onFailure(parsed['ErrorSearchMsg'], statusCode); + onFailure!(parsed['ErrorSearchMsg'], statusCode); logApiEndpointError(endPoint, parsed['ErrorSearchMsg'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } else { - onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } @@ -405,13 +405,13 @@ class BaseAppClient { //helpers.showErrorToast('Your session expired Please login agian'); } else { if (parsed['SameClinicApptList'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure(parsed['message'] ?? parsed['message'], statusCode); + onFailure!(parsed['message'] ?? parsed['message'], statusCode); logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } @@ -419,12 +419,12 @@ class BaseAppClient { } } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } catch (e) { print(e); - onFailure(e.toString(), -1); + onFailure!(e.toString(), -1); _analytics.errorTracking.log(endPoint, error: "api exception: $e"); } } @@ -438,9 +438,9 @@ class BaseAppClient { } get(String endPoint, - {Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - Map queryParams, + {Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, + Map? queryParams, bool isExternal = false, bool isRCService = false}) async { String url; @@ -469,24 +469,24 @@ class BaseAppClient { // print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + onFailure!('Error While Fetching data', statusCode); logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); } else { var parsed = json.decode(utf8.decode(response.bodyBytes)); - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } getPharmacy(String endPoint, - {Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, + {Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false, - Map queryParams}) async { + Map? queryParams}) async { var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); @@ -519,39 +519,39 @@ class BaseAppClient { if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode == 401) { - onFailure(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); + onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); logApiEndpointError(endPoint, TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); Navigator.of(AppGlobal.context).pushNamed(HOME); } else { var bodyUtf = json.decode(utf8.decode(response.bodyBytes)); // print(bodyUtf); - onFailure(bodyUtf['error']['ErrorEndUserMsg'], statusCode); + onFailure!(bodyUtf['error']['ErrorEndUserMsg'], statusCode); logApiEndpointError(endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode); } } else { // var parsed = json.decode(response.body.toString()); var bodyUtf = json.decode(utf8.decode(response.bodyBytes)); - onSuccess(bodyUtf, statusCode); + onSuccess!(bodyUtf, statusCode); } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } simplePost( String fullUrl, { - Map body, - Map headers, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, + Map? body, + Map? headers, + Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, }) async { String url = fullUrl; // print("URL Query String: $url"); // print("body: $body"); if (await Utils.checkConnection()) { - headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); + headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); final response = await http.post( Uri.parse(url.trim()), body: json.encode(body), @@ -564,19 +564,19 @@ class BaseAppClient { // print(response.body.toString()); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + onFailure!('Error While Fetching data', statusCode); logApiFullUrlError(fullUrl, 'Error While Fetching data', statusCode); } else { - onSuccess(response.body.toString(), statusCode); + onSuccess!(response.body.toString(), statusCode); } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } simpleGet(String fullUrl, - {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map queryParams, Map headers}) async { + {Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map? queryParams, Map? headers}) async { headers = headers ?? {}; String url = fullUrl; @@ -599,23 +599,23 @@ class BaseAppClient { if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleGet(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, queryParams: queryParams); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + onFailure!('Error While Fetching data', statusCode); logApiFullUrlError(fullUrl, 'Error While Fetching data', statusCode); } else { - onSuccess(response.body.toString(), statusCode); + onSuccess!(response.body.toString(), statusCode); } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } - simplePut(String fullUrl, {Map body, Map headers, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure}) async { + simplePut(String fullUrl, {Map? body, Map? headers, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async { String url = fullUrl; // print("URL Query String: $url"); if (await Utils.checkConnection()) { - headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); + headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); final response = await http.put( Uri.parse(url.trim()), body: json.encode(body), @@ -627,19 +627,19 @@ class BaseAppClient { if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePut(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, body: body); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + onFailure!('Error While Fetching data', statusCode); logApiFullUrlError(fullUrl, 'Error While Fetching data', statusCode); } else { - onSuccess(response.body.toString(), statusCode); + onSuccess!(response.body.toString(), statusCode); } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } simpleDelete(String fullUrl, - {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map queryParams, Map headers}) async { + {Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map? queryParams, Map? headers}) async { String url = fullUrl; // print("URL Query String: $url"); @@ -651,7 +651,7 @@ class BaseAppClient { } if (await Utils.checkConnection()) { - headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); + headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); final response = await http.delete( Uri.parse(url.trim()), headers: headers, @@ -662,18 +662,18 @@ class BaseAppClient { if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleDelete(fullUrl, onFailure: onFailure, onSuccess: onSuccess, queryParams: queryParams, headers: headers); if (statusCode < 200 || statusCode >= 400 || json == null) { - onFailure('Error While Fetching data', statusCode); + onFailure!('Error While Fetching data', statusCode); logApiFullUrlError(fullUrl, 'Error While Fetching data', statusCode); } else { - onSuccess(response.body.toString(), statusCode); + onSuccess!(response.body.toString(), statusCode); } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } - Future handleUnauthorized(int statusCode, {String forUrl}) async { + Future handleUnauthorized(int statusCode, {required String forUrl}) async { if (forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) { final token = await generatePackagesToken(); packagesAuthHeader['Authorization'] = 'Bearer $token'; @@ -690,7 +690,7 @@ class BaseAppClient { var model = Provider.of(AppGlobal.context, listen: false); _vitalSignService.weightKg = ""; _vitalSignService.heightCm = ""; - model.setState(0, false, null); + model.setState(0, false, ""); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } @@ -721,7 +721,7 @@ class BaseAppClient { } pharmacyPost(String endPoint, - {Map body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isExternal = false}) async { + {Map? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async { var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); String url; @@ -735,7 +735,7 @@ class BaseAppClient { String token = await sharedPref.getString(TOKEN); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var user = await sharedPref.getObject(USER_PROFILE); - if (body.containsKey('SetupID')) { + if (body!.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] @@ -807,48 +807,48 @@ class BaseAppClient { // print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { var parsed = json.decode(utf8.decode(response.bodyBytes)); - onFailure(parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); + onFailure!(parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); logApiEndpointError(endPoint, parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); if (parsed['Response_Message'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); } if (isAllowAny) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['MessageStatus'] == 1) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['Result'] == 'OK') { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logout(); } } } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", statusCode); + onFailure!("Server Error found with no available message", statusCode); logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); } else { - onFailure(parsed['ErrorSearchMsg'], statusCode); + onFailure!(parsed['ErrorSearchMsg'], statusCode); logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } else if (!parsed['IsAuthenticated']) { @@ -857,13 +857,13 @@ class BaseAppClient { //helpers.showErrorToast('Your session expired Please login agian'); } else { if (parsed['SameClinicApptList'] != null) { - onSuccess(parsed, statusCode); + onSuccess!(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure(parsed['message'] ?? parsed['message'], statusCode); + onFailure!(parsed['message'] ?? parsed['message'], statusCode); logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } @@ -871,12 +871,12 @@ class BaseAppClient { } } } else { - onFailure('Please Check The Internet Connection', -1); + onFailure!('Please Check The Internet Connection', -1); _analytics.errorTracking.log("internet_connectivity", error: "no internet available"); } } catch (e) { print(e); - onFailure(e.toString(), -1); + onFailure!(e.toString(), -1); logApiEndpointError(endPoint, e.toString(), -1); } } @@ -886,7 +886,7 @@ class BaseAppClient { var body = { "api_client": {"client_id": "a4ab6be4-424f-4836-b032-46caed88e184", "client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"} }; - String token; + String? token; final completer = Completer(); simplePost(url, body: body, headers: {}, onSuccess: (dynamic stringResponse, int statusCode) { if (statusCode == 200) { @@ -899,7 +899,7 @@ class BaseAppClient { logApiFullUrlError(url, error, statusCode); }); await completer.future; - return token; + return token!; } logApiFullUrlError(String fullUrl, error, code) { diff --git a/lib/core/service/packages_offers/PackagesOffersServices.dart b/lib/core/service/packages_offers/PackagesOffersServices.dart index 7c797192..5ee27ad1 100644 --- a/lib/core/service/packages_offers/PackagesOffersServices.dart +++ b/lib/core/service/packages_offers/PackagesOffersServices.dart @@ -274,7 +274,7 @@ class OffersAndPackagesServices extends BaseService { log(error); errorThrow = Future.error({"error": error, "statusCode": statusCode}); return errorThrow; - }, queryParams: null); + }, queryParams: Map()); } Future?> addProductToCart(AddProductToCartRequestModel request, {required BuildContext context, bool showLoading = true}) async { @@ -416,7 +416,7 @@ class OffersAndPackagesServices extends BaseService { _hideLoading(context, showLoading); errorThrow = Future.error(ResponseModel(status: false, error: error)); return errorThrow; - }, queryParams: null); + }, queryParams: Map()); } Future getHospitals({bool isResBasedOnLoc = true}) async { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 5cd67ae8..07d8bf95 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -998,7 +998,7 @@ class _BookSuccessState extends State { appointment.doctorTitle = "Dr. "; appointment.doctorNameObj = widget.patientShareResponse.doctorNameObj; appointment.doctorImageURL = widget.patientShareResponse.doctorImageURL; - appointment.doctorSpeciality = widget.patientShareResponse.doctorSpeciality; + appointment.doctorSpeciality = widget.patientShareResponse.doctorSpeciality as List; appointment.projectName = widget.patientShareResponse.projectName; appointment.projectID = widget.patientShareResponse.projectID; appointment.appointmentDate = widget.patientShareResponse.appointmentDate; diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index f35edc90..1844a3d6 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -48,7 +48,7 @@ class _QRCodeState extends State { bool _supportsNFC = false; late BuildContext _context; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override void initState() { diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index 24efd4d2..0f05dab0 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -35,10 +35,7 @@ class _PaymentDialogState extends State { //height: 550.0, width: 450.0, padding: EdgeInsets.all(21), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ + child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ Text( TranslationBase.of(context).invoiceDetails, style: TextStyle( @@ -114,38 +111,38 @@ class _PaymentDialogState extends State { ), ], ), - widget.isCashPatient - ? Column( - children: [ - mHeight(10.0), - Text( - TranslationBase.of(context).cashAmountUpdateInsurance, - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - ), - ), - mHeight(5.0), - DefaultButton( - TranslationBase.of(context).updateInsuranceText, - () { - Navigator.pop(context, null); - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute(builder: (context) => LandingPage()), - (Route route) => false, - ); - Navigator.push(context, FadePage(page: InsuranceUpdate())); - }, - color: Color(0xffEAA118), - textColor: Colors.white, + ), + widget.isCashPatient + ? Column( + children: [ + mHeight(10.0), + Text( + TranslationBase.of(context).cashAmountUpdateInsurance, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), ), - ], - ) - : Container(), - ], - ), + ), + mHeight(5.0), + DefaultButton( + TranslationBase.of(context).updateInsuranceText, + () { + Navigator.pop(context, null); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + color: Color(0xffEAA118), + textColor: Colors.white, + ), + ], + ) + : Container(), + ]), ), ); } diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 08a597ab..5bea3b63 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -20,7 +20,7 @@ class RateAppointmentDoctor extends StatefulWidget { bool isFromRegistration; - RateAppointmentDoctor({Key key, this.isFromRegistration = false}) : super(key: key); + RateAppointmentDoctor({Key? key, this.isFromRegistration = false}) : super(key: key); @override _RateAppointmentDoctorState createState() => _RateAppointmentDoctorState(); diff --git a/pubspec.yaml b/pubspec.yaml index eb1234b4..45d72049 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ description: A new Flutter application. version: 4.5.029+4050029 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=3.0.0 <3.13.0" dependencies: flutter: @@ -139,7 +139,7 @@ dependencies: flutter_tts: ^3.6.1 vibration: ^1.7.3 flutter_nfc_kit: ^3.3.1 - geofencing: ^0.1.0 + #geofencing: any speech_to_text: ^6.1.1 #in_app_update: ^4.2.2