From 1c19b36d2dbd617c1a80adacc01f069cfe75ce5b Mon Sep 17 00:00:00 2001 From: devamirsaleemahmad Date: Mon, 23 Oct 2023 11:03:01 +0300 Subject: [PATCH] models updates -> 3.13.6 --- .../model/er/AmbulanceRequestOrdersModel.dart | 4 +- .../Appointments/DoctorListResponse.dart | 2 +- lib/models/Appointments/DoctorProfile.dart | 2 +- .../DriveThroughTestingCenterModel.dart | 4 +- .../BookAppointment/DentalComplaints.dart | 4 +- lib/pages/BookAppointment/DoctorProfile.dart | 90 ++++++++------ lib/pages/BookAppointment/QRCode.dart | 35 +++--- lib/pages/BookAppointment/Search.dart | 8 +- lib/pages/BookAppointment/SearchResults.dart | 10 +- .../doctor_post_pre_images_page.dart | 2 +- .../ChildVaccines/add_newchild_page.dart | 24 ++-- lib/pages/ChildVaccines/child_page.dart | 70 +++-------- .../ChildVaccines/child_vaccines_page.dart | 10 +- .../dialogs/SelectGenderDialog.dart | 2 +- .../ChildVaccines/new/child_initial_page.dart | 11 +- .../ChildVaccines/new/child_vaccine_page.dart | 6 +- .../ChildVaccines/vaccinationtable_page.dart | 8 +- .../LiveChat/hospitalsLivechat_page.dart | 11 +- .../ContactUs/LiveChat/livechat_page.dart | 2 +- .../LiveChat/pharmaciesLivechat_page.dart | 2 +- lib/pages/ContactUs/contact_us_page.dart | 8 +- lib/pages/ContactUs/findus/findus_page.dart | 2 +- .../ContactUs/findus/hospitrals_page.dart | 2 +- .../ContactUs/findus/pharmacies_page.dart | 2 +- .../ContactUs/widgets/card_common_contat.dart | 2 +- .../Covid-DriveThru/Covid-TimeSlots.dart | 100 ++++++++------- .../covid-dirvethru-questions.dart | 16 +-- .../covid-drivethru-location.dart | 16 +-- .../Covid-DriveThru/covid-payment-alert.dart | 8 +- .../covid-payment-details.dart | 26 ++-- .../covid-payment-summary.dart | 114 +++++++++--------- .../DrawerPages/family/add-family-member.dart | 8 +- lib/pages/DrawerPages/family/my-family.dart | 28 ++--- .../notification_details_page.dart | 20 +-- .../notifications/notifications_page.dart | 14 +-- lib/pages/ErService/AmbulanceReq.dart | 2 +- .../AmbulanceRequestIndex.dart | 24 ++-- .../BillAmount.dart | 26 ++-- .../PickupLocation.dart | 112 ++++++++--------- .../SelectTransportationMethod.dart | 32 ++--- .../AmbulanceRequestIndexPages/Summary.dart | 18 +-- .../ErService/AvailableAppointmentsPage.dart | 14 +-- .../ErService/EdOnline/DdServicesPage.dart | 6 +- .../EdOnline/EdOnlineAgreementPage.dart | 12 +- .../ErService/EdOnline/EdOnlineNotesPage.dart | 18 +-- .../EdOnline/EdOnlineQuestionsPage.dart | 34 +++--- .../EdOnlineSelectedHospitalPage.dart | 14 +-- .../EdOnline/EdPaymentInformationPage.dart | 28 ++--- lib/pages/ErService/ErOptions.dart | 6 +- lib/pages/ErService/NearestEr.dart | 12 +- lib/pages/ErService/OrderLogPage.dart | 48 ++++---- .../rrt-agreement-page.dart | 2 +- .../rapid-response-team/rrt-logs-page.dart | 4 +- .../rapid-response-team/rrt-main-screen.dart | 12 +- .../rrt-order-list-item.dart | 25 ++-- .../rrt-pickup-address-page.dart | 31 ++--- .../rapid-response-team/rrt-place-order.dart | 34 +++--- .../rapid-response-team/rrt-request-page.dart | 12 +- .../ErService/widgets/AppointmentCard.dart | 8 +- lib/pages/ErService/widgets/StepsWidget.dart | 4 +- lib/pages/conference/clipped_video.dart | 8 +- .../conference/conference_button_bar.dart | 62 +++++----- lib/pages/conference/draggable_publisher.dart | 28 ++--- lib/pages/conference/participant_widget.dart | 24 ++-- .../web_rtc/widgets/cam_view_widget.dart | 28 ++--- .../web_rtc/widgets/draggable_cam.dart | 70 +++++------ .../widgets/button_to_progress.dart | 24 ++-- .../conference/widgets/circle_button.dart | 22 ++-- lib/pages/conference/widgets/noise_box.dart | 20 +-- .../widgets/platform_alert_dialog.dart | 12 +- .../platform_exception_alert_dialog.dart | 2 +- .../widgets/responsive_save_area.dart | 4 +- .../appointment_services/GetDoctorsList.dart | 4 +- lib/widgets/buttons/custom_text_button.dart | 26 ++-- .../data_display/medical/doctor_card.dart | 25 ++-- lib/widgets/hospital_location.dart | 4 +- 76 files changed, 784 insertions(+), 790 deletions(-) diff --git a/lib/core/model/er/AmbulanceRequestOrdersModel.dart b/lib/core/model/er/AmbulanceRequestOrdersModel.dart index 31407e44..6993183c 100644 --- a/lib/core/model/er/AmbulanceRequestOrdersModel.dart +++ b/lib/core/model/er/AmbulanceRequestOrdersModel.dart @@ -30,7 +30,7 @@ class AmbulanceRequestOrdersModel { String? branch; String? time; String? notes; - num? iD; + int? iD; num? patientId; num? patientOutSa; bool? isOutPatient; @@ -40,7 +40,7 @@ class AmbulanceRequestOrdersModel { dynamic latitude; dynamic appointmentNo; dynamic dischargeId; - num? statusId; + int? statusId; num? serviceId; num? channel; Orderpayment? orderpayment; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 1711576e..8c6ad3f6 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -7,7 +7,7 @@ class DoctorList { String? name; int? projectID; String? projectName; - num? actualDoctorRate; + int? actualDoctorRate; num? clinicRoomNo; dynamic date; dynamic appointmentDate; diff --git a/lib/models/Appointments/DoctorProfile.dart b/lib/models/Appointments/DoctorProfile.dart index 19f287e8..b78281a5 100644 --- a/lib/models/Appointments/DoctorProfile.dart +++ b/lib/models/Appointments/DoctorProfile.dart @@ -39,7 +39,7 @@ class DoctorProfileList { String? doctorTitleForProfile; bool? isAppointmentAllowed; String? nationalityFlagURL; - num? noOfPatientsRate; + int? noOfPatientsRate; String? qR; num? serviceID; diff --git a/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart b/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart index f976c9bc..4f528424 100644 --- a/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart +++ b/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart @@ -9,8 +9,8 @@ class DriveThroughTestingCenterModel { bool? isActive; int? createdBy; String? createdOn; - num? testTypeEnum; - num? testProcedureEnum; + int? testTypeEnum; + int? testProcedureEnum; dynamic editedBy; dynamic editedON; dynamic projectName; diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index d9fd9f7f..7e89024b 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -24,10 +24,10 @@ import 'package:provider/provider.dart'; class DentalComplaints extends StatefulWidget { SearchInfo searchInfo; - Function onSelectedMethod; + Function? onSelectedMethod; bool isDoctorNameSearch; - DentalComplaints({required this.searchInfo, required this.onSelectedMethod, this.isDoctorNameSearch = false}); + DentalComplaints({required this.searchInfo, this.onSelectedMethod, this.isDoctorNameSearch = false}); @override _DentalComplaintsState createState() => _DentalComplaintsState(); diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 058fb650..7d1a3e7a 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -26,8 +26,8 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:provider/provider.dart'; -import 'package:rating_bar/rating_bar.dart'; import 'BookConfirm.dart'; import 'components/DocAvailableAppointments.dart'; @@ -40,22 +40,22 @@ class DoctorProfile extends StatefulWidget { bool isLiveCareAppointment; bool isDoctorNameSearch; - DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false}); + DoctorProfile({required this.doctor, required this.docProfileList, required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false}); - AuthenticatedUser authUser; + late AuthenticatedUser authUser; @override _DoctorProfileState createState() => _DoctorProfileState(); } class _DoctorProfileState extends State with TickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; bool showFooterButton = false; var event = RobotProvider(); dynamic doctorSchedule; AppSharedPreferences sharedPref = AppSharedPreferences(); - List doctorDetailsList =[]; + List doctorDetailsList = []; @override void initState() { @@ -67,13 +67,13 @@ class _DoctorProfileState extends State with TickerProviderStateM super.initState(); } - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); return AppScaffold( - appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name, + appBarTitle: widget.doctor.doctorTitle! + " " + widget.doctor.name!, isShowAppBar: true, isShowDecPage: false, showNewAppBar: true, @@ -111,18 +111,18 @@ class _DoctorProfileState extends State with TickerProviderStateM children: [ DoctorHeader( headerModel: HeaderModel( - widget.doctor.name, - widget.doctor.doctorID, - widget.doctor.doctorImageURL, - widget.doctor.speciality, + widget.doctor.name!, + widget.doctor.doctorID!, + widget.doctor.doctorImageURL!, + widget.doctor.speciality!, "", - widget.doctor.projectName, + widget.doctor.projectName!, null, null, - widget.doctor.nationalityFlagURL, + widget.doctor.nationalityFlagURL!, widget.doctor.doctorRate, - widget.doctor.actualDoctorRate, - widget.docProfileList.noOfPatientsRate, + widget.doctor.actualDoctorRate!, + widget.docProfileList.noOfPatientsRate!, "", decimalDoctorRate: widget.docProfileList.decimalDoctorRate.toString(), ), @@ -151,7 +151,7 @@ class _DoctorProfileState extends State with TickerProviderStateM }, buttonTitle: TranslationBase.of(context).schedule, ), - mDivider(Colors.grey[300]), + mDivider(Colors.grey[300]!), if (widget.docProfileList.isDoctorHasPrePostImages == true) Container(height: 50, alignment: Alignment.center, child: prePostImagesButton(context)), TabBar( onTap: (index) { @@ -234,7 +234,7 @@ class _DoctorProfileState extends State with TickerProviderStateM getDoctorRatings() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { + service.getDoctorsRating(widget.doctor.doctorID!, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['NotesDoctorRatingList']); @@ -251,7 +251,7 @@ class _DoctorProfileState extends State with TickerProviderStateM getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) { + service.getDoctorsRatingDetails(widget.doctor.doctorID!, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { doctorDetailsList.clear(); @@ -319,19 +319,37 @@ class _DoctorProfileState extends State with TickerProviderStateM padding: EdgeInsets.all(10.0), child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), Container( - margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.doctor.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), + margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.doctor.actualDoctorRate!.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), Container( margin: EdgeInsets.only(top: 5.0), alignment: Alignment.center, - child: RatingBar.readOnly( - initialRating: this.widget.doctor.actualDoctorRate.toDouble(), - size: 35.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, + // child: RatingBar.readOnly( + // initialRating: this.widget.doctor.actualDoctorRate!.toDouble(), + // size: 35.0, + // filledColor: Colors.yellow[700], + // emptyColor: Colors.grey[500], + // isHalfAllowed: true, + // halfFilledIcon: Icons.star_half, + // filledIcon: Icons.star, + // emptyIcon: Icons.star, + // ), + child: RatingBar( + initialRating: this.widget.doctor.actualDoctorRate!.toDouble(), + ratingWidget: RatingWidget( + full: Icon( + Icons.star, + color: Color(0XFFD02127), + ), + half: Icon( + Icons.star_half, + color: Color(0XFFD02127), + ), + empty: Icon( + Icons.star_border, + color: Color(0XFFD02127), + ), + ), + onRatingUpdate: (double value) {}, ), ), Container( @@ -473,11 +491,13 @@ class _DoctorProfileState extends State with TickerProviderStateM barrierDismissible: true, barrierLabel: '', context: context, - pageBuilder: (context, animation1, animation2) {}); + pageBuilder: (context, animation1, animation2){ + return SizedBox(); + }); } double getRatingWidth(int patientNumber) { - var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100; + var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate!) * 100; return width; } @@ -497,12 +517,12 @@ class _DoctorProfileState extends State with TickerProviderStateM // } else { if (DocAvailableAppointments.areSlotsAvailable) { if (projectViewModel.isLogin) { - if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user.age > 12) { + if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) { navigateToDentalComplaints(context); } else { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; navigateToBookConfirm(context); - projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); + projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor); } } else { ConfirmDialog dialog = new ConfirmDialog( @@ -558,9 +578,9 @@ class _DoctorProfileState extends State with TickerProviderStateM page: BookConfirm( doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment, - selectedDate: DocAvailableAppointments.selectedDate, - selectedTime: DocAvailableAppointments.selectedTime, - initialSlotDuration: DocAvailableAppointments.initialSlotDuration, + selectedDate: DocAvailableAppointments.selectedDate!, + selectedTime: DocAvailableAppointments.selectedTime!, + initialSlotDuration: DocAvailableAppointments.initialSlotDuration!, ), ), ); diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 0b84fb7d..770c8454 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -32,7 +32,7 @@ class QRCode extends StatefulWidget { AuthenticatedUser? authUser; AppSharedPreferences sharedPref = AppSharedPreferences(); - QRCode({required this.patientShareResponse, required this.appoQR, required this.appointment}); + QRCode({required this.patientShareResponse, required this.appoQR, this.appointment}); @override _QRCodeState createState() => _QRCodeState(); @@ -89,17 +89,17 @@ class _QRCodeState extends State { children: [ DoctorHeader( headerModel: HeaderModel( - widget.appointment!.doctorTitle + " " + widget.appointment!.doctorNameObj, - widget.appointment!.doctorID, - widget.appointment!.doctorImageURL, - widget.appointment!.doctorSpeciality, + widget.appointment!.doctorTitle! + " " + widget.appointment!.doctorNameObj!, + widget.appointment!.doctorID!, + widget.appointment!.doctorImageURL!, + widget.appointment!.doctorSpeciality!, "", - widget.appointment!.projectName, - DateUtil.convertStringToDate(widget.appointment!.appointmentDate), - widget.appointment!.isLiveCareAppointment - ? DateUtil.convertStringToDate(widget.appointment!.appointmentDate).toString().split(" ")[1].substring(0, 5) - : widget.appointment!.startTime.substring(0, 5), - null, + widget.appointment!.projectName!, + DateUtil.convertStringToDate(widget.appointment!.appointmentDate!), + widget.appointment!.isLiveCareAppointment! + ? DateUtil.convertStringToDate(widget.appointment!.appointmentDate!).toString().split(" ")[1].substring(0, 5) + : widget.appointment!.startTime!.substring(0, 5), + "null", widget.appointment!.doctorRate, widget.appointment!.actualDoctorRate, widget.appointment!.noOfPatientsRate, @@ -125,11 +125,11 @@ class _QRCodeState extends State { showNfcReader(context, onNcfScan: (String nfcId) { Future.delayed(const Duration(milliseconds: 100), () { sendNfcCheckInRequest(nfcId); - locator().todoList.to_do_list_nfc(widget.appointment); + locator().todoList.to_do_list_nfc(widget.appointment!); }); }, onCancel: () { // Navigator.of(context).pop(); - locator().todoList.to_do_list_nfc_cancel(widget.appointment); + locator().todoList.to_do_list_nfc_cancel(widget.appointment!); }); }, ), @@ -197,14 +197,15 @@ class _QRCodeState extends State { ConfirmDialog dialog = new ConfirmDialog( context: context, - confirmMessage: "Send a copy of this QR to the email " + widget.authUser.emailAddress + "?", + confirmMessage: "Send a copy of this QR to the email " + widget.authUser!.emailAddress! + "?", okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () { GifLoaderDialogUtils.showMyDialog(context); service - .sendAppointmentQREmail(widget.authUser.emailAddress, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo.toString(), - widget.patientShareResponse.doctorNameObj, widget.patientShareResponse.projectName, widget.appoQR, getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), context) + .sendAppointmentQREmail(widget.authUser!.emailAddress!, widget.patientShareResponse!.appointmentDate!, widget.patientShareResponse!.appointmentNo!.toString(), + //Changed By Aamir + widget.patientShareResponse!.doctorNameObj, widget.patientShareResponse!.projectName, widget.appoQR!, getDoctorSpeciality(widget.patientShareResponse!.doctorSpeciality as List), context) .then((res) { GifLoaderDialogUtils.hideDialog(context); ConfirmDialog.closeAlertDialog(context); @@ -263,7 +264,7 @@ class _QRCodeState extends State { DoctorsListService service = new DoctorsListService(); - service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) { + service.sendCheckinNfcRequest(widget.patientShareResponse!.appointmentNo!, nfcId, widget.patientShareResponse!.projectID!, context).then((res) { print(res); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index c47d5aaa..c0f842b7 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -14,8 +14,8 @@ import 'components/SearchByClinic.dart'; class Search extends StatefulWidget { final int type; - final List clnicIds; - Function onBackClick; + final List? clnicIds; + VoidCallbackAction? onBackClick; Search({this.type = 0, this.clnicIds, this.onBackClick}); @@ -24,7 +24,7 @@ class Search extends StatefulWidget { } class _SearchState extends State with TickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; @override void initState() { @@ -79,7 +79,7 @@ class _SearchState extends State with TickerProviderStateMixin { child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - SearchByClinic(clnicIds: widget.clnicIds), + SearchByClinic(clnicIds: widget.clnicIds!), SearchByDoctor(), ], controller: _tabController, diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 3d95a694..987c5dde 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -18,7 +18,7 @@ class SearchResults extends StatefulWidget { bool isDoctorNameSearch; OBGyneProcedureListResponse obGyneProcedureListResponse; - SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, @required this.isLiveCareAppointment, this.obGyneProcedureListResponse}); + SearchResults({required this.doctorsList, required this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, required this.isLiveCareAppointment, required this.obGyneProcedureListResponse}); @override _SearchResultsState createState() => _SearchResultsState(); @@ -26,7 +26,7 @@ class SearchResults extends StatefulWidget { class _SearchResultsState extends State { List tempList = []; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -49,7 +49,7 @@ class _SearchResultsState extends State { itemBuilder: (context, index) { return AppExpandableNotifier( title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") - ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km + ? widget.patientDoctorAppointmentListHospital[index].filterName! + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs! + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, isTitleSingleLine: false, isExpand: widget.patientDoctorAppointmentListHospital.length == 1 ? true : false, @@ -58,7 +58,7 @@ class _SearchResultsState extends State { physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), itemBuilder: (context, _index) { - final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index]; + final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList![_index]; return DoctorView( doctor: doctor, isLiveCareAppointment: widget.isLiveCareAppointment, @@ -70,7 +70,7 @@ class _SearchResultsState extends State { }); }, separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length), + itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList!.length), ); }, itemCount: widget.patientDoctorAppointmentListHospital.length, diff --git a/lib/pages/BookAppointment/doctor_post_pre_images_page.dart b/lib/pages/BookAppointment/doctor_post_pre_images_page.dart index eddae9d2..f3cdc0c5 100644 --- a/lib/pages/BookAppointment/doctor_post_pre_images_page.dart +++ b/lib/pages/BookAppointment/doctor_post_pre_images_page.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; class DoctorPostPreImagesContent extends StatefulWidget { final DoctorPrePostImages doctorPrePostImages; - const DoctorPostPreImagesContent({this.doctorPrePostImages}); + const DoctorPostPreImagesContent({required this.doctorPrePostImages}); @override DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState(); diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index fc5d2605..bbd292fb 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -19,19 +19,19 @@ enum Gender { Male, Female, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } class AddNewChildPage extends StatefulWidget { - final int frequency; - final int days; - final String itemDescription; - String dateAdd; + final int? frequency; + final int? days; + final String? itemDescription; + String? dateAdd; List _scheduleList =[]; List daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday]; - DateTime startDay; - DateTime endDay; + DateTime? startDay; + DateTime? endDay; //AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); - AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) { + AddNewChildPage({Key? key, this.frequency, this.days, this.itemDescription}) { startDay = DateTime.now(); endDay = DateTime.now(); //endDay = DateTime.now().add(Duration(days: days)); int hour = 24; //(24 / frequency).round(); @@ -46,8 +46,8 @@ class AddNewChildPage extends StatefulWidget { } class _AddNewChildPageState extends State { - int tappedIndex; - int checkedValue; + late int tappedIndex; + late int checkedValue; @override void initState() { @@ -278,11 +278,11 @@ class _AddNewChildPageState extends State { } String getStartDay() { - return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; + return "${DateUtil.getMonth(widget.startDay!.month)} ${widget.startDay!.day}, ${widget.startDay!.year}"; } String getEndDay() { - return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; + return "${DateUtil.getMonth(widget.endDay!.month)} ${widget.endDay!.day}, ${widget.endDay!.year}"; } String getDateTime(DateTime dateTime) { @@ -313,7 +313,7 @@ class _AddNewChildPageState extends State { } Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, - {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { + {VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines, bool isInputTypeNum = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), alignment: Alignment.center, diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index fad0b0c2..a5b65067 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -18,8 +18,7 @@ class ChildPage extends StatefulWidget { _ChildPageState createState() => _ChildPageState(); } -class _ChildPageState extends State - with SingleTickerProviderStateMixin { +class _ChildPageState extends State with SingleTickerProviderStateMixin { DeleteBaby deleteBaby = DeleteBaby(); @override @@ -57,20 +56,16 @@ class _ChildPageState extends State Navigator.push( context, FadePage( - page: VaccinationTablePage(model - .babyInformationModelList[index]), + page: VaccinationTablePage(model.babyInformationModelList[index]), ), ); }, child: Container( - margin: EdgeInsets.only( - left: 0, right: 0, bottom: 20), + margin: EdgeInsets.only(left: 0, right: 0, bottom: 20), decoration: BoxDecoration( shape: BoxShape.rectangle, - border: Border.all( - color: Colors.white, width: 0.5), - borderRadius: - BorderRadius.all(Radius.circular(5)), + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), color: Colors.white, ), padding: EdgeInsets.all(12), @@ -78,24 +73,14 @@ class _ChildPageState extends State child: Column( children: [ Row(children: [ - Texts(TranslationBase.of(context) - .childName), + Texts(TranslationBase.of(context).childName), ]), Row(children: [ - Texts(model - .babyInformationModelList[index] - .babyName - .trim()), + Texts(model.babyInformationModelList[index].babyName!.trim()), ]), Row(children: [ IconButton( - icon: Image.asset(model - .babyInformationModelList[ - index] - .gender == - 1 - ? 'assets/images/new-design/male.png' - : 'assets/images/new-design/female.png'), + icon: Image.asset(model.babyInformationModelList[index].gender == 1 ? 'assets/images/new-design/male.png' : 'assets/images/new-design/female.png'), tooltip: '', onPressed: () { setState(() { @@ -104,9 +89,7 @@ class _ChildPageState extends State }); }, ), - Texts(model - .babyInformationModelList[index] - .genderDescription), + Texts(model.babyInformationModelList[index].genderDescription), IconButton( icon: Icon( Icons.remove_red_eye, @@ -117,9 +100,7 @@ class _ChildPageState extends State Navigator.push( context, FadePage( - page: VaccinationTablePage(model - .babyInformationModelList[ - index]), + page: VaccinationTablePage(model.babyInformationModelList[index]), ), ); }, @@ -130,47 +111,34 @@ class _ChildPageState extends State ]), Row(children: [ IconButton( - icon: new Image.asset( - 'assets/images/new-design/calender-secondary.png'), + icon: new Image.asset('assets/images/new-design/calender-secondary.png'), tooltip: '', onPressed: () { setState(() {}); }, ), - Texts(DateUtil.yearMonthDay(model - .babyInformationModelList[index] - .dOB)), + Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB!)), ]), Row(children: [ IconButton( - icon: new Image.asset( - 'assets/images/new-design/garbage.png'), + icon: new Image.asset('assets/images/new-design/garbage.png'), tooltip: '', onPressed: () async { //===================== - await model.deleteBabyOrders( - newChild: deleteBaby); + await model.deleteBabyOrders(newChild: deleteBaby); - deleteBaby.babyID = model - .babyInformationModelList[index] - .babyID; + deleteBaby.babyID = model.babyInformationModelList[index].babyID; - await model.deleteBabyOrders( - newChild: deleteBaby); + await model.deleteBabyOrders(newChild: deleteBaby); if (model.isDeleted) { - AppToast.showSuccessToast( - message: TranslationBase.of( - context) - .recordDeleted); - Navigator.pop( - context, model.isDeleted); + AppToast.showSuccessToast(message: TranslationBase.of(context).recordDeleted); + Navigator.pop(context, model.isDeleted); } else { //TODO handling error } }, ), - Texts(TranslationBase.of(context) - .deleteView), + Texts(TranslationBase.of(context).deleteView), ]), SizedBox( height: 12, diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index f70fe64d..5d6a62ea 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -86,20 +86,20 @@ class _ChildVaccinesPageState extends State with SingleTicker margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( fillColor: Colors.red, - hintText: model.user != null ? model.user.emailAddress : "", + hintText: model.user != null ? model.user!.emailAddress : "", controller: titleController, fontSize: 20, hintColor: Colors.black, fontWeight: FontWeight.w600, onChanged: (text) { addEmail = text; - model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true; + model.user!.emailAddress == addEmail ? checkedValue = false : checkedValue = true; }, validator: (value) { if (value == null) { - return model.user.emailAddress; + return model.user!.emailAddress; } else { - return model.user.emailAddress; + return model.user!.emailAddress; } }, ), @@ -122,7 +122,7 @@ class _ChildVaccinesPageState extends State with SingleTicker label: TranslationBase.of(context).updateEmail, // onTap: () { - model.user.emailAddress = addEmail.toString(); + model.user!.emailAddress = addEmail.toString(); AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg); // bloodDetails.city=_selectedHospital.toString(); diff --git a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 40d8d1fa..92bd248e 100644 --- a/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -7,7 +7,7 @@ class SelectGenderDialog extends StatefulWidget { final Email; final Function okFunction; - const SelectGenderDialog({Key key, this.Email, this.okFunction}) + const SelectGenderDialog({Key? key, this.Email, required this.okFunction}) : super(key: key); @override diff --git a/lib/pages/ChildVaccines/new/child_initial_page.dart b/lib/pages/ChildVaccines/new/child_initial_page.dart index a0deec0c..127611dc 100644 --- a/lib/pages/ChildVaccines/new/child_initial_page.dart +++ b/lib/pages/ChildVaccines/new/child_initial_page.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -77,7 +78,7 @@ class _ChildVaccinesPageState extends State with SingleTickerP ), TextFields( fillColor: Colors.red, - hintText: model.user != null ? model.user.emailAddress : "", + hintText: model.user != null ? model.user!.emailAddress : "", controller: titleController, fontSize: 14, hintColor: Colors.black, @@ -90,13 +91,13 @@ class _ChildVaccinesPageState extends State with SingleTickerP }, onChanged: (text) { addEmail = text; - model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true; + model.user!.emailAddress == addEmail ? checkedValue = false : checkedValue = true; }, validator: (value) { if (value == null) { - return model.user.emailAddress; + return model.user!.emailAddress; } else { - return model.user.emailAddress; + return model.user!.emailAddress; } }, ), @@ -117,7 +118,7 @@ class _ChildVaccinesPageState extends State with SingleTickerP label: TranslationBase.of(context).updateEmail, // onTap: () { - model.user.emailAddress = addEmail.toString(); + model.user!.emailAddress = addEmail.toString(); AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg); // bloodDetails.city=_selectedHospital.toString(); diff --git a/lib/pages/ChildVaccines/new/child_vaccine_page.dart b/lib/pages/ChildVaccines/new/child_vaccine_page.dart index 4d8b878c..ddbbf198 100644 --- a/lib/pages/ChildVaccines/new/child_vaccine_page.dart +++ b/lib/pages/ChildVaccines/new/child_vaccine_page.dart @@ -85,7 +85,7 @@ class _ChildPageState extends State with SingleTickerProviderS mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - model.babyInformationModelList[index].babyName.trim(), + model.babyInformationModelList[index].babyName!.trim(), style: TextStyle( fontSize: 14, letterSpacing: -0.46, @@ -94,7 +94,7 @@ class _ChildPageState extends State with SingleTickerProviderS ), ), Text( - model.babyInformationModelList[index].genderDescription, + model.babyInformationModelList[index].genderDescription!, style: TextStyle( fontSize: 11, color: selectedColor, @@ -109,7 +109,7 @@ class _ChildPageState extends State with SingleTickerProviderS color: selectedColor, ), ), - Text(" " + DateUtil.getDayMonthYearDateFormatted(model.babyInformationModelList[index].dOB), + Text(" " + DateUtil.getDayMonthYearDateFormatted(model.babyInformationModelList[index].dOB!), style: TextStyle( fontSize: 11, color: selectedColor, diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 9aa7b6c0..c909875c 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -58,7 +58,7 @@ class VaccinationTablePage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - babyInfo.babyName, + babyInfo.babyName!, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -100,7 +100,7 @@ class VaccinationTablePage extends StatelessWidget { ), ), Text( - DateUtil.getFormattedDate(babyInfo.dOB, "MMM dd,yyyy"), + DateUtil.getFormattedDate(babyInfo.dOB!, "MMM dd,yyyy"), style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, @@ -183,13 +183,13 @@ class VaccinationTablePage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(diabtec.visit, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(diabtec.visit!, isCapitable: false, mProjectViewModel: projectViewModel), // Utils.tableColumnValue(diabtec.vaccinesDescription, isCapitable: false, mProjectViewModel: projectViewModel), Html( // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription data: diabtec.vaccinesDescription, ), - Utils.tableColumnValue(diabtec.givenAt, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(diabtec.givenAt!, isCapitable: false, mProjectViewModel: projectViewModel), ], ), ); diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index ceab7e45..6abd177c 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -15,8 +15,8 @@ class HospitalsLiveChatPage extends StatefulWidget { } class _HospitalsLiveChatPageState extends State { - int tappedIndex; - String chat; + int? tappedIndex; + String? chat; @override void initState() { @@ -63,7 +63,7 @@ class _HospitalsLiveChatPageState extends State { setState(() { tappedIndex = index; chat = - "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; + "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user!.firstName}&PatientID=${model.user!.patientID}&MobileNo=${model.user!.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; }); }, child: Container( @@ -108,9 +108,10 @@ class _HospitalsLiveChatPageState extends State { padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).start, - chat.isEmpty ? null : () => {launch(chat)}, + //Changed By Aamir URL + chat!.isEmpty ? null : () => {launch(chat!)}, color: Color(0xffD02127), - textColor: chat.isEmpty ? Color(0xff000000) : Colors.white, + textColor: chat!.isEmpty ? Color(0xff000000) : Colors.white, disabledColor: Color(0xffEAEAEA), ), ), diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index 5407b251..4d5c9c88 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -13,7 +13,7 @@ class LiveChatPage extends StatefulWidget { } class _LiveChatPageState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; List imagesInfo =[]; @override diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index 2d99054e..e5b0647a 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -10,7 +10,7 @@ import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class PharmaciesLiveChatPage extends StatelessWidget { - PharmaciesLiveChatPage({Key key}) : super(key: key); + PharmaciesLiveChatPage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { diff --git a/lib/pages/ContactUs/contact_us_page.dart b/lib/pages/ContactUs/contact_us_page.dart index f30839f4..2334b00f 100644 --- a/lib/pages/ContactUs/contact_us_page.dart +++ b/lib/pages/ContactUs/contact_us_page.dart @@ -15,7 +15,7 @@ class ContactUsPage extends StatefulWidget { } class _ContactUsPageState extends State { - LocationUtils locationUtils; + late LocationUtils locationUtils; @override void initState() { @@ -72,7 +72,7 @@ class _ContactUsPageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).findUs, imagePath: 'assets/images/new-design/find_us_icon.png', - subTitle: null, + subTitle: "", isPngImage: true, ), )); @@ -85,7 +85,7 @@ class _ContactUsPageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).feedback, imagePath: 'assets/images/new-design/feedback_icon.png', - subTitle: null, + subTitle: "", isPngImage: true, ), )); @@ -98,7 +98,7 @@ class _ContactUsPageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).liveChat, imagePath: 'assets/images/new-design/live_chat_icon.png', - subTitle: null, + subTitle: "", isPngImage: true, ), )); diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 882ee506..78bb4e7e 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -15,7 +15,7 @@ class FindUsPage extends StatefulWidget { } class _FindUsPageState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; @override void initState() { super.initState(); diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 106ecb0d..6f48deb6 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -7,7 +7,7 @@ import 'package:url_launcher/url_launcher.dart'; class HospitalsPage extends StatefulWidget { final List findusHospitalModelList; - HospitalsPage({Key key, this.findusHospitalModelList}); + HospitalsPage({Key? key, required this.findusHospitalModelList}); @override _HospitalsPageState createState() => _HospitalsPageState(); diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart index 72b2316c..529319f1 100644 --- a/lib/pages/ContactUs/findus/pharmacies_page.dart +++ b/lib/pages/ContactUs/findus/pharmacies_page.dart @@ -7,7 +7,7 @@ import 'package:url_launcher/url_launcher.dart'; class PharmaciesPage extends StatefulWidget { final List findusPharmaciesModelList; - PharmaciesPage({Key key, this.findusPharmaciesModelList}); + PharmaciesPage({Key? key, required this.findusPharmaciesModelList}); @override _PharmaciesPageState createState() => _PharmaciesPageState(); diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index d6de807a..b4cfe95f 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -24,7 +24,7 @@ class CardCommonContact extends StatelessWidget { final ProjectViewModel projectViewModel; final ToDoCountProviderModel model; - const CardCommonContact({@required this.image, @required this.text, @required this.subText, @required this.type, this.width, this.height, this.projectViewModel, this.model}); + const CardCommonContact({required this.image, required this.text, required this.subText, required this.type, this.width, this.height, required this.projectViewModel, required this.model}); @override Widget build(BuildContext context) { diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 9b5c47a7..df2a8695 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -29,31 +29,31 @@ import 'package:provider/provider.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; class CovidTimeSlots extends StatefulWidget { - int projectID; + int? projectID; static bool areSlotsAvailable = false; - static DateTime selectedAppoDateTime; - static String selectedDate; - static String selectedTime; - CovidTestProceduresResponse selectedProcedure; - DriveThroughTestingCenterModel selectedProject; + static DateTime? selectedAppoDateTime; + static String? selectedDate; + static String? selectedTime; + CovidTestProceduresResponse? selectedProcedure; + DriveThroughTestingCenterModel? selectedProject; - int selectedClinicID; - int selectedDoctorID; + int? selectedClinicID; + int? selectedDoctorID; var language; - PatientShareResponse patientShareResponse; + PatientShareResponse? patientShareResponse; - CovidTimeSlots({@required this.projectID, @required this.selectedProcedure, @required this.selectedProject}); + CovidTimeSlots({required this.projectID, required this.selectedProcedure, required this.selectedProject}); @override _CovidTimeSlotsState createState() => _CovidTimeSlotsState(); } class _CovidTimeSlotsState extends State with TickerProviderStateMixin { - Map _events; - AnimationController _animationController; - CalendarController _calendarController; + late Map _events; + late AnimationController _animationController; + late CalendarController _calendarController; AppSharedPreferences sharedPref = new AppSharedPreferences(); @@ -68,10 +68,10 @@ class _CovidTimeSlotsState extends State with TickerProviderStat dynamic freeSlotsResponse; - ScrollController _scrollController; + late ScrollController _scrollController; - ToDoCountProviderModel toDoProvider; - ProjectViewModel projectViewModel; + late ToDoCountProviderModel toDoProvider; + late ProjectViewModel projectViewModel; @override void initState() { @@ -85,7 +85,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat _selectedDay: ['Event A0'] }; - WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID)); + WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID!)); _calendarController = CalendarController(); _animationController = AnimationController( @@ -217,18 +217,14 @@ class _CovidTimeSlotsState extends State with TickerProviderStat minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, + backgroundColor: CustomColors.green, + elevation: 0, onPressed: () { bookCovidTestAppointment(); }, child: Text( TranslationBase.of(context).bookAppo, - style: TextStyle( - fontSize: 16.0, - letterSpacing: -0.64, - color: Colors.white - ), + style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, color: Colors.white), ), ), ), @@ -254,7 +250,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1), onTap: (CalendarTapDetails details) { _calendarController.selectedDate = details.date; - _onDaySelected(details.date, projectViewModel); + _onDaySelected(details.date!, projectViewModel); }, ); } @@ -345,8 +341,8 @@ class _CovidTimeSlotsState extends State with TickerProviderStat Widget getNormalButton(int index) { return CustomTextButton( - backgroundColor: Colors.white, - elevation: 0, + backgroundColor: Colors.white, + elevation: 0, onPressed: () { setState(() { selectedButtonIndex = index; @@ -354,14 +350,14 @@ class _CovidTimeSlotsState extends State with TickerProviderStat print(CovidTimeSlots.selectedTime); }); }, - child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))), + child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))), ); } Widget getSelectedButton(int index) { return CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, + backgroundColor: CustomColors.green, + elevation: 0, onPressed: () { setState(() { selectedButtonIndex = index; @@ -369,25 +365,25 @@ class _CovidTimeSlotsState extends State with TickerProviderStat print(CovidTimeSlots.selectedTime); }); }, - child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))), + child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))), ); } bookCovidTestAppointment() { if (CovidTimeSlots.areSlotsAvailable) { var messageEn = "This Appointment is being booked for patient " + - projectViewModel.authenticatedUserObject.user.firstName + + projectViewModel.authenticatedUserObject.user!.firstName! + " " + - projectViewModel.authenticatedUserObject.user.lastName + + projectViewModel.authenticatedUserObject.user!.lastName! + ", Having file number " + - projectViewModel.authenticatedUserObject.user.patientID.toString() + + projectViewModel.authenticatedUserObject.user!.patientID.toString() + ". Please confirm!"; var messageAr = "يتم حجز هذا الموعد المراجع " + - projectViewModel.authenticatedUserObject.user.firstName + + projectViewModel.authenticatedUserObject.user!.firstName! + " " + - projectViewModel.authenticatedUserObject.user.lastName + + projectViewModel.authenticatedUserObject.user!.lastName! + ", وجود رقم الملف " + - projectViewModel.authenticatedUserObject.user.patientID.toString() + + projectViewModel.authenticatedUserObject.user!.patientID.toString() + ". يرجى تأكيد!"; ConfirmDialog dialog = new ConfirmDialog( context: context, @@ -412,7 +408,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat insertCovidQuestionnaire(context, DoctorList docObject) async { DoctorsListService service = new DoctorsListService(); List qa = await sharedPref.getObject(COVID_QA_LIST); - service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + service.insertCovidQuestionnaire(qa, widget.projectID!, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum!).then((res) { insertAppointmentCovidTest(context, docObject); }).catchError((err) { print(err); @@ -421,7 +417,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat updateCovidQuestionnaire(context, String appoNo) async { DoctorsListService service = new DoctorsListService(); - service.updateCovidQuestionnaire(appoNo, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) {}).catchError((err) { + service.updateCovidQuestionnaire(appoNo, widget.projectID!, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum!).then((res) {}).catchError((err) { print(err); }); } @@ -430,13 +426,13 @@ class _CovidTimeSlotsState extends State with TickerProviderStat DoctorsListService service = new DoctorsListService(); AppoitmentAllHistoryResultList appo; service - .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID, - widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum) + .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, CovidTimeSlots.selectedTime!, CovidTimeSlots.selectedDate!, 0, context, + widget.selectedProcedure!.procedureID, widget.selectedProject!.testTypeEnum, widget.selectedProject!.testProcedureEnum) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); getToDoCount(); - getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject); } else { GifLoaderDialogUtils.hideDialog(context); appo = new AppoitmentAllHistoryResultList(); @@ -516,7 +512,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat Navigator.push( context, FadePage( - page: CovidPaymentAlert(patientShareResponse: widget.patientShareResponse), + page: CovidPaymentAlert(patientShareResponse: widget.patientShareResponse!), ), ); } @@ -524,7 +520,7 @@ class _CovidTimeSlotsState extends State with TickerProviderStat getCovidFreeSlots(BuildContext context, int projectID) { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidFreeSlots(context, projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + service.getCovidFreeSlots(context, projectID, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum!).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['COVID19_FreeTimeSlots'].length != 0) { @@ -552,32 +548,32 @@ class MeetingDataSource extends CalendarDataSource { @override DateTime getStartTime(int index) { - return _getMeetingData(index).from; + return _getMeetingData(index)!.from; } @override DateTime getEndTime(int index) { - return _getMeetingData(index).to; + return _getMeetingData(index)!.to; } @override String getSubject(int index) { - return _getMeetingData(index).eventName; + return _getMeetingData(index)!.eventName; } @override Color getColor(int index) { - return _getMeetingData(index).background; + return _getMeetingData(index)!.background; } @override bool isAllDay(int index) { - return _getMeetingData(index).isAllDay; + return _getMeetingData(index)!.isAllDay; } - Meeting _getMeetingData(int index) { - final dynamic meeting = appointments[index]; - Meeting meetingData; + Meeting? _getMeetingData(int index) { + final dynamic meeting = appointments![index]; + Meeting? meetingData; if (meeting is Meeting) { meetingData = meeting; } diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index ef4bf39a..9c91aa6d 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -26,14 +26,14 @@ class CovidDirveThruQuestions extends StatefulWidget { final List proceduresList; DriveThroughTestingCenterModel selectedProject; - CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList, @required this.selectedProject}); + CovidDirveThruQuestions({required this.projectId, required this.proceduresList, required this.selectedProject}); @override CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState(); } class CovidDirveThruQuestionsState extends State { - List qa; + late List qa; @override void initState() { @@ -41,8 +41,8 @@ class CovidDirveThruQuestionsState extends State { qa = getQuestionsFromJson(); } - TranslationBase localize; - ProjectViewModel projectViewModel; + late TranslationBase localize; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -96,7 +96,7 @@ class CovidDirveThruQuestionsState extends State { ), mWidth(3), Text( - projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, @@ -118,7 +118,7 @@ class CovidDirveThruQuestionsState extends State { ), mWidth(3), Text( - projectViewModel.user.patientIdentificationNo, + projectViewModel.user!.patientIdentificationNo!, style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, @@ -235,7 +235,7 @@ class CovidDirveThruQuestionsState extends State { height: 50, elevation: 0, color: all2 ? CustomColors.accentColor : CustomColors.grey, - disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), + disabledColor: Theme.of(context).appBarTheme.color!.withOpacity(0.25), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), child: Text( localize.next, @@ -303,7 +303,7 @@ class CovidDirveThruQuestionsState extends State { CovidDriveThruService service = new CovidDriveThruService(); CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID!, widget.selectedProject.testTypeEnum!, widget.selectedProject.testProcedureEnum!).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 8578e9a2..520784a6 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -27,7 +27,7 @@ class CovidDrivethruLocation extends StatefulWidget { } class _CovidDrivethruLocationState extends State { - String projectDropdownValue; + late String projectDropdownValue; List projectsList = []; List proceduresList = []; bool isLocationSelected = false; @@ -35,12 +35,12 @@ class _CovidDrivethruLocationState extends State { String projectLong = ""; String projectName = ""; String projectID = ""; - List imagesInfo =[]; + List imagesInfo = []; - DriveThroughTestingCenterModel selectedProject; + late DriveThroughTestingCenterModel selectedProject; final GlobalKey locationDropdownKey = GlobalKey(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override void initState() { @@ -132,7 +132,7 @@ class _CovidDrivethruLocationState extends State { }).toList(), onChanged: (newValue) { setState(() { - selectedProject = newValue; + selectedProject = newValue!; setProjectLocation(newValue); }); }, @@ -262,6 +262,8 @@ class _CovidDrivethruLocationState extends State { Container(padding: EdgeInsets.only(left: 5.0, right: 5.0), child: SvgPicture.asset("assets/images/new/DriveThru.svg", width: 20.0)), ], ); + } else { + return SizedBox(); } } @@ -300,7 +302,7 @@ class _CovidDrivethruLocationState extends State { CovidDriveThruService service = new CovidDriveThruService(); CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID, selectedProject.testTypeEnum, selectedProject.testProcedureEnum).then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID!, selectedProject.testTypeEnum!, selectedProject.testProcedureEnum!).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { @@ -325,7 +327,7 @@ class _CovidDrivethruLocationState extends State { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidTestProceduresList(context, selectedProject.testTypeEnum, selectedProject.testProcedureEnum, selectedProject.projectID).then((res) { + service.getCovidTestProceduresList(context, selectedProject.testTypeEnum!, selectedProject.testProcedureEnum!, selectedProject.projectID!).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['COVID19_TestProceduresList'].forEach((v) { diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart index b6a23fdb..60ab52c0 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-alert.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -15,7 +15,7 @@ import 'package:flutter/material.dart'; class CovidPaymentAlert extends StatefulWidget { PatientShareResponse patientShareResponse; - CovidPaymentAlert({@required this.patientShareResponse}); + CovidPaymentAlert({required this.patientShareResponse}); @override _CovidPaymentAlertState createState() => _CovidPaymentAlertState(); @@ -23,7 +23,7 @@ class CovidPaymentAlert extends StatefulWidget { class _CovidPaymentAlertState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); - AuthenticatedUser authUser; + late AuthenticatedUser authUser; @override Widget build(BuildContext context) { @@ -182,8 +182,8 @@ class _CovidPaymentAlertState extends State { height: 45.0, child: CustomTextButton( backgroundColor: CustomColors.accentColor, - disabledForegroundColor: Colors.grey[500].withOpacity(0.38), - disabledBackgroundColor: Colors.grey[500].withOpacity(0.12), + disabledForegroundColor: Colors.grey[500]!.withOpacity(0.38), + disabledBackgroundColor: Colors.grey[500]!.withOpacity(0.12), elevation: 0, onPressed: () { startPaymentProcess(); diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 72e28fee..fe8c64dc 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -19,10 +19,10 @@ class CovidPaymentDetails extends StatefulWidget { CovidPaymentInfoResponse covidPaymentInfoResponse; int projectID; List proceduresList; - CovidTestProceduresResponse selectedProcedure; + late CovidTestProceduresResponse selectedProcedure; DriveThroughTestingCenterModel selectedProject; - CovidPaymentDetails({@required this.covidPaymentInfoResponse, @required this.projectID, @required this.proceduresList, @required this.selectedProject}); + CovidPaymentDetails({required this.covidPaymentInfoResponse, required this.projectID, required this.proceduresList, required this.selectedProject}); @override _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); @@ -74,7 +74,7 @@ class _CovidPaymentDetailsState extends State { onTap: () { setState(() { widget.selectedProcedure = widget.proceduresList[index]; - getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); + getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID!); }); }, child: Row( @@ -86,14 +86,14 @@ class _CovidPaymentDetailsState extends State { toggleable: true, onChanged: (value) { setState(() { - widget.selectedProcedure = value; + widget.selectedProcedure = value!; print(widget.selectedProcedure.procedureName); - getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); + getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID!); }); }, ), Text( - projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName, + projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN! : widget.proceduresList[index].procedureName!, style: TextStyle( fontSize: 12.0, letterSpacing: -0.48, @@ -137,7 +137,7 @@ class _CovidPaymentDetailsState extends State { ], ), ), - mDivider(Colors.grey[200]), + mDivider(Colors.grey[200]!), Container( width: double.infinity, padding: EdgeInsets.only(top: 3, bottom: 3), @@ -152,7 +152,7 @@ class _CovidPaymentDetailsState extends State { ], ), ), - mDivider(Colors.grey[200]), + mDivider(Colors.grey[200]!), Container( width: double.infinity, padding: EdgeInsets.only(top: 3, bottom: 3), @@ -248,8 +248,8 @@ class _CovidPaymentDetailsState extends State { height: 45.0, child: CustomTextButton( backgroundColor: CustomColors.accentColor, - disabledForegroundColor: Colors.grey[500].withOpacity(0.38), - disabledBackgroundColor: Colors.grey[500].withOpacity(0.12), + disabledForegroundColor: Colors.grey[500]!.withOpacity(0.38), + disabledBackgroundColor: Colors.grey[500]!.withOpacity(0.12), elevation: 0, onPressed: () { cancel(); @@ -279,8 +279,8 @@ class _CovidPaymentDetailsState extends State { height: 45.0, child: CustomTextButton( backgroundColor: CustomColors.green, - disabledForegroundColor: Colors.grey[500].withOpacity(0.38), - disabledBackgroundColor: Colors.grey[500].withOpacity(0.12), + disabledForegroundColor: Colors.grey[500]!.withOpacity(0.38), + disabledBackgroundColor: Colors.grey[500]!.withOpacity(0.12), elevation: 0, onPressed: isAgree ? next : null, child: Text( @@ -313,7 +313,7 @@ class _CovidPaymentDetailsState extends State { getPaymentInfo(BuildContext context, String projectID, String selectedProcedureID) { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - service.getCovidPaymentInformation(context, int.parse(projectID), selectedProcedureID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), selectedProcedureID, widget.selectedProject.testTypeEnum!, widget.selectedProject.testProcedureEnum!).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index e1f00173..db19e4c5 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -24,25 +24,24 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class CovidPaymentSummary extends StatefulWidget { - PatientShareResponse patientShareResponse; - + PatientShareResponse? patientShareResponse; String selectedPaymentMethod; - String selectedInstallmentPlan; - MyInAppBrowser browser; - AuthenticatedUser authenticatedUser; + String? selectedInstallmentPlan; + MyInAppBrowser? browser; + AuthenticatedUser? authenticatedUser; AppSharedPreferences sharedPref = AppSharedPreferences(); String transID = ""; - CovidPaymentSummary({@required this.patientShareResponse, this.selectedPaymentMethod}); + CovidPaymentSummary({required this.patientShareResponse, required this.selectedPaymentMethod}); @override _CovidPaymentSummaryState createState() => _CovidPaymentSummaryState(); } class _CovidPaymentSummaryState extends State { - ProjectViewModel projectViewModel; - String tamaraPaymentStatus; - String tamaraOrderID; + late ProjectViewModel projectViewModel; + late String tamaraPaymentStatus; + late String tamaraOrderID; @override Widget build(BuildContext context) { @@ -81,7 +80,7 @@ class _CovidPaymentSummaryState extends State { ), ), Text( - '${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar, + '${widget.patientShareResponse!.patientShareWithTax} ' + TranslationBase.of(context).sar, style: TextStyle( fontSize: 14, fontWeight: FontWeight.bold, @@ -103,7 +102,7 @@ class _CovidPaymentSummaryState extends State { Container( height: 100.0, padding: EdgeInsets.all(7.0), - child: Image.asset(getImagePath(widget.selectedPaymentMethod), width: 100, height: 100), + child: Image.asset(getImagePath(widget.selectedPaymentMethod!), width: 100, height: 100), ), mFlex(1), InkWell( @@ -111,12 +110,12 @@ class _CovidPaymentSummaryState extends State { showDraggableDialog( context, PaymentMethod( - onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { + onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) { widget.selectedPaymentMethod = metohd; widget.selectedInstallmentPlan = selectedInstallmentPlan; setState(() {}); }, - patientShare: widget.patientShareResponse.patientShareWithTax, + patientShare: widget.patientShareResponse!.patientShareWithTax, )); }, child: Text( @@ -135,7 +134,7 @@ class _CovidPaymentSummaryState extends State { flex: 1, child: showDetail( TranslationBase.of(context).fileNumber, - projectViewModel.user.patientID.toString(), + projectViewModel.user!.patientID.toString(), ), ), mWidth(6), @@ -143,7 +142,7 @@ class _CovidPaymentSummaryState extends State { flex: 1, child: showDetail( TranslationBase.of(context).name, - projectViewModel.user.firstName.toString(), + projectViewModel.user!.firstName.toString(), ), ), ], @@ -151,13 +150,13 @@ class _CovidPaymentSummaryState extends State { SizedBox( height: 6, ), - showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user.mobileNumber), + showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user!.mobileNumber!), SizedBox( height: 6, ), showDetail( TranslationBase.of(context).depositorName, - projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName, + projectViewModel.user!.firstName! + " " + projectViewModel.user!.middleName! + " " + projectViewModel.user!.lastName!, ) ], ), @@ -171,7 +170,7 @@ class _CovidPaymentSummaryState extends State { child: DefaultButton( TranslationBase.of(context).confirm.toUpperCase(), () { - startPaymentProcess(projectViewModel.user); + startPaymentProcess(projectViewModel.user!); }, color: CustomColors.green, ), @@ -207,36 +206,37 @@ class _CovidPaymentSummaryState extends State { startPaymentProcess(AuthenticatedUser authenticatedUser) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - appo.projectID = widget.patientShareResponse.projectID; - appo.clinicID = widget.patientShareResponse.clinicID; - appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.projectID = widget.patientShareResponse!.projectID; + appo.clinicID = widget.patientShareResponse!.clinicID; + appo.appointmentNo = widget.patientShareResponse!.appointmentNo; - openPayment(widget.selectedPaymentMethod, authenticatedUser, double.parse(widget.patientShareResponse.patientShareWithTax.toString()), widget.patientShareResponse, appo); + openPayment(widget.selectedPaymentMethod, authenticatedUser, double.parse(widget.patientShareResponse!.patientShareWithTax.toString()), widget.patientShareResponse!, appo); } openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); - widget.browser.openPaymentBrowser( - amount, - "Covid appointment payment", - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), - appo.projectID.toString(), - authenticatedUser.emailAddress, - paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName, - authenticatedUser.patientID, - authenticatedUser, - widget.browser, - widget.patientShareResponse.isLiveCareAppointment, - "2", - "", - widget.patientShareResponse.appointmentDate, - widget.patientShareResponse.appointmentNo, - widget.patientShareResponse.clinicID, - widget.patientShareResponse.doctorID, - widget.selectedInstallmentPlan); + widget.browser!.openPaymentBrowser( + amount, + "Covid appointment payment", + Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), + appo.projectID.toString(), + authenticatedUser.emailAddress!, + paymentMethod, + authenticatedUser.patientType, + authenticatedUser.firstName!, + authenticatedUser.patientID, + authenticatedUser, + widget.browser!, + widget.patientShareResponse!.isLiveCareAppointment!, + "2", + "", + widget.patientShareResponse!.appointmentDate, + widget.patientShareResponse!.appointmentNo!, + widget.patientShareResponse!.clinicID!, + widget.patientShareResponse!.doctorID!, + widget.selectedInstallmentPlan, + ); } onBrowserLoadStart(String url) { @@ -246,18 +246,18 @@ class _CovidPaymentSummaryState extends State { if (widget.selectedPaymentMethod == "TAMARA") { if (Platform.isAndroid) { Uri uri = new Uri.dataFromString(url); - tamaraPaymentStatus = uri.queryParameters['status']; - tamaraOrderID = uri.queryParameters['AuthorizePaymentId']; + tamaraPaymentStatus = uri.queryParameters['status']!; + tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!; } else { Uri uri = new Uri.dataFromString(url); - tamaraPaymentStatus = uri.queryParameters['paymentStatus']; - tamaraOrderID = uri.queryParameters['orderId']; + tamaraPaymentStatus = uri.queryParameters['paymentStatus']!; + tamaraOrderID = uri.queryParameters['orderId']!; } } MyInAppBrowser.successURLS.forEach((element) { if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); + if (widget.browser!.isOpened()) widget.browser!.close(); MyInAppBrowser.isPaymentDone = true; return; } @@ -265,7 +265,7 @@ class _CovidPaymentSummaryState extends State { MyInAppBrowser.errorURLS.forEach((element) { if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); + if (widget.browser!.isOpened()) widget.browser!.close(); MyInAppBrowser.isPaymentDone = false; return; } @@ -276,7 +276,7 @@ class _CovidPaymentSummaryState extends State { print("onBrowserExit Called!!!!"); try { if (widget.selectedPaymentMethod == "TAMARA") { - checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); + checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); // } else { @@ -297,10 +297,10 @@ class _CovidPaymentSummaryState extends State { service.getTamaraPaymentStatus(orderID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["status"].toString().toLowerCase() == "success") { - updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); + updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, int.parse(widget.selectedInstallmentPlan!), appo); } else { - updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", - num.parse(widget.selectedInstallmentPlan), appo); + updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "", + int.parse(widget.selectedInstallmentPlan!), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -341,7 +341,7 @@ class _CovidPaymentSummaryState extends State { markAppointmentForTamara(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.markAppointmentForTamara(appo.projectID, appo.appointmentNo.toString()).then((res) { + service.markAppointmentForTamara(appo.projectID!, appo.appointmentNo.toString()).then((res) { GifLoaderDialogUtils.hideDialog(context); getAppoQR(context); // autoGenerateInvoiceTamara(appo); @@ -363,7 +363,7 @@ class _CovidPaymentSummaryState extends State { "AppointmentDate": appo.appointmentDate.toString(), }; DoctorsListService service = new DoctorsListService(); - service.autoGenerateInvoiceTamara(appo.projectID, appo.appointmentNo.toString(), projectViewModel.user.mobileNumber).then((res) { + service.autoGenerateInvoiceTamara(appo.projectID!, appo.appointmentNo.toString(), projectViewModel.user!.mobileNumber!).then((res) { GifLoaderDialogUtils.hideDialog(context); getAppoQR(context); }).catchError((err) { @@ -376,7 +376,7 @@ class _CovidPaymentSummaryState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), false, context).then((res) { print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -403,7 +403,7 @@ class _CovidPaymentSummaryState extends State { String paymentReference = res['Fort_id'].toString(); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { addAdvancedNumberRequest( - Utils.isVidaPlusProject(projectViewModel, appo.projectID) + Utils.isVidaPlusProject(projectViewModel, appo.projectID!) ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, @@ -429,7 +429,7 @@ class _CovidPaymentSummaryState extends State { getAppoQR(context) { DoctorsListService service = new DoctorsListService(); - service.generateAppointmentQR(widget.patientShareResponse, context).then((res) { + service.generateAppointmentQR(widget.patientShareResponse!, context).then((res) { print(res); GifLoaderDialogUtils.hideDialog(context); navigateToQR(context, res['AppointmentQR']); diff --git a/lib/pages/DrawerPages/family/add-family-member.dart b/lib/pages/DrawerPages/family/add-family-member.dart index c3d79918..c29c8b20 100644 --- a/lib/pages/DrawerPages/family/add-family-member.dart +++ b/lib/pages/DrawerPages/family/add-family-member.dart @@ -30,7 +30,7 @@ class _AddMember extends State { final util = Utils(); final nationalIDorFile = TextEditingController(); final int loginType = AddFamilyMemberType.loginType; - String mobileNo; + String? mobileNo; String countryCode = '966'; bool isButtonDisabled = true; var sharedPref = new AppSharedPreferences(); @@ -58,7 +58,7 @@ class _AddMember extends State { : SingleChildScrollView( child: Container( padding: EdgeInsets.all(21.0), - height: SizeConfig.realScreenHeight * .9, + height: SizeConfig.realScreenHeight! * .9, width: SizeConfig.realScreenWidth, child: Column( children: [ @@ -117,7 +117,7 @@ class _AddMember extends State { } void validateForm() { - if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo!.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; }); @@ -250,7 +250,7 @@ class _AddMember extends State { }); } - 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, diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index edef77a3..cac3b745 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -39,7 +39,7 @@ import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; - Function onBackClick; + VoidCallbackAction? onBackClick; MyFamily({this.isAppbarVisible = true, this.onBackClick}); @@ -52,15 +52,15 @@ class _MyFamily extends State with TickerProviderStateMixin { final familyFileProvider = FamilyFilesProvider(); AppSharedPreferences sharedPref = new AppSharedPreferences(); var userID; - TabController _tabController; + late TabController _tabController; int _tabIndex = 0; AuthenticatedUserObject authenticatedUserObject = locator(); AppointmentRateViewModel appointmentRateViewModel = locator(); - ProjectViewModel projectViewModel; - AuthenticatedUser user; + late ProjectViewModel projectViewModel; + late AuthenticatedUser user; VitalSignService _vitalSignService = locator(); PharmacyModuleViewModel pharmacyModuleViewModel = locator(); - ToDoCountProviderModel toDoProvider; + late ToDoCountProviderModel toDoProvider; var isVaiable = false; bool isSwitchUser = false; @@ -173,7 +173,7 @@ class _MyFamily extends State with TickerProviderStateMixin { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - familySharedRecordsList[index].patientName.toLowerCase().capitalizeFirstofEach, + familySharedRecordsList[index].patientName!.toLowerCase().capitalizeFirstofEach, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.42), ), Text( @@ -181,7 +181,7 @@ class _MyFamily extends State with TickerProviderStateMixin { style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.4, height: 16 / 10), ), Text( - familySharedRecordsList[index].age.toString() + ' ' + TranslationBase.of(context).years + ', ' + familySharedRecordsList[index].genderDescription, + familySharedRecordsList[index].age.toString() + ' ' + TranslationBase.of(context).years + ', ' + familySharedRecordsList[index].genderDescription!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.4, height: 16 / 10), ), ], @@ -308,7 +308,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget pendingItemView(GetAllSharedRecordsByStatusList result) { return Row( children: [ - Expanded(flex: 3, child: rowText(result.patientName)), + Expanded(flex: 3, child: rowText(result.patientName!)), Expanded( flex: 1, child: Align( @@ -352,7 +352,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget sentItemView(GetAllSharedRecordsByStatusList result) { return Row( children: [ - Expanded(flex: 2, child: rowText(result.patientName)), + Expanded(flex: 2, child: rowText(result.patientName!)), Expanded( flex: 1, child: Row( @@ -364,7 +364,7 @@ class _MyFamily extends State with TickerProviderStateMixin { color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), ), child: Text( - result.statusDescription != null ? result.statusDescription : "", + result.statusDescription != null ? result.statusDescription! : "", style: TextStyle( fontSize: 10, color: Colors.white, @@ -395,7 +395,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget approvedItemView(GetAllSharedRecordsByStatusList result) { return Row( children: [ - Expanded(flex: 4, child: rowText(result.patientName)), + Expanded(flex: 4, child: rowText(result.patientName!)), Expanded( flex: 2, child: Align( @@ -555,7 +555,7 @@ class _MyFamily extends State with TickerProviderStateMixin { List sentRecordsList = []; Future getFamilyFiles() async { - GetAllSharedRecordsByStatusResponse familySharedRecords; + late GetAllSharedRecordsByStatusResponse familySharedRecords; if (await sharedPref.getObject(FAMILY_FILE) != null) { familySharedRecords = GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE)); } @@ -567,7 +567,7 @@ class _MyFamily extends State with TickerProviderStateMixin { } sentRecordsList =[]; familySharedRecordsList =[]; - familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) { + familySharedRecords.getAllSharedRecordsByStatusList!.forEach((element) { if (element.status == 3) { familySharedRecordsList.add(element); } @@ -577,7 +577,7 @@ class _MyFamily extends State with TickerProviderStateMixin { pendingRecordsList =[]; GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); - pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) { + pendingAndApprovedRecords.getAllSharedRecordsByStatusList!.forEach((element) { print(element.toJson()); if (element.status == 2) { pendingRecordsList.add(element); diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index 65547b39..9cbef4a0 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -9,19 +9,19 @@ import 'package:youtube_player_flutter/youtube_player_flutter.dart'; class NotificationsDetailsPage extends StatefulWidget { final GetNotificationsResponseModel notification; - NotificationsDetailsPage({this.notification}); + NotificationsDetailsPage({required this.notification}); @override State createState() => _NotificationsDetailsPageState(); } class _NotificationsDetailsPageState extends State { - YoutubePlayerController _controller; + late YoutubePlayerController _controller; @override void initState() { _controller = YoutubePlayerController( - initialVideoId: getVideoURL(), + initialVideoId: getVideoURL()!, flags: YoutubePlayerFlags( autoPlay: true, mute: false, @@ -47,10 +47,10 @@ class _NotificationsDetailsPageState extends State { return monthName + ',${d.day},${d.year}, $hour'; } - String getVideoURL() { + String? getVideoURL() { if (widget.notification.videoURL != null && widget.notification.notificationType == "2") { String videoId; - videoId = YoutubePlayer.convertUrlToId(widget.notification.videoURL); + videoId = YoutubePlayer.convertUrlToId(widget.notification.videoURL)!; print(videoId); // BBAyRBTfsOU return videoId; } @@ -69,9 +69,9 @@ class _NotificationsDetailsPageState extends State { padding: EdgeInsets.all(21), children: [ Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.notification.createdOn)) + + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.notification.createdOn!)) + " " + - DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.notification.createdOn), false), + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.notification.createdOn!), false), style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -88,10 +88,10 @@ class _NotificationsDetailsPageState extends State { ), ), if (widget.notification.messageTypeData != null) - if (widget.notification.messageTypeData.length != 0 && widget.notification.notificationType != "2") + if (widget.notification.messageTypeData!.length != 0 && widget.notification.notificationType != "2") Padding( padding: const EdgeInsets.only(top: 18), - child: Image.network(widget.notification.messageTypeData, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) { + child: Image.network(widget.notification.messageTypeData!, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) { if (loadingProgress == null) return child; return Center( child: SizedBox( @@ -104,7 +104,7 @@ class _NotificationsDetailsPageState extends State { ), SizedBox(height: 18), Text( - widget.notification.message.trim(), + widget.notification.message!.trim(), style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 7c86ebf5..b5373131 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -67,7 +67,7 @@ class NotificationsPage extends StatelessWidget { } return InkWell( onTap: () async { - if (!model.notifications[index].isRead) { + if (!model.notifications[index].isRead!) { model.markAsRead(model.notifications[index].id); } Navigator.push( @@ -83,17 +83,17 @@ class NotificationsPage extends StatelessWidget { width: double.infinity, padding: EdgeInsets.fromLTRB(15.0, 14, 21, 12), decoration: BoxDecoration( - color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), + color: model.notifications[index].isRead! ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), border: projectViewModel.isArabic ? Border( right: BorderSide( - color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + color: model.notifications[index].isRead! ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, width: 6.0, ), ) : Border( left: BorderSide( - color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + color: model.notifications[index].isRead! ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, width: 6.0, ), ), @@ -105,9 +105,9 @@ class NotificationsPage extends StatelessWidget { children: [ Expanded( child: Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn!)) + " " + - DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false), + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn!), false), style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -125,7 +125,7 @@ class NotificationsPage extends StatelessWidget { ), SizedBox(height: 4), Text( - model.notifications[index].message.trim(), + model.notifications[index].message!.trim(), style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index ec44fbfd..717b6349 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -19,7 +19,7 @@ class AmbulanceReq extends StatefulWidget { } class _AmbulanceReqState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; List imagesInfo =[]; @override diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index 9f461c7b..22368acf 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -25,7 +25,7 @@ import 'Summary.dart'; class AmbulanceRequestIndexPage extends StatefulWidget { final AmRequestViewModel amRequestViewModel; - AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); + AmbulanceRequestIndexPage({Key? key, required this.amRequestViewModel}); @override _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState(); @@ -33,16 +33,16 @@ class AmbulanceRequestIndexPage extends StatefulWidget { class _AmbulanceRequestIndexPageState extends State { int currentIndex = 0; - PageController pageController; + late PageController pageController; PatientER _patientER = PatientER(); PatientER_RC _patientER_RC = PatientER_RC(); TransportationDetails transportationDetails = new TransportationDetails(); - int status; - String _statusDisp; - Color _color; + late int status; + late String _statusDisp; + late Color _color; _changeCurrentTab(int tab) { setState(() { @@ -65,8 +65,8 @@ class _AmbulanceRequestIndexPageState extends State { AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder; if(widget.amRequestViewModel.pendingAmbulanceRequestOrder != null) { - int status = order.statusId; - _statusDisp = order.statusText; + int status = order.statusId!; + _statusDisp = order.statusText!; if (status == 1) { //pending _color = Color(0xffCC9B14); @@ -147,7 +147,7 @@ class _AmbulanceRequestIndexPageState extends State { ), Expanded( child: Text( - DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created!)!), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), ), ), @@ -162,7 +162,7 @@ class _AmbulanceRequestIndexPageState extends State { ), Expanded( child: Text( - order.serviceText, + order.serviceText!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), ), ), @@ -182,7 +182,7 @@ class _AmbulanceRequestIndexPageState extends State { if (order.statusId == 1 || order.statusId == 2) InkWell( onTap: () { - showConfirmMessage(widget.amRequestViewModel, order.iD, context); + showConfirmMessage(widget.amRequestViewModel, order.iD!, context); }, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), @@ -220,7 +220,7 @@ class _AmbulanceRequestIndexPageState extends State { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), Text( - order.pickupLocation.trim().toString(), + order.pickupLocation!.trim().toString(), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), ], @@ -252,7 +252,7 @@ class _AmbulanceRequestIndexPageState extends State { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), Text( - order.dropOffLocation.trim().toString(), + order.dropOffLocation!.trim().toString(), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart index bacc9c38..6d6c846b 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -15,7 +15,7 @@ class BillAmount extends StatefulWidget { final PatientER_RC patientER_RC; final AmRequestViewModel amRequestViewModel; - BillAmount({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); + BillAmount({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel}); @override _BillAmountState createState() => _BillAmountState(); @@ -68,12 +68,12 @@ class _BillAmountState extends State { child: _getNormalText(TranslationBase.of(context).patientShareToDo), ), Expanded( - child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}', isBold: true), + child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.price}', isBold: true), ) ], ), ), - mDivider(Colors.grey[200]), + mDivider(Colors.grey[200]!), Container( width: double.infinity, padding: EdgeInsets.only(top: 3, bottom: 3), @@ -83,12 +83,12 @@ class _BillAmountState extends State { child: _getNormalText(TranslationBase.of(context).patientTaxToDo), ), Expanded( - child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}', isBold: true), + child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.priceVAT}', isBold: true), ) ], ), ), - mDivider(Colors.grey[200]), + mDivider(Colors.grey[200]!), Container( width: double.infinity, padding: EdgeInsets.only(top: 3, bottom: 3), @@ -98,7 +98,7 @@ class _BillAmountState extends State { child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo), ), Expanded( - child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true), + child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}', isBold: true, isTotal: true), ) ], ), @@ -133,7 +133,7 @@ class _BillAmountState extends State { groupValue: _ambulate, onChanged: (value) { setState(() { - _ambulate = value; + _ambulate = value!; }); }, ), @@ -171,7 +171,7 @@ class _BillAmountState extends State { groupValue: _ambulate, onChanged: (value) { setState(() { - _ambulate = value; + _ambulate = value!; }); }, ), @@ -209,7 +209,7 @@ class _BillAmountState extends State { groupValue: _ambulate, onChanged: (value) { setState(() { - _ambulate = value; + _ambulate = value!; }); }, ), @@ -247,7 +247,7 @@ class _BillAmountState extends State { groupValue: _ambulate, onChanged: (value) { setState(() { - _ambulate = value; + _ambulate = value!; }); }, ), @@ -299,9 +299,9 @@ class _BillAmountState extends State { TranslationBase.of(context).next, () { setState(() { - widget.patientER_RC.transportationDetails.ambulate = _ambulate.selectAmbulateNumber(); - widget.patientER_RC.transportationDetails.ambulateTitle = _ambulate.getAmbulateTitle(context); - widget.patientER_RC.transportationDetails.notes = note; + widget.patientER_RC.transportationDetails!.ambulate = _ambulate.selectAmbulateNumber(); + widget.patientER_RC.transportationDetails!.ambulateTitle = _ambulate.getAmbulateTitle(context); + widget.patientER_RC.transportationDetails!.notes = note; // widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); widget.changeCurrentTab(3); }); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 057cb5c2..e61eb922 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -32,7 +32,7 @@ class PickupLocation extends StatefulWidget { final PatientER_RC patientER_RC; final AmRequestViewModel amRequestViewModel; - PickupLocation({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); + PickupLocation({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel}); @override _PickupLocationState createState() => _PickupLocationState(); @@ -44,11 +44,11 @@ class _PickupLocationState extends State { // double _latitude; // double _longitude; - AppoitmentAllHistoryResultList myAppointment; - HospitalsModel _selectedHospital; - LocationDetails _result; - LocationUtils locationUtils; - ProjectViewModel projectViewModel; + late AppoitmentAllHistoryResultList myAppointment; + late HospitalsModel _selectedHospital; + late LocationDetails _result; + late LocationUtils locationUtils; + late ProjectViewModel projectViewModel; @override void initState() { @@ -81,7 +81,7 @@ class _PickupLocationState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (widget.patientER_RC.transportationDetails.direction == 0) + if (widget.patientER_RC.transportationDetails!.direction == 0) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -175,7 +175,7 @@ class _PickupLocationState extends State { value: _isInsideHome, onChanged: (value) { setState(() { - _isInsideHome = value; + _isInsideHome = value!; }); }, ), @@ -223,7 +223,7 @@ class _PickupLocationState extends State { if (myAppointment == null) { getAppointment(); setState(() { - _haveAppointment = value; + _haveAppointment = value!; }); } }, @@ -247,7 +247,7 @@ class _PickupLocationState extends State { onTap: () { setState(() { _haveAppointment = HaveAppointment.NO; - myAppointment = null; + myAppointment = AppoitmentAllHistoryResultList(); }); }, child: Container( @@ -260,8 +260,8 @@ class _PickupLocationState extends State { groupValue: _haveAppointment, onChanged: (value) { setState(() { - _haveAppointment = value; - myAppointment = null; + _haveAppointment = value!; + myAppointment = AppoitmentAllHistoryResultList(); }); }, ), @@ -290,16 +290,16 @@ class _PickupLocationState extends State { ), DoctorCard( isInOutPatient: myAppointment.isInOutPatient, - name: myAppointment.doctorTitle + " " + myAppointment.doctorNameObj, + name: myAppointment.doctorTitle! + " " + myAppointment.doctorNameObj!, profileUrl: myAppointment.doctorImageURL, subName: myAppointment.clinicName, isLiveCareAppointment: myAppointment.isLiveCareAppointment, - date: DateUtil.convertStringToDate(myAppointment.appointmentDate), + date: DateUtil.convertStringToDate(myAppointment.appointmentDate!), isSortByClinic: false, - rating: myAppointment.actualDoctorRate + 0.0, - appointmentTime: myAppointment.isLiveCareAppointment - ? DateUtil.convertStringToDate(myAppointment.appointmentDate).toString().split(" ")[1].substring(0, 5) - : myAppointment.startTime.substring(0, 5), + rating: myAppointment.actualDoctorRate! + 0.0, + appointmentTime: myAppointment.isLiveCareAppointment! + ? DateUtil.convertStringToDate(myAppointment.appointmentDate!).toString().split(" ")[1].substring(0, 5) + : myAppointment.startTime!.substring(0, 5), remainingTimeInMinutes: null), ], ), @@ -361,7 +361,7 @@ class _PickupLocationState extends State { ), ], ), - if (widget.patientER_RC.transportationDetails.direction == 1) + if (widget.patientER_RC.transportationDetails!.direction == 1) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -517,52 +517,52 @@ class _PickupLocationState extends State { AppToast.showErrorToast(message: TranslationBase.of(context).selectAll); else setState(() { - widget.patientER_RC.transportationDetails.pickupSpot = _isInsideHome ? 1 : 0; - if (widget.patientER_RC.transportationDetails.direction == 0) { + widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0; + if (widget.patientER_RC.transportationDetails!.direction == 0) { // To Hospital - widget.patientER_RC.transportationDetails.dropoffLatitude = _result.lat.toStringAsFixed(6); - widget.patientER_RC.transportationDetails.dropoffLongitude = _result.long.toStringAsFixed(6); - widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude; - widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude; + widget.patientER_RC.transportationDetails!.dropoffLatitude = _result.lat.toStringAsFixed(6); + widget.patientER_RC.transportationDetails!.dropoffLongitude = _result.long.toStringAsFixed(6); + widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital.latitude; + widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital.longitude; } else { // From Hospital - widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude; - widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude; - widget.patientER_RC.transportationDetails.dropoffLatitude = _result.lat.toStringAsFixed(6); - widget.patientER_RC.transportationDetails.dropoffLongitude = _result.long.toStringAsFixed(6); + widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital.latitude; + widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital.longitude; + widget.patientER_RC.transportationDetails!.dropoffLatitude = _result.lat.toStringAsFixed(6); + widget.patientER_RC.transportationDetails!.dropoffLongitude = _result.long.toStringAsFixed(6); } - widget.patientER_RC.transportationDetails.dropoffLocationName = widget.patientER_RC.transportationDetails.direction == 1 ? _result.formattedAddress : _selectedHospital.name; + widget.patientER_RC.transportationDetails!.dropoffLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _result.formattedAddress : _selectedHospital.name; - widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; - widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); - widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER_RC.transportationDetails.direction == 1 ? _selectedHospital.name : _result.formattedAddress; - widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID; - widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID; - widget.patientER_RC.transportationDetails.requesterIsOutSA = false; - widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; - widget.patientER_RC.transportationDetails.requesterFileNo = widget.amRequestViewModel.user.patientID; + widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user!.patientIdentificationNo; + widget.patientER_RC.transportationDetails!.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); + widget.patientER_RC.transportationDetails!.pickupLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _selectedHospital.name : _result.formattedAddress; + widget.patientER_RC.projectID = widget.amRequestViewModel.user!.projectID; + widget.patientER_RC.patientID = widget.amRequestViewModel.user!.patientID; + widget.patientER_RC.transportationDetails!.requesterIsOutSA = false; + widget.patientER_RC.transportationDetails!.requesterMobileNo = widget.amRequestViewModel.user!.mobileNumber; + widget.patientER_RC.transportationDetails!.requesterFileNo = widget.amRequestViewModel.user!.patientID; if (_haveAppointment == HaveAppointment.YES) { - widget.patientER_RC.transportationDetails.appointmentNo = myAppointment.appointmentNo.toString(); - widget.patientER_RC.transportationDetails.appointmentClinicName = myAppointment.clinicName; - widget.patientER_RC.transportationDetails.appointmentDoctorName = myAppointment.doctorNameObj; - widget.patientER_RC.transportationDetails.appointmentBranch = myAppointment.projectName; - widget.patientER_RC.transportationDetails.appointmentTime = myAppointment.appointmentDate; - widget.patientER_RC.transportationDetails.haveAppointment = 1; - widget.patientER_RC.transportationDetails.dropoffLatitude = myAppointment.latitude; - widget.patientER_RC.transportationDetails.dropoffLongitude = myAppointment.longitude; - widget.patientER_RC.transportationDetails.dropoffLocationName = myAppointment.projectName; + widget.patientER_RC.transportationDetails!.appointmentNo = myAppointment.appointmentNo.toString(); + widget.patientER_RC.transportationDetails!.appointmentClinicName = myAppointment.clinicName; + widget.patientER_RC.transportationDetails!.appointmentDoctorName = myAppointment.doctorNameObj; + widget.patientER_RC.transportationDetails!.appointmentBranch = myAppointment.projectName; + widget.patientER_RC.transportationDetails!.appointmentTime = myAppointment.appointmentDate; + widget.patientER_RC.transportationDetails!.haveAppointment = 1; + widget.patientER_RC.transportationDetails!.dropoffLatitude = myAppointment.latitude; + widget.patientER_RC.transportationDetails!.dropoffLongitude = myAppointment.longitude; + widget.patientER_RC.transportationDetails!.dropoffLocationName = myAppointment.projectName; } else { - widget.patientER_RC.transportationDetails.appointmentNo = "0"; - widget.patientER_RC.transportationDetails.appointmentClinicName = ""; - widget.patientER_RC.transportationDetails.appointmentDoctorName = ""; - widget.patientER_RC.transportationDetails.appointmentBranch = ""; - widget.patientER_RC.transportationDetails.appointmentTime = ""; - widget.patientER_RC.transportationDetails.haveAppointment = 0; + widget.patientER_RC.transportationDetails!.appointmentNo = "0"; + widget.patientER_RC.transportationDetails!.appointmentClinicName = ""; + widget.patientER_RC.transportationDetails!.appointmentDoctorName = ""; + widget.patientER_RC.transportationDetails!.appointmentBranch = ""; + widget.patientER_RC.transportationDetails!.appointmentTime = ""; + widget.patientER_RC.transportationDetails!.haveAppointment = 0; } - widget.patientER_RC.transportationDetails.pickupSpot = _isInsideHome ? 1 : 0; + widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0; widget.changeCurrentTab(2); }); }, @@ -575,7 +575,7 @@ class _PickupLocationState extends State { void confirmSelectHospitalDialog(List hospitals) { List list = [ - for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i), + for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name! + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i), ]; showDialog( context: context, @@ -593,7 +593,7 @@ class _PickupLocationState extends State { } String getHospitalName(String title) { - return _selectedHospital == null ? title : _selectedHospital.name; + return _selectedHospital == null ? title : _selectedHospital.name!; } String getSelectFromMapName(context) { diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 1cd6c6c4..1d2058b0 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -21,7 +21,7 @@ class SelectTransportationMethod extends StatefulWidget { final PatientER_RC patientER_RC; final AmRequestViewModel amRequestViewModel; - SelectTransportationMethod({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); + SelectTransportationMethod({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel}); @override _SelectTransportationMethodState createState() => _SelectTransportationMethodState(); @@ -46,10 +46,10 @@ class _SelectTransportationMethodState extends State // } //RC API Revamp - if (widget.patientER_RC.transportationDetails.direction != null) { - _direction = widget.patientER_RC.transportationDetails.direction == 0 ? Direction.ToHospital : Direction.FromHospital; - _way = widget.patientER_RC.transportationDetails.tripType == 1 ? Way.OneWay : Way.TwoWays; - _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER_RC.transportationDetails.ambulate - 1)]; + if (widget.patientER_RC.transportationDetails!.direction != null) { + _direction = widget.patientER_RC.transportationDetails!.direction == 0 ? Direction.ToHospital : Direction.FromHospital; + _way = widget.patientER_RC.transportationDetails!.tripType == 1 ? Way.OneWay : Way.TwoWays; + _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER_RC.transportationDetails!.ambulate! - 1)]; } else { if (widget.amRequestViewModel.amRequestModeList.length != 0) _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[widget.amRequestViewModel.amRequestModeList.length - 1]; } @@ -101,13 +101,13 @@ class _SelectTransportationMethodState extends State groupValue: _erTransportationMethod, onChanged: (value) { setState(() { - _erTransportationMethod = value; + _erTransportationMethod = value!; }); }, ), Flexible( child: Text( - projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text, + projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN! : widget.amRequestViewModel.amRequestModeList[index].text!, style: TextStyle( fontSize: 12.0, letterSpacing: -0.48, @@ -166,7 +166,7 @@ class _SelectTransportationMethodState extends State groupValue: _direction, onChanged: (value) { setState(() { - _direction = value; + _direction = value!; }); }, ), @@ -200,7 +200,7 @@ class _SelectTransportationMethodState extends State groupValue: _direction, onChanged: (value) { setState(() { - _direction = value; + _direction = value!; }); }, ), @@ -251,7 +251,7 @@ class _SelectTransportationMethodState extends State groupValue: _way, onChanged: (value) { setState(() { - _way = value; + _way = value!; }); }, ), @@ -284,7 +284,7 @@ class _SelectTransportationMethodState extends State groupValue: _way, onChanged: (value) { setState(() { - _way = value; + _way = value!; }); }, ), @@ -336,12 +336,12 @@ class _SelectTransportationMethodState extends State // widget.changeCurrentTab(1); // widget.patientER_RC.transportationDetails.id = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 0 : 1; - widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1; - widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); - widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.iD.toString(); + widget.patientER_RC.transportationDetails!.direction = _direction == Direction.ToHospital ? 0 : 1; + widget.patientER_RC.transportationDetails!.tripType = _way == Way.TwoWays ? 0 : 1; + widget.patientER_RC.transportationDetails!.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); + widget.patientER_RC.transportationDetails!.transportationType = _erTransportationMethod.iD.toString(); widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod; - widget.patientER_RC.transportationDetails.pickupUrgency = 1; + widget.patientER_RC.transportationDetails!.pickupUrgency = 1; // widget.patientER.orderServiceID = _orderService.getIdOrderService(); // widget.patientER.lineItemNo = 1; // widget.patientER.cost = _erTransportationMethod.price.toDouble(); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 4b59a8fa..f642923f 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -16,7 +16,7 @@ class Summary extends StatefulWidget { final PatientER_RC patientER_RC; final AmRequestViewModel amRequestViewModel; - Summary({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); + Summary({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel}); @override _SummaryState createState() => _SummaryState(); @@ -50,11 +50,11 @@ class _SummaryState extends State { _getNormalText(TranslationBase.of(context).transportMethod), projectViewModel.isArabic ? _getNormalText( - '${widget.patientER_RC.patientERTransportationMethod.textN}', + '${widget.patientER_RC.patientERTransportationMethod!.textN}', isBold: true, ) : _getNormalText( - '${widget.patientER_RC.patientERTransportationMethod.text}', + '${widget.patientER_RC.patientERTransportationMethod!.text}', isBold: true, ), SizedBox( @@ -62,7 +62,7 @@ class _SummaryState extends State { ), _getNormalText(TranslationBase.of(context).directions), _getNormalText( - widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital, + widget.patientER_RC.transportationDetails!.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital, isBold: true, ), SizedBox( @@ -72,7 +72,7 @@ class _SummaryState extends State { TranslationBase.of(context).pickupLocation, ), _getNormalText( - '${widget.patientER_RC.transportationDetails.pickupLocationName}', + '${widget.patientER_RC.transportationDetails!.pickupLocationName}', isBold: true, ), SizedBox( @@ -80,7 +80,7 @@ class _SummaryState extends State { ), _getNormalText(TranslationBase.of(context).dropoffLocation), _getNormalText( - '${widget.patientER_RC.transportationDetails.dropoffLocationName}', + '${widget.patientER_RC.transportationDetails!.dropoffLocationName}', isBold: true, ), SizedBox( @@ -88,7 +88,7 @@ class _SummaryState extends State { ), _getNormalText(TranslationBase.of(context).selectAmbulate), _getNormalText( - '${widget.patientER_RC.transportationDetails.ambulateTitle}', + '${widget.patientER_RC.transportationDetails!.ambulateTitle}', isBold: true, ), SizedBox( @@ -96,7 +96,7 @@ class _SummaryState extends State { ), _getNormalText(TranslationBase.of(context).notes), _getNormalText( - '${widget.patientER_RC.transportationDetails.notes ?? '---'}', + '${widget.patientER_RC.transportationDetails!.notes ?? '---'}', isBold: true, ), SizedBox( @@ -122,7 +122,7 @@ class _SummaryState extends State { _getNormalText(TranslationBase.of(context).patientShareTotal + ':'), Container( padding: EdgeInsets.only(left: 20.0, right: 20.0), - child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true) + child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}', isBold: true, isTotal: true) ), ], ), diff --git a/lib/pages/ErService/AvailableAppointmentsPage.dart b/lib/pages/ErService/AvailableAppointmentsPage.dart index 4fb6e0ed..58d23080 100644 --- a/lib/pages/ErService/AvailableAppointmentsPage.dart +++ b/lib/pages/ErService/AvailableAppointmentsPage.dart @@ -9,7 +9,7 @@ import 'package:flutter/material.dart'; class AvailableAppointmentsPage extends StatelessWidget { final List appointmentsAllHistoryList; - const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList}) : super(key: key); + const AvailableAppointmentsPage({Key? key, required this.appointmentsAllHistoryList}) : super(key: key); @override Widget build(BuildContext context) { @@ -36,16 +36,16 @@ class AvailableAppointmentsPage extends StatelessWidget { }, child: DoctorCard( isInOutPatient: appointmentsAllHistoryList[index].isInOutPatient, - name: appointmentsAllHistoryList[index].doctorTitle + " " + appointmentsAllHistoryList[index].doctorNameObj, + name: appointmentsAllHistoryList[index].doctorTitle! + " " + appointmentsAllHistoryList[index].doctorNameObj!, profileUrl: appointmentsAllHistoryList[index].doctorImageURL, subName: appointmentsAllHistoryList[index].clinicName, isLiveCareAppointment: appointmentsAllHistoryList[index].isLiveCareAppointment, - date: DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate), + date: DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate!), isSortByClinic: false, - rating: appointmentsAllHistoryList[index].actualDoctorRate + 0.0, - appointmentTime: appointmentsAllHistoryList[index].isLiveCareAppointment - ? DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate).toString().split(" ")[1].substring(0, 5) - : appointmentsAllHistoryList[index].startTime.substring(0, 5), + rating: appointmentsAllHistoryList[index].actualDoctorRate! + 0.0, + appointmentTime: appointmentsAllHistoryList[index].isLiveCareAppointment! + ? DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate!).toString().split(" ")[1].substring(0, 5) + : appointmentsAllHistoryList[index].startTime!.substring(0, 5), remainingTimeInMinutes: null), ), ) diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index 8b34420f..b6e3bd81 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -17,7 +17,7 @@ class DdServicesPage extends StatefulWidget { } class _DdServicesPageState extends State { - PageController pageController; + late PageController pageController; bool isAgree = false; TriageInformationRequest triageInformationRequest = new TriageInformationRequest(); @@ -62,7 +62,7 @@ class _DdServicesPageState extends State { EdOnlineQuestionsPage( changePageViewIndex: _changePageViewIndex, selectedQuestions: selectedQuestions, - selectedHospital: triageInformationRequest.selectedHospital, + selectedHospital: triageInformationRequest.selectedHospital!, ), EdOnlineNotesPage( changePageViewIndex: _changePageViewIndex, @@ -70,7 +70,7 @@ class _DdServicesPageState extends State { triageInformationRequest: triageInformationRequest, ), EdPaymentInformationPage( - selectedHospital: triageInformationRequest.selectedHospital, + selectedHospital: triageInformationRequest.selectedHospital!, ) ], ), diff --git a/lib/pages/ErService/EdOnline/EdOnlineAgreementPage.dart b/lib/pages/ErService/EdOnline/EdOnlineAgreementPage.dart index 950dc2e0..d0e01f57 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineAgreementPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineAgreementPage.dart @@ -7,10 +7,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class EdOnlineAgreementPage extends StatefulWidget { - final HospitalsModel selectedHospital; - final Function changePageViewIndex; + final HospitalsModel? selectedHospital; + final Function? changePageViewIndex; bool isAgree; - EdOnlineAgreementPage({Key key, this.selectedHospital, this.changePageViewIndex,this.isAgree}) : super(key: key); + EdOnlineAgreementPage({Key? key, this.selectedHospital, this.changePageViewIndex,required this.isAgree}) : super(key: key); @override _EdOnlineAgreementPageState createState() => _EdOnlineAgreementPageState(); @@ -38,7 +38,7 @@ class _EdOnlineAgreementPageState extends State { Checkbox( value: widget.isAgree, activeColor: Colors.red[800], - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { widget.isAgree = !widget.isAgree; }); @@ -72,7 +72,7 @@ class _EdOnlineAgreementPageState extends State { textColor: Colors.white, color: Theme.of(context).primaryColor, label: TranslationBase.of(context).back.toUpperCase(), - onTap: () => widget.changePageViewIndex(0), + onTap: () => widget.changePageViewIndex!(0), ), ), ), @@ -85,7 +85,7 @@ class _EdOnlineAgreementPageState extends State { color: Theme.of(context).primaryColor, label: TranslationBase.of(context).next.toUpperCase(), disabled: !widget.isAgree, - onTap: () => widget.changePageViewIndex(2), + onTap: () => widget.changePageViewIndex!(2), ), ), ), diff --git a/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart b/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart index 95ef8026..a31e5205 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineNotesPage.dart @@ -17,11 +17,11 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:provider/provider.dart'; class EdOnlineNotesPage extends StatefulWidget { - final List selectedQuestions; - final Function changePageViewIndex; - TriageInformationRequest triageInformationRequest; + final List? selectedQuestions; + final Function? changePageViewIndex; + TriageInformationRequest? triageInformationRequest; - EdOnlineNotesPage({Key key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest}); + EdOnlineNotesPage({Key? key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest}); @override _EdOnlineNotesPageState createState() => _EdOnlineNotesPageState(); @@ -30,7 +30,7 @@ class EdOnlineNotesPage extends StatefulWidget { class _EdOnlineNotesPageState extends State { TextEditingController _chiefComplaintsTextController = TextEditingController(); TextEditingController _noteTextController = TextEditingController(); - DateTime selectedTime; + late DateTime selectedTime; final _formKey = GlobalKey(); @override @@ -117,7 +117,7 @@ class _EdOnlineNotesPageState extends State { textColor: Colors.white, color: Theme.of(context).primaryColor, label: TranslationBase.of(context).back.toUpperCase(), - onTap: () => widget.changePageViewIndex(2), + onTap: () => widget.changePageViewIndex!(2), ), ), ), @@ -133,21 +133,21 @@ class _EdOnlineNotesPageState extends State { label: TranslationBase.of(context).save.toUpperCase(), disabled: selectedTime == null, onTap: () async { - if (_formKey.currentState.validate()) { + if (_formKey.currentState!.validate()) { GifLoaderDialogUtils.showMyDialog(context); model .saveQuestionsInformation( chiefComplaint: _chiefComplaintsTextController.text.toString(), notes: _noteTextController.text.toString(), selectedQuestions: widget.selectedQuestions, - projectId: widget.triageInformationRequest.projectID, + projectId: widget.triageInformationRequest!.projectID!, selectedTime: selectedTime) .then((value) { GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) AppToast.showErrorToast(message: model.error); else { - widget.changePageViewIndex(4); + widget.changePageViewIndex!(4); } }).catchError((onError) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart b/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart index 2bfa9b00..e5d819b1 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineQuestionsPage.dart @@ -15,11 +15,11 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class EdOnlineQuestionsPage extends StatefulWidget { - final HospitalsModel selectedHospital; - final Function changePageViewIndex; - List selectedQuestions; + final HospitalsModel? selectedHospital; + final Function? changePageViewIndex; + List? selectedQuestions; - EdOnlineQuestionsPage({Key key, this.selectedHospital, this.selectedQuestions, this.changePageViewIndex}); + EdOnlineQuestionsPage({Key? key, this.selectedHospital, this.selectedQuestions, this.changePageViewIndex}); @override _EdOnlineQuestionsPageState createState() => _EdOnlineQuestionsPageState(); @@ -41,10 +41,10 @@ class _EdOnlineQuestionsPageState extends State { (index) => InkWell( onTap: () { setState(() { - if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) { - widget.selectedQuestions.remove(model.triageQuestionsModelList[index]); + if (widget.selectedQuestions!.contains(model.triageQuestionsModelList[index])) { + widget.selectedQuestions!.remove(model.triageQuestionsModelList[index]); } else { - widget.selectedQuestions.add(model.triageQuestionsModelList[index]); + widget.selectedQuestions!.add(model.triageQuestionsModelList[index]); } }); }, @@ -53,23 +53,23 @@ class _EdOnlineQuestionsPageState extends State { child: Row( children: [ Checkbox( - value: widget.selectedQuestions.contains(model.triageQuestionsModelList[index]), + value: widget.selectedQuestions!.contains(model.triageQuestionsModelList[index]), activeColor: Color(0xffD02127), tristate: false, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - onChanged: (bool newValue) { + onChanged: (bool? newValue) { setState(() { - if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) { - widget.selectedQuestions.remove(model.triageQuestionsModelList[index]); + if (widget.selectedQuestions!.contains(model.triageQuestionsModelList[index])) { + widget.selectedQuestions!.remove(model.triageQuestionsModelList[index]); } else { - widget.selectedQuestions.add(model.triageQuestionsModelList[index]); + widget.selectedQuestions!.add(model.triageQuestionsModelList[index]); } }); }), SizedBox(width: 6), Expanded( child: Text( - model.triageQuestionsModelList[index].question, + model.triageQuestionsModelList[index].question!, overflow: TextOverflow.clip, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), ), @@ -107,7 +107,7 @@ class _EdOnlineQuestionsPageState extends State { disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12), elevation: 0, onPressed: () { - widget.changePageViewIndex(0); + widget.changePageViewIndex!(0); }, child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 16.0, color: Colors.white)), ), @@ -126,19 +126,19 @@ class _EdOnlineQuestionsPageState extends State { disabledForegroundColor: Color(0xFFbcc2c4).withOpacity(0.38), disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12), elevation: 0, - onPressed: widget.selectedQuestions.isEmpty + onPressed: widget.selectedQuestions!.isEmpty ? null : () { GifLoaderDialogUtils.showMyDialog(context); model .saveQuestionsInformation( - chiefComplaint: "", notes: "", selectedQuestions: widget.selectedQuestions, projectId: widget.selectedHospital.iD, selectedTime: DateTime.now()) + chiefComplaint: "", notes: "", selectedQuestions: widget.selectedQuestions, projectId: widget.selectedHospital!.iD, selectedTime: DateTime.now()) .then((value) { GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) AppToast.showErrorToast(message: model.error); else { - widget.changePageViewIndex(4); + widget.changePageViewIndex!(4); } }).catchError((onError) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart index 76eace88..76f77823 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart @@ -17,16 +17,16 @@ class EdOnlineSelectedHospitalPage extends StatefulWidget { final Function changePageViewIndex; TriageInformationRequest triageInformationRequest; - EdOnlineSelectedHospitalPage({Key key, this.changePageViewIndex, this.triageInformationRequest}) : super(key: key); + EdOnlineSelectedHospitalPage({Key? key, required this.changePageViewIndex, required this.triageInformationRequest}) : super(key: key); @override _EdOnlineSelectedHospitalPageState createState() => _EdOnlineSelectedHospitalPageState(); } class _EdOnlineSelectedHospitalPageState extends State { - HospitalsModel selectedProject; + late HospitalsModel selectedProject; final GlobalKey locationDropdownKey = GlobalKey(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; int _selected = 0; @override @@ -83,13 +83,13 @@ class _EdOnlineSelectedHospitalPageState extends State _EdPaymentInformationPageState(); } class _EdPaymentInformationPageState extends State { - MyInAppBrowser browser; - ProjectViewModel projectViewModel; + late MyInAppBrowser browser; + late ProjectViewModel projectViewModel; String transID = ""; @override @@ -70,12 +70,12 @@ class _EdPaymentInformationPageState extends State { child: _getNormalText(TranslationBase.of(context).patientShareToDo), ), Expanded( - child: _getNormalText(model.erPatientShareModel.patientShare.toStringAsFixed(2) ?? "0", isBold: true), + child: _getNormalText(model.erPatientShareModel.patientShare!.toStringAsFixed(2) ?? "0", isBold: true), ) ], ), ), - mDivider(Colors.grey[200]), + mDivider(Colors.grey[200]!), Container( width: double.infinity, padding: EdgeInsets.only(top: 3, bottom: 3), @@ -85,12 +85,12 @@ class _EdPaymentInformationPageState extends State { child: _getNormalText(TranslationBase.of(context).patientTaxToDo), ), Expanded( - child: _getNormalText(model.erPatientShareModel.patientTaxAmount.toStringAsFixed(2) ?? "0", isBold: true), + child: _getNormalText(model.erPatientShareModel.patientTaxAmount!.toStringAsFixed(2) ?? "0", isBold: true), ) ], ), ), - mDivider(Colors.grey[200]), + mDivider(Colors.grey[200]!), Container( width: double.infinity, padding: EdgeInsets.only(top: 3, bottom: 3), @@ -100,7 +100,7 @@ class _EdPaymentInformationPageState extends State { child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo), ), Expanded( - child: _getNormalText(model.erPatientShareModel.patientShareWithTax.toStringAsFixed(2) ?? "0", isBold: true), + child: _getNormalText(model.erPatientShareModel.patientShareWithTax!.toStringAsFixed(2) ?? "0", isBold: true), ) ], ), @@ -130,16 +130,16 @@ class _EdPaymentInformationPageState extends State { TranslationBase.of(context).payNow.toUpperCase(), () { Navigator.push(context, FadePage(page: PaymentMethod( - onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { + onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) { setState(() {}); - }, patientShare: model.erPatientShareModel.patientShareWithTax, isFromAdvancePayment: true, + }, patientShare: model.erPatientShareModel.patientShareWithTax!, isFromAdvancePayment: true, ))).then( (value) { print(value); if (value != null) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.selectedHospital.iD; - openPayment(value[0], projectViewModel.user, model.erPatientShareModel.patientShareWithTax, appo); + openPayment(value[0], projectViewModel.user!, model.erPatientShareModel.patientShareWithTax!, appo); } }, ); @@ -166,9 +166,9 @@ class _EdPaymentInformationPageState extends State { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); - transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user.patientID); - browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, - authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context); + transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user!.patientID!); + browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress!, paymentMethod, authenticatedUser.patientType, + authenticatedUser.firstName!, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context); } onBrowserLoadStart(String url) { diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 46a44613..9253dd52 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -15,15 +15,15 @@ import 'NearestEr.dart'; class ErOptions extends StatefulWidget { final bool isAppbar; - const ErOptions({Key key, this.isAppbar}) : super(key: key); + const ErOptions({Key? key, required this.isAppbar}) : super(key: key); @override _ErOptionsState createState() => _ErOptionsState(); } class _ErOptionsState extends State { - LocationUtils locationUtils; - ProjectViewModel projectViewModel; + late LocationUtils locationUtils; + late ProjectViewModel projectViewModel; @override void initState() { diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 73029a43..5b613150 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -15,10 +15,10 @@ import '../../uitl/translations_delegate_base.dart'; class NearestEr extends StatefulWidget { static const String _url = "assets/images/"; - int appointmentNo; - int projectID; + int? appointmentNo; + int? projectID; - NearestEr({this.appointmentNo, this.projectID}); + NearestEr({ this.appointmentNo, this.projectID}); @override _NearestErState createState() => _NearestErState(); @@ -27,8 +27,8 @@ class NearestEr extends StatefulWidget { class _NearestErState extends State { List projectAvgERWaitingTimeModelList =[]; - bool isDataLoaded; - LocationUtils locationUtils; + late bool isDataLoaded; + late LocationUtils locationUtils; @override void initState() { @@ -73,7 +73,7 @@ class _NearestErState extends State { location.locationName = projectAvgERWaitingTimeModelList[index].projectName; location.cityName = projectAvgERWaitingTimeModelList[index].projectName; location.projectImageURL = projectAvgERWaitingTimeModelList[index].projectImageURL; - location.phoneNumber = projectAvgERWaitingTimeModelList[index].phoneNumber; + location.phoneNumber = projectAvgERWaitingTimeModelList[index].phonenumber; location.latitude = projectAvgERWaitingTimeModelList[index].latitude; location.longitude = projectAvgERWaitingTimeModelList[index].longitude; location.distanceInKilometers = projectAvgERWaitingTimeModelList[index].distanceInKilometers; diff --git a/lib/pages/ErService/OrderLogPage.dart b/lib/pages/ErService/OrderLogPage.dart index dda26e28..d1995017 100644 --- a/lib/pages/ErService/OrderLogPage.dart +++ b/lib/pages/ErService/OrderLogPage.dart @@ -17,7 +17,7 @@ import 'package:provider/provider.dart'; class OrderLogPage extends StatelessWidget { final AmRequestViewModel amRequestViewModel; - OrderLogPage({Key key, @required this.amRequestViewModel}); + OrderLogPage({Key? key, required this.amRequestViewModel}); @override Widget build(BuildContext context) { @@ -27,21 +27,21 @@ class OrderLogPage extends StatelessWidget { showDialog( context: context, builder: (cxt) => ConfirmWithMessageDialog( - message: TranslationBase.of(context).cancelOrderMsg, - onTap: () { - Future.delayed(new Duration(milliseconds: 300)).then((value) async { - // GifLoaderDialogUtils.showMyDialog(context); - await model.updatePressOrder(presOrderID: presOrderID); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - // GifLoaderDialogUtils.hideDialog(context); - } else { - AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); - // GifLoaderDialogUtils.hideDialog(context); - } - }); - }, - )); + message: TranslationBase.of(context).cancelOrderMsg, + onTap: () { + Future.delayed(new Duration(milliseconds: 300)).then((value) async { + // GifLoaderDialogUtils.showMyDialog(context); + await model.updatePressOrder(presOrderID: presOrderID); + if (model.state == ViewState.ErrorLocal) { + Utils.showErrorToast(model.error); + // GifLoaderDialogUtils.hideDialog(context); + } else { + AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully); + // GifLoaderDialogUtils.hideDialog(context); + } + }); + }, + )); return; } @@ -56,9 +56,9 @@ class OrderLogPage extends StatelessWidget { itemBuilder: (context, index) { AmbulanceRequestOrdersModel order = amRequestViewModel.patientAmbulanceRequestOrdersList.reversed.toList()[index]; - int status = order.statusId; - String _statusDisp = order.statusText; - Color _color; + int status = order.statusId!; + String _statusDisp = order.statusText!; + Color? _color; if (status == 1) { //pending _color = Color(0xffCC9B14); @@ -130,7 +130,7 @@ class OrderLogPage extends StatelessWidget { ), Expanded( child: Text( - DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created!)!), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), ), ), @@ -145,7 +145,7 @@ class OrderLogPage extends StatelessWidget { ), Expanded( child: Text( - order.serviceText, + order.serviceText!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), ), ), @@ -165,7 +165,7 @@ class OrderLogPage extends StatelessWidget { if (order.statusId == 1 || order.statusId == 2) InkWell( onTap: () { - showConfirmMessage(amRequestViewModel, order.iD, context); + showConfirmMessage(amRequestViewModel, order.iD!, context); }, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), @@ -203,7 +203,7 @@ class OrderLogPage extends StatelessWidget { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), Text( - order.pickupLocation.trim().toString(), + order.pickupLocation!.trim().toString(), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), ], @@ -235,7 +235,7 @@ class OrderLogPage extends StatelessWidget { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), Text( - order.dropOffLocation.trim().toString(), + order.dropOffLocation!.trim().toString(), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), ], diff --git a/lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart b/lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart index 4ee9cb65..8be47868 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-agreement-page.dart @@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RRTAgreementPage extends StatelessWidget{ - TranslationBase localize; + late TranslationBase localize; @override Widget build(BuildContext context) { diff --git a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart index 90ee7c48..314abf9a 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-logs-page.dart @@ -14,14 +14,14 @@ import 'package:flutter/material.dart'; class RRTLogPage extends StatefulWidget { final List orders; - const RRTLogPage({this.orders}); + const RRTLogPage({required this.orders}); @override State createState() => RRTLogPageState(); } class RRTLogPageState extends State { - RRTViewModel viewModel; + late RRTViewModel viewModel; @override void initState() { diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index e1aece5c..aa718100 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -21,15 +21,15 @@ class RRTMainScreen extends StatefulWidget { class RRTMainScreenState extends State with SingleTickerProviderStateMixin { int currentIndex = 0; - TabController tabController; + late TabController tabController; PageController pageController = PageController(initialPage: 0, keepPage: true); - RRTViewModel viewModel; - bool loadingData; + late RRTViewModel viewModel; + late bool loadingData; List imagesInfo =[]; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override void initState() { @@ -38,7 +38,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS tabController = TabController(length: 2, vsync: this); } - TranslationBase localize; + late TranslationBase localize; @override Widget build(BuildContext context) { @@ -127,7 +127,7 @@ class RRTMainScreenState extends State with SingleTickerProviderS onPageChanged: onPageChanged, controller: pageController, children: [ - RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders, viewModel: viewModel), + RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice!, pendingOrders: viewModel.rrtServiceData.pendingOrders, viewModel: viewModel), RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), ], ); diff --git a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart index dfb7cdaa..50df1033 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart @@ -17,27 +17,28 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); class RRTLogListItem extends StatefulWidget { - final GetCMCAllOrdersResponseModel order; - final Function(GetCMCAllOrdersResponseModel) onCancel; + final GetCMCAllOrdersResponseModel? order; + final Function(GetCMCAllOrdersResponseModel)? onCancel; RRTLogListItem(this.order, {this.onCancel}); + @override State createState() => RRTLogListItemState(); - BuildContext _context; + late BuildContext _context; } class RRTLogListItemState extends State { - RRTViewModel viewModel; - TranslationBase localize; + late RRTViewModel viewModel; + late TranslationBase localize; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); localize = TranslationBase.of(context); - int status = widget.order.statusId; - String _statusDisp = widget.order.statusText; - Color _color; + int status = widget.order!.statusId!; + String _statusDisp = widget.order!.statusText!; + Color? _color; if (status == 1) { //pending _color = Color(0xffCC9B14); @@ -100,7 +101,7 @@ class RRTLogListItemState extends State { ), SizedBox(height: 6), Text( - '${TranslationBase.of(context).requestID}: ${widget.order.iD}', + '${TranslationBase.of(context).requestID}: ${widget.order!.iD}', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), // Row( @@ -127,7 +128,7 @@ class RRTLogListItemState extends State { ), Expanded( child: Text( - DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order!.created!)!), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), @@ -141,11 +142,11 @@ class RRTLogListItemState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order!.created!)!), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), - if (widget.order.statusId == 1 || widget.order.statusId == 2) + if (widget.order!.statusId == 1 || widget.order!.statusId == 2) InkWell( onTap: () { //onCancel(order); diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart index 56033e8c..3aee659f 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -32,7 +32,7 @@ class RRTRequestPickupAddressPage extends StatefulWidget { final ServicePrice servicePrice; final VidaProcedureList selectedProcedure; - RRTRequestPickupAddressPage({@required this.servicePrice, @required this.selectedProcedure}); + RRTRequestPickupAddressPage({required this.servicePrice, required this.selectedProcedure}); @override State createState() => RRTRequestPickupAddressPageState(); @@ -49,21 +49,21 @@ class RRTRequestPickupAddressPageState extends State myAddresses = []; AddressInfo selectedAddress = new AddressInfo(); StreamController addressStreamController = StreamController(); - Stream addressStream; + late Stream addressStream; StreamController addressLoadingStreamController = StreamController(); - Stream addressLoadingStream; + late Stream addressLoadingStream; // AddressInfo _selectedAddress; double latitude = 0; double longitude = 0; - AppMap appMap; + late AppMap appMap; bool showCurrentLocation = false; AppSharedPreferences sharedPref = AppSharedPreferences(); - LocationUtils locationUtils; + late LocationUtils locationUtils; @override void initState() { @@ -72,9 +72,10 @@ class RRTRequestPickupAddressPageState extends State locationUtils.getCurrentLocation()); appMap = AppMap( - cameraPosition.toMap(), + cameraPosition.toMap() as Map, + //Changed by Aamir onCameraMove: (camera) { - _updatePosition(camera); + _updatePosition(camera as CameraPosition); }, onMapCreated: () { _getUserLocation(); @@ -83,7 +84,7 @@ class RRTRequestPickupAddressPageState extends State( onModelReady: (vm) => viewModel = vm, @@ -171,7 +171,7 @@ class RRTPlaceOrderPage extends StatelessWidget { } placeOrder() async { - if (selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong.isNotEmpty && selectedAddress.latLong.split(',').length > 1) { + if (selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong!.isNotEmpty && selectedAddress.latLong!.split(',').length > 1) { GifLoaderDialogUtils.showMyDialog(_context); RRTRequestModel rrtRequestModel = new RRTRequestModel(); @@ -179,7 +179,7 @@ class RRTPlaceOrderPage extends StatelessWidget { rrtRequestModel.procedures = []; Map params = {}; - var cordinates = selectedAddress.latLong.split(','); + var cordinates = selectedAddress.latLong!.split(','); var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last)); procedures.serviceID = selectedProcedure.procedureID; @@ -187,12 +187,12 @@ class RRTPlaceOrderPage extends StatelessWidget { rrtRequestModel.latitude = latlng.latitude; rrtRequestModel.longitude = latlng.longitude; rrtRequestModel.additionalDetails = noteController.text; - rrtRequestModel.nationality = projectViewModel.user.nationalityID; + rrtRequestModel.nationality = projectViewModel.user!.nationalityID; rrtRequestModel.paymentAmount = selectedProcedure.patientShareWithTax; rrtRequestModel.nearestProjectId = 0; - rrtRequestModel.patientId = projectViewModel.user.patientID; - rrtRequestModel.patientOutSa = projectViewModel.user.outSA; - rrtRequestModel.procedures.add(procedures); + rrtRequestModel.patientId = projectViewModel.user!.patientID; + rrtRequestModel.patientOutSa = projectViewModel.user!.outSA; + rrtRequestModel.procedures!.add(procedures); // params['latitude'] = latlng.latitude; // params['longitude'] = latlng.longitude; @@ -201,7 +201,7 @@ class RRTPlaceOrderPage extends StatelessWidget { // params['paymentAmount'] = selectedProcedure.patientShareWithTax; // params['procedureId'] = selectedProcedure.procedureID; - var requestId = await viewModel.createOrderRC(rrtRequestModel.toJson()); + var requestId = await viewModel!.createOrderRC(rrtRequestModel.toJson()); GifLoaderDialogUtils.hideDialog(_context); @@ -234,9 +234,9 @@ class RRTPlaceOrderPage extends StatelessWidget { } gotoRRTRoot() async { - viewModel.setState(ViewState.Busy); - await viewModel.getAllOrdersRC(); - viewModel.setState(ViewState.Idle); + viewModel!.setState(ViewState.Busy); + await viewModel!.getAllOrdersRC(); + viewModel!.setState(ViewState.Idle); Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.push(_context, FadePage(page: RRTMainScreen())); } diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index 8541b859..27275a83 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -22,7 +22,7 @@ class RRTRequestPage extends StatefulWidget { final ServicePrice servicePrice; RRTViewModel viewModel; - RRTRequestPage({this.pendingOrders, this.servicePrice, this.viewModel}); + RRTRequestPage({required this.pendingOrders, required this.servicePrice, required this.viewModel}); @override State createState() => RRTRequestPageState(); @@ -30,7 +30,7 @@ class RRTRequestPage extends StatefulWidget { class RRTRequestPageState extends State { bool acceptTerms = false; - VidaProcedureList selectedProcedure; + late VidaProcedureList selectedProcedure; @override void initState() { @@ -95,7 +95,7 @@ class RRTRequestPageState extends State { toggleable: true, onChanged: (value) { setState(() { - selectedProcedure = value; + selectedProcedure = value!; print(selectedProcedure.procedureName); // getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); }); @@ -104,7 +104,7 @@ class RRTRequestPageState extends State { Expanded( child: Text( // projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName, - widget.viewModel.rrtProcedureList[index].procedureName, + widget.viewModel.rrtProcedureList[index].procedureName!, style: TextStyle( fontSize: 12.0, letterSpacing: -0.48, @@ -186,7 +186,7 @@ class RRTRequestPageState extends State { ); } - Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}) { + Widget pricingRow({required String label, required String value, bool labelBold = false, bool valueBold = false}) { return Container( height: 35, margin: EdgeInsets.symmetric(horizontal: 10), @@ -216,7 +216,7 @@ class RRTRequestPageState extends State { Checkbox( value: acceptTerms, onChanged: (v) { - setState(() => acceptTerms = v); + setState(() => acceptTerms = v!); }), SizedBox(width: 10), Expanded(child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 12, color: CustomColors.textColor), maxLines: 2)), diff --git a/lib/pages/ErService/widgets/AppointmentCard.dart b/lib/pages/ErService/widgets/AppointmentCard.dart index 0437c32f..3dd13ce9 100644 --- a/lib/pages/ErService/widgets/AppointmentCard.dart +++ b/lib/pages/ErService/widgets/AppointmentCard.dart @@ -8,7 +8,7 @@ import 'package:flutter/material.dart'; class AppointmentCard extends StatelessWidget { final AppoitmentAllHistoryResultList appointment; - const AppointmentCard({Key key, this.appointment}) : super(key: key); + const AppointmentCard({Key? key, required this.appointment}) : super(key: key); @override Widget build(BuildContext context) { return Container( @@ -22,8 +22,8 @@ class AppointmentCard extends StatelessWidget { child: Row( children: [ LargeAvatar( - url: appointment.doctorImageURL, - name: appointment.doctorNameObj, + url: appointment.doctorImageURL!, + name: appointment.doctorNameObj!, ), Expanded( child: Padding( @@ -35,7 +35,7 @@ class AppointmentCard extends StatelessWidget { SizedBox(height: 4,), Texts(appointment.projectName), Texts(appointment.clinicName), - Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate))), + Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate!))), ], ), ), diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart index 219cfd60..631f0a2f 100644 --- a/lib/pages/ErService/widgets/StepsWidget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -10,7 +10,7 @@ class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; - StepsWidget({Key key, this.index, this.changeCurrentTab}); + StepsWidget({Key? key, required this.index, required this.changeCurrentTab}); @override Widget build(BuildContext context) { @@ -287,7 +287,7 @@ class StepsWidget extends StatelessWidget { // ); } - Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) { + Widget showProgress({required String title, required String status, required Color color, bool isNeedBorder = true}) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/pages/conference/clipped_video.dart b/lib/pages/conference/clipped_video.dart index 1c01c27c..14711656 100644 --- a/lib/pages/conference/clipped_video.dart +++ b/lib/pages/conference/clipped_video.dart @@ -6,10 +6,10 @@ class ClippedVideo extends StatefulWidget { final Widget child; const ClippedVideo({ - Key key, - @required this.width, - @required this.height, - @required this.child, + Key? key, + required this.width, + required this.height, + required this.child, }) : super(key: key); @override diff --git a/lib/pages/conference/conference_button_bar.dart b/lib/pages/conference/conference_button_bar.dart index d49c4e4a..1b80c3d5 100644 --- a/lib/pages/conference/conference_button_bar.dart +++ b/lib/pages/conference/conference_button_bar.dart @@ -5,28 +5,28 @@ import 'package:diplomaticquarterapp/pages/conference/widgets/circle_button.dart import 'package:flutter/material.dart'; class ConferenceButtonBar extends StatefulWidget { - final VoidCallback onVideoEnabled; - final VoidCallback onAudioEnabled; - final VoidCallback onHangup; - final VoidCallback onSwitchCamera; - final VoidCallback onPersonAdd; - final VoidCallback onPersonRemove; - final void Function(double) onHeight; - final VoidCallback onHide; - final VoidCallback onShow; + final VoidCallback? onVideoEnabled; + final VoidCallback? onAudioEnabled; + final VoidCallback? onHangup; + final VoidCallback? onSwitchCamera; + final VoidCallback? onPersonAdd; + final VoidCallback? onPersonRemove; + final void Function(double)? onHeight; + final VoidCallback? onHide; + final VoidCallback? onShow; final Stream videoEnabled; final Stream audioEnabled; const ConferenceButtonBar({ - Key key, + Key? key, this.onVideoEnabled, this.onAudioEnabled, this.onHangup, this.onSwitchCamera, this.onPersonAdd, this.onPersonRemove, - @required this.videoEnabled, - @required this.audioEnabled, + required this.videoEnabled, + required this.audioEnabled, this.onHeight, this.onHide, this.onShow, @@ -40,19 +40,19 @@ class ConferenceButtonBar extends StatefulWidget { class _ConferenceButtonBarState extends State with AfterLayoutMixin { var _bottom = -100.0; - Timer _timer; - int _remaining; + late Timer _timer; + late int _remaining; var _videoEnabled = true; var _audioEnabled = true; - double _hidden; - double _visible; + late double _hidden; + late double _visible; final _keyButtonBarHeight = GlobalKey(); final Duration timeout = const Duration(seconds: 5); final Duration ms = const Duration(milliseconds: 1); final Duration periodicDuration = const Duration(milliseconds: 100); - Timer startTimeout([int milliseconds]) { + Timer startTimeout([int? milliseconds]) { final duration = milliseconds == null ? timeout : ms * milliseconds; _remaining = duration.inMilliseconds; return Timer.periodic(periodicDuration, (Timer timer) { @@ -69,7 +69,7 @@ class _ConferenceButtonBarState extends State with AfterLay return; } _timer.cancel(); - _timer = null; + // _timer = null; } void _resumeTimer() { @@ -85,10 +85,10 @@ class _ConferenceButtonBarState extends State with AfterLay setState(() { _bottom = _bottom == _visible ? _hidden : _visible; if (_bottom == _visible && widget.onShow != null) { - widget.onShow(); + widget.onShow!(); } if (_bottom == _hidden && widget.onHide != null) { - widget.onHide(); + widget.onHide!(); } }); } @@ -98,7 +98,7 @@ class _ConferenceButtonBarState extends State with AfterLay if (_timer.isActive) { _timer.cancel(); } - _timer = null; + // _timer = null; } if (_bottom == 0) { _timer = startTimeout(); @@ -119,11 +119,11 @@ class _ConferenceButtonBarState extends State with AfterLay @override void afterFirstLayout(BuildContext context) { - final RenderBox renderBoxButtonBar = _keyButtonBarHeight.currentContext.findRenderObject(); - final heightButtonBar = renderBoxButtonBar.size.height; + final heightButtonBar = _keyButtonBarHeight.currentContext!.size!.height; + //Changed by Aamir // Because the `didChangeDependencies` fires before the `afterFirstLayout`, we can use the `_visible` property here. _hidden = -(heightButtonBar + _visible); - widget.onHeight(heightButtonBar); + widget.onHeight!(heightButtonBar); _toggleBar(); } @@ -132,7 +132,7 @@ class _ConferenceButtonBarState extends State with AfterLay super.dispose(); if (_timer != null && _timer.isActive) { _timer.cancel(); - _timer = null; + } } @@ -189,33 +189,33 @@ class _ConferenceButtonBarState extends State with AfterLay stream: widget.videoEnabled, initialData: _videoEnabled, builder: (context, snapshot) { - _videoEnabled = snapshot.data; + _videoEnabled = snapshot.data!; return Icon( _videoEnabled ? Icons.videocam : Icons.videocam_off, color: Colors.white, ); }), key: Key('camera-button'), - onPressed: () => _onPressed(widget.onVideoEnabled), + onPressed: () => _onPressed(widget.onVideoEnabled!), ), CircleButton( child: StreamBuilder( stream: widget.audioEnabled, initialData: _audioEnabled, builder: (context, snapshot) { - _audioEnabled = snapshot.data; + _audioEnabled = snapshot.data!; return Icon( _audioEnabled ? Icons.mic : Icons.mic_off, color: Colors.white, ); }), key: Key('microphone-button'), - onPressed: () => _onPressed(widget.onAudioEnabled), + onPressed: () => _onPressed(widget.onAudioEnabled!), ), CircleButton( child: const Icon(Icons.switch_camera, color: Colors.white), key: Key('switch-camera-button'), - onPressed: () => _onPressed(widget.onSwitchCamera), + onPressed: () => _onPressed(widget.onSwitchCamera!), ), CircleButton( radius: 35, @@ -229,7 +229,7 @@ class _ConferenceButtonBarState extends State with AfterLay ), color: Colors.red.withAlpha(200), key: Key('hangup-button'), - onPressed: () => _onPressed(widget.onHangup), + onPressed: () => _onPressed(widget.onHangup!), ), ], ), diff --git a/lib/pages/conference/draggable_publisher.dart b/lib/pages/conference/draggable_publisher.dart index a1a0b142..94c15af9 100644 --- a/lib/pages/conference/draggable_publisher.dart +++ b/lib/pages/conference/draggable_publisher.dart @@ -12,11 +12,11 @@ class DraggablePublisher extends StatefulWidget { final Stream onButtonBarHeight; const DraggablePublisher({ - Key key, - @required this.availableScreenSize, - this.child, - @required this.onButtonBarVisible, - @required this.onButtonBarHeight, + Key? key, + required this.availableScreenSize, + required this.child, + required this.onButtonBarVisible, + required this.onButtonBarHeight, /// The portion of the screen the DraggableWidget should use. this.scaleFactor = .25, @@ -33,18 +33,18 @@ class DraggablePublisher extends StatefulWidget { class _DraggablePublisherState extends State { bool _isButtonBarVisible = true; double _buttonBarHeight = 0; - double _width; - double _height; - double _top; - double _left; - double _viewPaddingTop; - double _viewPaddingBottom; + late double _width; + late double _height; + late double _top; + late double _left; + late double _viewPaddingTop; + late double _viewPaddingBottom; final double _padding = 8.0; final Duration _duration300ms = const Duration(milliseconds: 300); final Duration _duration0ms = const Duration(milliseconds: 0); - Duration _duration; - StreamSubscription _streamSubscription; - StreamSubscription _streamHeightSubscription; + late Duration _duration; + late StreamSubscription _streamSubscription; + late StreamSubscription _streamHeightSubscription; @override void initState() { diff --git a/lib/pages/conference/participant_widget.dart b/lib/pages/conference/participant_widget.dart index 5b8d1ff2..b9bfafcf 100644 --- a/lib/pages/conference/participant_widget.dart +++ b/lib/pages/conference/participant_widget.dart @@ -7,8 +7,8 @@ class ParticipantBuffer { final String id; ParticipantBuffer({ - @required this.audioEnabled, - @required this.id, + required this.audioEnabled, + required this.id, }) : assert(audioEnabled != null), assert(id != null); } @@ -23,12 +23,12 @@ class ParticipantWidget extends StatelessWidget { final bool isDominant; const ParticipantWidget({ - Key key, - @required this.child, - @required this.audioEnabled, - @required this.videoEnabled, - @required this.id, - @required this.isRemote, + Key? key, + required this.child, + required this.audioEnabled, + required this.videoEnabled, + required this.id, + required this.isRemote, this.isDominant = false, this.isDummy = false, }) : assert(child != null), @@ -40,10 +40,10 @@ class ParticipantWidget extends StatelessWidget { super(key: key); ParticipantWidget copyWith({ - Widget child, - bool audioEnabled, - bool videoEnabled, - bool isDominant, + Widget? child, + bool? audioEnabled, + bool? videoEnabled, + bool? isDominant, }) { return ParticipantWidget( id: id, diff --git a/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart b/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart index c652cacc..10dc8523 100644 --- a/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart +++ b/lib/pages/conference/web_rtc/widgets/cam_view_widget.dart @@ -8,12 +8,12 @@ import 'package:flutter_webrtc/flutter_webrtc.dart'; import 'draggable_cam.dart'; class CamViewWidget extends StatefulWidget { - RTCVideoRenderer localRenderer; - RTCVideoRenderer remoteRenderer; - MediaStream localStream; - BoxConstraints constraints; - StreamController onButtonBarVisibleStreamController; - StreamController onButtonBarHeightStreamController; + RTCVideoRenderer? localRenderer; + RTCVideoRenderer? remoteRenderer; + MediaStream? localStream; + BoxConstraints? constraints; + StreamController? onButtonBarVisibleStreamController; + StreamController? onButtonBarHeightStreamController; CamViewWidget({this.localRenderer, this.remoteRenderer, this.constraints, this.onButtonBarVisibleStreamController, this.onButtonBarHeightStreamController}); @@ -38,26 +38,26 @@ class _CamViewWidgetState extends State { heightFactor: 1, widthFactor: 1, child: Container( color: Colors.black87, - child: RTCVideoView(widget.remoteRenderer, mirror: true,filterQuality: FilterQuality.medium,), + child: RTCVideoView(widget.remoteRenderer!, mirror: true,filterQuality: FilterQuality.medium,), ), ), - if(widget.remoteRenderer.srcObject == null) + if(widget.remoteRenderer!.srcObject == null) Positioned.fill(child: _buildNoiseBox()), Positioned.fill( - child: RTCVideoView(widget.remoteRenderer) + child: RTCVideoView(widget.remoteRenderer!) ), DraggableCam( key: Key('publisher'), - onButtonBarHeight: widget.onButtonBarHeightStreamController.stream, - onButtonBarVisible: widget.onButtonBarVisibleStreamController.stream, - availableScreenSize: widget.constraints.biggest, - child: RTCVideoView(widget.localRenderer) + onButtonBarHeight: widget.onButtonBarHeightStreamController!.stream, + onButtonBarVisible: widget.onButtonBarVisibleStreamController!.stream, + availableScreenSize: widget.constraints!.biggest, + child: RTCVideoView(widget.localRenderer!) ), - if(widget.remoteRenderer.srcObject == null) + if(widget.remoteRenderer!.srcObject == null) Container( margin: EdgeInsets.all(MediaQuery.of(context).size.width/8), child: Text( diff --git a/lib/pages/conference/web_rtc/widgets/draggable_cam.dart b/lib/pages/conference/web_rtc/widgets/draggable_cam.dart index efc59301..2fef0dad 100644 --- a/lib/pages/conference/web_rtc/widgets/draggable_cam.dart +++ b/lib/pages/conference/web_rtc/widgets/draggable_cam.dart @@ -12,11 +12,11 @@ class DraggableCam extends StatefulWidget { final Stream onButtonBarHeight; const DraggableCam({ - Key key, - @required this.availableScreenSize, - this.child, - @required this.onButtonBarVisible, - @required this.onButtonBarHeight, + Key? key, + required this.availableScreenSize, + required this.child, + required this.onButtonBarVisible, + required this.onButtonBarHeight, /// The portion of the screen the DraggableWidget should use. this.scaleFactor = .25, @@ -33,27 +33,27 @@ class DraggableCam extends StatefulWidget { class _DraggablePublisherState extends State { bool _isButtonBarVisible = true; double _buttonBarHeight = 0; - double _width; - double _height; - double _top; - double _left; - double _viewPaddingTop; - double _viewPaddingBottom; + double? _width; + double? _height; + double? _top; + double? _left; + double? _viewPaddingTop; + double? _viewPaddingBottom; final double _padding = 8.0; final Duration _duration300ms = const Duration(milliseconds: 300); final Duration _duration0ms = const Duration(milliseconds: 0); - Duration _duration; - StreamSubscription _streamSubscription; - StreamSubscription _streamHeightSubscription; + Duration? _duration; + StreamSubscription? _streamSubscription; + StreamSubscription? _streamHeightSubscription; @override void initState() { super.initState(); _duration = _duration300ms; _width = widget.availableScreenSize.width * widget.scaleFactor; - _height = _width * (widget.availableScreenSize.height / widget.availableScreenSize.width); - _top = widget.availableScreenSize.height - (_buttonBarHeight + _padding) - _height; - _left = widget.availableScreenSize.width - _padding - _width; + _height = _width! * (widget.availableScreenSize.height / widget.availableScreenSize.width); + _top = widget.availableScreenSize.height - (_buttonBarHeight + _padding) - _height!; + _left = widget.availableScreenSize.width - _padding - _width!; _streamSubscription = widget.onButtonBarVisible.listen(_buttonBarVisible); _streamHeightSubscription = widget.onButtonBarHeight.listen(_getButtonBarHeight); @@ -69,8 +69,8 @@ class _DraggablePublisherState extends State { @override void dispose() { - _streamSubscription.cancel(); - _streamHeightSubscription.cancel(); + _streamSubscription!.cancel(); + _streamHeightSubscription!.cancel(); super.dispose(); } @@ -101,20 +101,20 @@ class _DraggablePublisherState extends State { left: _left, width: _width, height: _height, - duration: _duration, + duration: _duration!, child: Listener( onPointerDown: (_) => _duration = _duration0ms, onPointerMove: (PointerMoveEvent event) { setState(() { - _left = (_left + event.delta.dx).roundToDouble(); - _top = (_top + event.delta.dy).roundToDouble(); + _left = (_left! + event.delta.dx).roundToDouble(); + _top = (_top! + event.delta.dy).roundToDouble(); }); }, onPointerUp: (_) => _positionWidget(), onPointerCancel: (_) => _positionWidget(), child: ClippedVideo( - height: _height, - width: _width, + height: _height!, + width: _width!, child: widget.child, ), ), @@ -123,29 +123,29 @@ class _DraggablePublisherState extends State { double _getCurrentStatusBarHeight() { if (_isButtonBarVisible) { - return _viewPaddingTop; + return _viewPaddingTop!; } final _defaultViewPaddingTop = Platform.isIOS ? 20.0 : Platform.isAndroid ? 24.0 : 0.0; - if (_viewPaddingTop > _defaultViewPaddingTop) { + if (_viewPaddingTop! > _defaultViewPaddingTop) { // There must be a hardware notch in the display. - return _viewPaddingTop; + return _viewPaddingTop!; } return 0.0; } double _getCurrentButtonBarHeight() { if (_isButtonBarVisible) { - return _buttonBarHeight + _viewPaddingBottom; + return _buttonBarHeight + _viewPaddingBottom!; } - return _viewPaddingBottom; + return _viewPaddingBottom!; } void _positionWidget() { // Determine the center of the object being dragged so we can decide // in which corner the object should be placed. - var dx = (_width / 2) + _left; + var dx = (_width! / 2) + _left!; dx = dx < 0 ? 0 : dx >= widget.availableScreenSize.width ? widget.availableScreenSize.width - 1 : dx; - var dy = (_height / 2) + _top; + var dy = (_height! / 2) + _top!; dy = dy < 0 ? 0 : dy >= widget.availableScreenSize.height ? widget.availableScreenSize.height - 1 : dy; final draggableCenter = Offset(dx, dy); @@ -158,15 +158,15 @@ class _DraggablePublisherState extends State { } else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, 0, widget.availableScreenSize.width, widget.availableScreenSize.height / 2).contains(draggableCenter)) { // Top-right _top = _getCurrentStatusBarHeight() + _padding; - _left = widget.availableScreenSize.width - _padding - _width; + _left = widget.availableScreenSize.width - _padding - _width!; } else if (Rect.fromLTRB(0, widget.availableScreenSize.height / 2, widget.availableScreenSize.width / 2, widget.availableScreenSize.height).contains(draggableCenter)) { // Bottom-left - _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height; + _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height!; _left = _padding; } else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, widget.availableScreenSize.height / 2, widget.availableScreenSize.width, widget.availableScreenSize.height).contains(draggableCenter)) { // Bottom-right - _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height; - _left = widget.availableScreenSize.width - _padding - _width; + _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height!; + _left = widget.availableScreenSize.width - _padding - _width!; } }); } diff --git a/lib/pages/conference/widgets/button_to_progress.dart b/lib/pages/conference/widgets/button_to_progress.dart index 2879dc60..da7850c2 100644 --- a/lib/pages/conference/widgets/button_to_progress.dart +++ b/lib/pages/conference/widgets/button_to_progress.dart @@ -6,15 +6,15 @@ import 'package:flutter/material.dart'; class ButtonToProgress extends StatefulWidget { final double height; final double progressHeight; - final String loadingText; + final String? loadingText; final Duration duration; - final TextStyle loadingTextStyle; - final VoidCallback onPressed; - final Stream onLoading; + final TextStyle? loadingTextStyle; + final VoidCallback? onPressed; + final Stream? onLoading; final Widget child; const ButtonToProgress({ - Key key, + Key? key, this.height = 40.0, this.progressHeight = 5.0, this.loadingText, @@ -22,7 +22,7 @@ class ButtonToProgress extends StatefulWidget { this.loadingTextStyle, this.onPressed, this.onLoading, - @required this.child, + required this.child, }) : assert(child != null), assert(height != null && height > 0), assert(progressHeight != null && progressHeight > 0 && progressHeight <= height), @@ -33,18 +33,18 @@ class ButtonToProgress extends StatefulWidget { } class _ButtonToProgressState extends State { - double _height; + double? _height; double _opacity = 0; bool _isLoading = false; - StreamSubscription _subscription; + StreamSubscription? _subscription; @override void initState() { super.initState(); _height = widget.height; if (widget.onLoading != null) { - _subscription = widget.onLoading.listen((bool isLoading) { + _subscription = widget.onLoading!.listen((bool isLoading) { setState(() { _isLoading = isLoading; _height = isLoading ? widget.progressHeight : widget.height; @@ -57,7 +57,7 @@ class _ButtonToProgressState extends State { @override void dispose() { if (_subscription != null) { - _subscription.cancel(); + _subscription!.cancel(); } super.dispose(); } @@ -77,7 +77,7 @@ class _ButtonToProgressState extends State { child: Center( child: FittedBox( child: Text( - widget.loadingText, + widget.loadingText!, style: widget.loadingTextStyle, ), ), @@ -90,7 +90,7 @@ class _ButtonToProgressState extends State { AnimatedPadding( duration: widget.duration, padding: EdgeInsets.only( - top: math.max(widget.height - _height, 0), + top: math.max(widget.height - _height!, 0), ), child: AnimatedContainer( duration: widget.duration, diff --git a/lib/pages/conference/widgets/circle_button.dart b/lib/pages/conference/widgets/circle_button.dart index 37702c29..b49c1e70 100644 --- a/lib/pages/conference/widgets/circle_button.dart +++ b/lib/pages/conference/widgets/circle_button.dart @@ -4,16 +4,16 @@ import 'package:flutter/material.dart'; import 'package:native_device_orientation/native_device_orientation.dart'; class CircleButton extends StatefulWidget { - final VoidCallback onLongPress; - final VoidCallback onPressed; - final GestureTapDownCallback onTapDown; - final VoidCallback onTapCancel; - final Widget child; - final Color color; - final double radius; + final VoidCallback? onLongPress; + final VoidCallback? onPressed; + final GestureTapDownCallback? onTapDown; + final VoidCallback? onTapCancel; + final Widget? child; + final Color? color; + final double? radius; const CircleButton({ - Key key, + Key? key, this.onLongPress, this.onPressed, this.child, @@ -32,7 +32,7 @@ class _CircleButtonState extends State { double _rotationAngle = 0.0; final Stream _orientationStream = NativeDeviceOrientationCommunicator().onOrientationChanged(useSensor: true); - StreamSubscription _orientationSubscription; + late StreamSubscription _orientationSubscription; void _handleOrientationChange(NativeDeviceOrientation orientation) { var targetAngle = 0.0; @@ -73,7 +73,7 @@ class _CircleButtonState extends State { @override Widget build(BuildContext context) { - final size = 2 * widget.radius; + final size = 2 * widget.radius!; return Container( width: size, @@ -81,7 +81,7 @@ class _CircleButtonState extends State { decoration: BoxDecoration( color: (widget.color ?? Colors.blue).withAlpha(200), borderRadius: BorderRadius.all( - Radius.circular(widget.radius), + Radius.circular(widget.radius!), ), ), child: GestureDetector( diff --git a/lib/pages/conference/widgets/noise_box.dart b/lib/pages/conference/widgets/noise_box.dart index 37d94fb5..6e46616e 100644 --- a/lib/pages/conference/widgets/noise_box.dart +++ b/lib/pages/conference/widgets/noise_box.dart @@ -13,11 +13,11 @@ enum NoiseBoxDensity { class NoiseBox extends StatefulWidget { final NoiseBoxDensity density; - final Color backgroundColor; - final Widget child; + final Color? backgroundColor; + final Widget? child; const NoiseBox({ - Key key, + Key? key, this.backgroundColor, this.child, this.density = NoiseBoxDensity.medium, @@ -29,8 +29,8 @@ class NoiseBox extends StatefulWidget { } class _NoiseBoxState extends State with TickerProviderStateMixin { - AnimationController _animationController; - int _density; + late AnimationController _animationController; + late int _density; @override void initState() { @@ -74,7 +74,7 @@ class _NoiseBoxState extends State with TickerProviderStateMixin { height: constraints.biggest.height, child: AnimatedBuilder( animation: _animationController, - builder: (BuildContext context, Widget w) { + builder: (BuildContext context, Widget? w) { final children = [ CustomPaint( painter: NoisePainter( @@ -85,7 +85,7 @@ class _NoiseBoxState extends State with TickerProviderStateMixin { ), ]; if (widget.child != null) { - children.add(widget.child); + children.add(widget.child!); } return Stack( children: children, @@ -103,9 +103,9 @@ class NoisePainter extends CustomPainter { final int density; NoisePainter({ - @required this.width, - @required this.height, - @required this.density, + required this.width, + required this.height, + required this.density, }) : assert(width != null), assert(height != null), assert(density != null && diff --git a/lib/pages/conference/widgets/platform_alert_dialog.dart b/lib/pages/conference/widgets/platform_alert_dialog.dart index 1f57119b..c98450e5 100644 --- a/lib/pages/conference/widgets/platform_alert_dialog.dart +++ b/lib/pages/conference/widgets/platform_alert_dialog.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; import './platform_widget.dart'; class PlatformAlertDialog extends PlatformWidget { - PlatformAlertDialog({@required this.title, @required this.content, @required this.defaultActionText, this.cancelActionText}) + PlatformAlertDialog({required this.title, required this.content, required this.defaultActionText, this.cancelActionText}) : assert(title != null), assert(content != null), assert(defaultActionText != null); @@ -14,9 +14,9 @@ class PlatformAlertDialog extends PlatformWidget { final String title; final String content; final String defaultActionText; - final String cancelActionText; + final String? cancelActionText; - Future show(BuildContext context) async { + Future show(BuildContext context) async { return Platform.isIOS ? await showCupertinoDialog( context: context, @@ -52,7 +52,7 @@ class PlatformAlertDialog extends PlatformWidget { if (cancelActionText != null) { actions.add( PlatformAlertDialogAction( - child: Text(cancelActionText), + child: Text(cancelActionText!), onPressed: () { Navigator.of(context).pop(false); }, @@ -73,8 +73,8 @@ class PlatformAlertDialog extends PlatformWidget { class PlatformAlertDialogAction extends PlatformWidget { PlatformAlertDialogAction({ - this.child, - this.onPressed, + required this.child, + required this.onPressed, }); final Widget child; diff --git a/lib/pages/conference/widgets/platform_exception_alert_dialog.dart b/lib/pages/conference/widgets/platform_exception_alert_dialog.dart index 12faf640..fea4bca9 100644 --- a/lib/pages/conference/widgets/platform_exception_alert_dialog.dart +++ b/lib/pages/conference/widgets/platform_exception_alert_dialog.dart @@ -6,7 +6,7 @@ import './platform_alert_dialog.dart'; class PlatformExceptionAlertDialog extends PlatformAlertDialog { PlatformExceptionAlertDialog({ String title = 'An error occurred', - @required Exception exception, + required Exception exception, }) : super( title: title, content: exception is PlatformException ? _message(exception) : exception.toString(), diff --git a/lib/pages/conference/widgets/responsive_save_area.dart b/lib/pages/conference/widgets/responsive_save_area.dart index f9a85467..9e38cbce 100644 --- a/lib/pages/conference/widgets/responsive_save_area.dart +++ b/lib/pages/conference/widgets/responsive_save_area.dart @@ -7,8 +7,8 @@ typedef ResponsiveBuilder = Widget Function( class ResponsiveSafeArea extends StatelessWidget { const ResponsiveSafeArea({ - @required ResponsiveBuilder builder, - Key key, + required ResponsiveBuilder builder, + Key? key, }) : responsiveBuilder = builder, assert(builder != null), super(key: key); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index f97f55f0..2eb47131 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -335,7 +335,7 @@ class DoctorsListService extends BaseService { } Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context, - [String? procedureID, num? testTypeEnum, num? testProcedureEnum, required ProjectViewModel projectViewModel]) async { + [String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel]) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -1843,6 +1843,4 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - } diff --git a/lib/widgets/buttons/custom_text_button.dart b/lib/widgets/buttons/custom_text_button.dart index 814acc64..3718c4d3 100644 --- a/lib/widgets/buttons/custom_text_button.dart +++ b/lib/widgets/buttons/custom_text_button.dart @@ -1,20 +1,20 @@ import 'package:flutter/material.dart'; class CustomTextButton extends StatelessWidget { - final Color backgroundColor; - final Color disabledColor; - final void Function() onPressed; - final void Function() onLongPress; - final void Function(bool) onHover; - final Widget child; - final OutlinedBorder shape; - final double elevation; - final BorderSide side; - final Color disabledForegroundColor; - final Color disabledBackgroundColor; + final Color? backgroundColor; + final Color? disabledColor; + final void Function()? onPressed; + final void Function()? onLongPress; + final void Function(bool)? onHover; + final Widget? child; + final OutlinedBorder? shape; + final double? elevation; + final BorderSide? side; + final Color? disabledForegroundColor; + final Color? disabledBackgroundColor; const CustomTextButton({ - Key key, + Key? key, this.backgroundColor, this.disabledColor, this.onPressed, @@ -40,7 +40,7 @@ class CustomTextButton extends StatelessWidget { side: side, ), onPressed: onPressed, - child: child, + child: child!, ); } } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index c91a17b7..b79e878c 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -198,16 +198,21 @@ class DoctorCard extends StatelessWidget { // ), RatingBar( initialRating: rating!, - // size: 18.0, - // filledColor: Color(0XFFD02127), - // emptyColor: Color(0XFFD02127), - // isHalfAllowed: true, - // halfFilledIcon: Icons.star_half, - // filledIcon: Icons.star, - // emptyIcon: , - // - ratingWidget: RatingWidget( full:Icon(Icons.star, color:Color(0XFFD02127)), half:Icon(Icons.star_half, color: Color(0XFFD02127)), empty: Icon(Icons.star_border,color: Color(0XFFD02127)) , - ), onRatingUpdate: (double value) { }), + ratingWidget: RatingWidget( + full: Icon( + Icons.star, + color: Color(0XFFD02127), + ), + half: Icon( + Icons.star_half, + color: Color(0XFFD02127), + ), + empty: Icon( + Icons.star_border, + color: Color(0XFFD02127), + ), + ), + onRatingUpdate: (double value) {}), ], ), if (remainingTimeInMinutes != null) diff --git a/lib/widgets/hospital_location.dart b/lib/widgets/hospital_location.dart index 2945686a..ab94aa2b 100644 --- a/lib/widgets/hospital_location.dart +++ b/lib/widgets/hospital_location.dart @@ -12,9 +12,9 @@ import 'my_rich_text.dart'; class HospitalLocation extends StatelessWidget { final GetHMGLocationsModel location; final bool showCity; - final String waitingTime; + final String? waitingTime; - HospitalLocation(this.location, {Key? key, this.showCity = false, required this.waitingTime}) : super(key: key); + HospitalLocation(this.location, {Key? key, this.showCity = false, this.waitingTime}) : super(key: key); @override Widget build(BuildContext context) {