From dfc6e864424a56678ed999bb731a72bb915571b5 Mon Sep 17 00:00:00 2001 From: devamirsaleemahmad Date: Mon, 23 Oct 2023 15:44:24 +0300 Subject: [PATCH] models updates -> 3.13.6 --- .../Dialog/confirm_cancel_order_dialog.dart | 6 +- .../NewHomeHealthCare/location_page.dart | 51 ++++---- .../new_Home_health_care_step_one_page.dart | 30 ++--- .../new_Home_health_care_step_three_page.dart | 28 ++--- .../new_Home_health_care_step_tow_page.dart | 35 +++--- .../new_home_health_care_page.dart | 26 ++-- .../HomeHealthCare/StepsWidget.dart | 20 ++-- .../HomeHealthCare/home_health_care_page.dart | 2 +- .../orders_log_details_page.dart | 20 ++-- .../all_habib_medical_service_page.dart | 4 +- lib/pages/BookAppointment/Search.dart | 8 +- lib/pages/BookAppointment/SearchResults.dart | 4 +- lib/pages/DrawerPages/family/my-family.dart | 4 +- lib/pages/feedback/appointment_history.dart | 112 +++++++++--------- lib/pages/feedback/feedback-detail.dart | 2 +- lib/pages/feedback/feedback_home_page.dart | 8 +- lib/pages/feedback/send_feedback_page.dart | 36 +++--- lib/pages/feedback/status_feedback_page.dart | 12 +- .../AttachInsuranceCardImageDialog.dart | 8 +- .../insurance/UpdateInsuranceManually.dart | 18 +-- .../insurance_approval_detail_screen.dart | 14 +-- .../insurance/insurance_approval_screen.dart | 20 ++-- .../insurance/insurance_card_screen.dart | 16 +-- .../insurance_card_update_details.dart | 16 +-- lib/pages/insurance/insurance_details.dart | 2 +- lib/pages/insurance/insurance_page.dart | 40 +++---- .../insurance/insurance_update_screen.dart | 12 +- .../fragments/home_page_fragment2.dart | 20 ++-- lib/pages/landing/home_page.dart | 76 ++++++------ lib/pages/landing/home_page_2.dart | 12 +- lib/pages/landing/landing_page.dart | 37 +++--- lib/pages/landing/landing_page_pharmcy.dart | 8 +- .../landing/widgets/logged_slider_view.dart | 2 +- lib/pages/landing/widgets/offer_view.dart | 2 +- lib/pages/landing/widgets/pharmacy_view.dart | 9 +- lib/pages/landing/widgets/services_view.dart | 8 +- lib/pages/landing/widgets/slider_view.dart | 5 +- .../schedule_clinic_card.dart | 10 +- lib/uitl/utils_new.dart | 2 +- 39 files changed, 378 insertions(+), 367 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart index 3db199b2..a0de3275 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart @@ -7,9 +7,9 @@ import 'package:flutter/material.dart'; // ignore: must_be_immutable class ConfirmCancelOrderDialog extends StatefulWidget { final HomeHealthCareViewModel model; - final Function onTap; + final Function? onTap; - ConfirmCancelOrderDialog({Key key, this.model, this.onTap}); + ConfirmCancelOrderDialog({Key? key, required this.model, this.onTap}); @override _ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState(); @@ -77,7 +77,7 @@ class _ConfirmCancelOrderDialogState extends State { flex: 1, child: InkWell( onTap: () async { - widget.onTap(); + widget.onTap!(); Navigator.pop(context); }, child: Padding( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index 78e13982..3930afca 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -28,12 +28,12 @@ import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; class LocationPage extends StatefulWidget { - final Function(PickResult) onPick; + final Function(PickResult)? onPick; // final double latitude; // final double longitude; final dynamic model; - const LocationPage({Key key, this.onPick, this.model}) : super(key: key); + const LocationPage({Key? key, this.onPick, this.model}) : super(key: key); @override _LocationPageState createState() => _LocationPageState(); @@ -44,22 +44,22 @@ class _LocationPageState extends State { double longitude = 0; bool showCurrentLocation = false; - GoogleMapController mapController; + GoogleMapController? mapController; bool isHuawei = false; - AppMap appMap; + late AppMap appMap; AppSharedPreferences sharedPref = AppSharedPreferences(); static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), zoom: 14.4746, ); - LatLng currentPostion; + late LatLng currentPostion; // Completer mapController = Completer(); - Placemark selectedPlace; - HmsApiAvailability hmsApiAvailability; - ProjectViewModel projectViewModel; + late Placemark selectedPlace; + late HmsApiAvailability hmsApiAvailability; + late ProjectViewModel projectViewModel; @override void initState() { @@ -73,9 +73,10 @@ class _LocationPageState extends State { latitude = projectViewModel.latitude; longitude = projectViewModel.longitude; appMap = AppMap( - _kGooglePlex.toMap(), + //Changed By Aamir + _kGooglePlex.toMap() as Map, onCameraMove: (camera) { - _updatePosition(camera); + _updatePosition(camera as CameraPosition); }, onMapCreated: () { currentPostion = LatLng(projectViewModel.latitude, projectViewModel.longitude); @@ -138,13 +139,13 @@ class _LocationPageState extends State { createdOnUtc: "", id: "0", faxNumber: "", - phoneNumber: projectViewModel.user.mobileNumber, + phoneNumber: projectViewModel.user!.mobileNumber, province: selectedPlace.administrativeArea, countryId: 69, latLong: latitude.toStringAsFixed(6) + "," + longitude.toStringAsFixed(6), country: selectedPlace.country, zipPostalCode: selectedPlace.postalCode, - email: projectViewModel.user.emailAddress) + email: projectViewModel.user!.emailAddress) ]), ); await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); @@ -189,28 +190,28 @@ class _LocationPageState extends State { AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( customer: Customer(addresses: [ Addresses( - address1: selectedPlace.formattedAddress, - address2: selectedPlace.formattedAddress, + address1: selectedPlace!.formattedAddress, + address2: selectedPlace!.formattedAddress, customerAttributes: "", createdOnUtc: "", id: "0", faxNumber: "", - phoneNumber: projectViewModel.user.mobileNumber, + phoneNumber: projectViewModel.user!.mobileNumber, countryId: 69, - latLong: selectedPlace.geometry.location.lat.toString() + "," + selectedPlace.geometry.location.lng.toString(), - email: projectViewModel.user.emailAddress) + latLong: selectedPlace.geometry!.location.lat.toString() + "," + selectedPlace.geometry!.location.lng.toString(), + email: projectViewModel.user!.emailAddress) ]), ); - selectedPlace.addressComponents.forEach((e) { + selectedPlace.addressComponents!.forEach((e) { if (e.types.contains("country")) { - addNewAddressRequestModel.customer.addresses[0].country = e.longName; + addNewAddressRequestModel.customer!.addresses![0].country = e.longName; } if (e.types.contains("postal_code")) { - addNewAddressRequestModel.customer.addresses[0].zipPostalCode = e.longName; + addNewAddressRequestModel.customer!.addresses![0].zipPostalCode = e.longName; } if (e.types.contains("locality")) { - addNewAddressRequestModel.customer.addresses[0].city = e.longName; + addNewAddressRequestModel.customer!.addresses![0].city = e.longName; } }); @@ -252,8 +253,8 @@ class _LocationPageState extends State { } else { if (await PermissionService.isLocationEnabled()) { Geolocator.getLastKnownPosition().then((value) { - latitude = value.latitude; - longitude = value.longitude; + latitude = value!.latitude; + longitude = value!.longitude; currentPostion = LatLng(latitude, longitude); setMap(); }); @@ -261,7 +262,7 @@ class _LocationPageState extends State { if (Platform.isAndroid) { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { Geolocator.getLastKnownPosition().then((value) { - latitude = value.latitude; + latitude = value!.latitude; longitude = value.longitude; currentPostion = LatLng(latitude, longitude); setMap(); @@ -269,7 +270,7 @@ class _LocationPageState extends State { }); } else { Geolocator.getLastKnownPosition().then((value) { - latitude = value.latitude; + latitude = value!.latitude; longitude = value.longitude; setMap(); }); diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 3a59b21e..0971756a 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -17,17 +17,17 @@ import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel; - final Function changePageViewIndex; + final Function? changePageViewIndex; final HomeHealthCareViewModel model; - const NewHomeHealthCareStepOnePage({Key key, this.patientERInsertPresOrderRequestModel, this.model, this.changePageViewIndex}) : super(key: key); + const NewHomeHealthCareStepOnePage({Key? key, required this.patientERInsertPresOrderRequestModel, required this.model, this.changePageViewIndex}) : super(key: key); @override _NewHomeHealthCareStepOnePageState createState() => _NewHomeHealthCareStepOnePageState(); } class _NewHomeHealthCareStepOnePageState extends State { - PickResult _result; + late PickResult _result; @override void initState() { @@ -57,25 +57,25 @@ class _NewHomeHealthCareStepOnePageState extends State patientERHHCInsertServicesList = - widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID); + widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.where((element) => serviceId == element.serviceID); if (patientERHHCInsertServicesList.length > 0) { return true; } @@ -131,11 +131,11 @@ class _NewHomeHealthCareStepOnePageState extends State patientERHHCInsertServicesList = - widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.where((element) => serviceId == element.serviceID); + widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.where((element) => serviceId == element.serviceID); if (patientERHHCInsertServicesList.length > 0) setState(() { - widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList.first); + widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList!.remove(patientERHHCInsertServicesList.first); }); } } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart index d580f2bb..0c1abc3f 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -21,11 +21,11 @@ import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepThreePage extends StatefulWidget { - final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel; - final Function changePageViewIndex; + final PatientERInsertPresOrderRequestModel? patientERInsertPresOrderRequestModel; + final Function? changePageViewIndex; final HomeHealthCareViewModel model; - NewHomeHealthCareStepThreePage({Key key, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, this.model}); + NewHomeHealthCareStepThreePage({Key? key, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, required this.model}); @override _NewHomeHealthCareStepThreePageState createState() => _NewHomeHealthCareStepThreePageState(); @@ -42,17 +42,17 @@ class _NewHomeHealthCareStepThreePageState extends State Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -165,7 +165,7 @@ class _NewHomeHealthCareStepThreePageState extends State _NewHomeHealthCareStepTowPageState(); @@ -43,25 +43,26 @@ class NewHomeHealthCareStepTowPage extends StatefulWidget { class _NewHomeHealthCareStepTowPageState extends State { double latitude = 0; double longitude = 0; - AddressInfo _selectedAddress; + late AddressInfo _selectedAddress; bool showCurrentLocation = false; final Set markers = new Set(); - AppMap appMap; + late AppMap appMap; AppSharedPreferences sharedPref = AppSharedPreferences(); static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), zoom: 14.4746, ); - LatLng currentPostion; + late LatLng currentPostion; Completer mapController = Completer(); - LocationUtils locationUtils; + late LocationUtils locationUtils; @override void initState() { appMap = AppMap( - _kGooglePlex.toMap(), + //Changed by Aamir + _kGooglePlex.toMap() as Map, onCameraMove: (camera) { - _updatePosition(camera); + _updatePosition(camera as CameraPosition); }, onMapCreated: () { _getUserLocation(); @@ -116,7 +117,7 @@ class _NewHomeHealthCareStepTowPageState extends State with TickerProviderStateMixin { - PageController _controller; + late PageController _controller; int _currentIndex = 1; - double _latitude; - double _longitude; + late double _latitude; + late double _longitude; PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel(); @@ -45,7 +45,7 @@ class _NewHomeHealthCarePageState extends State with Tick _getCurrentLocation() async { if (await PermissionService.isLocationEnabled()) { Geolocator.getLastKnownPosition().then((value) { - _latitude = value.latitude; + _latitude = value!.latitude; _longitude = value.longitude; }).catchError((e) { _longitude = 0; @@ -55,7 +55,7 @@ class _NewHomeHealthCarePageState extends State with Tick if (Platform.isAndroid) { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { Geolocator.getLastKnownPosition().then((value) { - _latitude = value.latitude; + _latitude = value!.latitude; _longitude = value.longitude; }).catchError((e) { _longitude = 0; @@ -64,7 +64,7 @@ class _NewHomeHealthCarePageState extends State with Tick }); } else { Geolocator.getLastKnownPosition().then((value) { - _latitude = value.latitude; + _latitude = value!.latitude; _longitude = value.longitude; }).catchError((e) { _longitude = 0; @@ -169,12 +169,12 @@ class _NewHomeHealthCarePageState extends State with Tick crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget.model.pendingOrder.statusText, + widget.model.pendingOrder!.statusText!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 6), Text( - '${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD.toString()}', + '${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder!.iD.toString()}', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), Row( @@ -186,7 +186,7 @@ class _NewHomeHealthCarePageState extends State with Tick ), Expanded( child: Text( - widget.model.pendingOrder.nearestProjectName.toString(), + widget.model.pendingOrder!.nearestProjectName.toString(), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), @@ -200,14 +200,14 @@ class _NewHomeHealthCarePageState extends State with Tick crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created)), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder!.created!)!), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), - if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2) + if (widget.model.pendingOrder!.statusId == 1 || widget.model.pendingOrder!.statusId == 2) InkWell( onTap: () { - showConfirmMessage(widget.model, widget.model.pendingOrder); + showConfirmMessage(widget.model, widget.model.pendingOrder!); }, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart index dc34d312..29403efd 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart @@ -4,10 +4,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class StepsWidget extends StatelessWidget { - final int index; - final Function changeCurrentTab; + final int? index; + final Function? changeCurrentTab; - StepsWidget({Key key, this.index, this.changeCurrentTab}); + StepsWidget({Key? key, this.index, this.changeCurrentTab}); @override Widget build(BuildContext context) { @@ -20,15 +20,15 @@ class StepsWidget extends StatelessWidget { child: Row( children: [ InkWell( - onTap: () => changeCurrentTab(0), + onTap: () => changeCurrentTab!(0), child: Container( width: 35, height: 35, decoration: containerColorRadiusBorder( index == 0 ? CustomColors.accentColor - : index > 0 - ? Colors.green[700] + : index! > 0 + ? Colors.green[700]! : Colors.white, 2000, Colors.black), @@ -45,15 +45,15 @@ class StepsWidget extends StatelessWidget { ), Expanded(child: mDivider(Colors.grey)), InkWell( - onTap: () => index >= 2 ? changeCurrentTab(1) : null, + onTap: () => index! >= 2 ? changeCurrentTab!(1) : null, child: Container( width: 35, height: 35, decoration: containerColorRadiusBorder( index == 1 ? CustomColors.accentColor - : index > 1 - ? Colors.green[700] + : index! > 1 + ? Colors.green[700]! : Colors.white, 2000, Colors.black), @@ -70,7 +70,7 @@ class StepsWidget extends StatelessWidget { ), Expanded(child: mDivider(Colors.grey)), InkWell( - onTap: () => index == 2 ? changeCurrentTab(3) : null, + onTap: () => index == 2 ? changeCurrentTab!(3) : null, child: Container( width: 35, height: 35, diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart index 1a4a9f4f..7308154f 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -20,7 +20,7 @@ class HomeHealthCarePage extends StatefulWidget { } class _HomeHealthCarePageState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; @override void initState() { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 8c684b01..71c40181 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -17,9 +17,9 @@ import 'package:provider/provider.dart'; import 'Dialog/confirm_cancel_order_dialog.dart'; class OrdersLogDetailsPage extends StatelessWidget { - final HomeHealthCareViewModel model; + final HomeHealthCareViewModel? model; - const OrdersLogDetailsPage({Key key, this.model}) : super(key: key); + const OrdersLogDetailsPage({Key? key, this.model}) : super(key: key); @override Widget build(BuildContext context) { @@ -50,16 +50,16 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - body: model.hhcAllPresOrders.length > 0 + body: model!.hhcAllPresOrders.length > 0 ? ListView.separated( padding: EdgeInsets.all(21), physics: BouncingScrollPhysics(), itemBuilder: (context, index) { - GetCMCAllOrdersResponseModel order = model.hhcAllPresOrders.reversed.toList()[index]; + GetCMCAllOrdersResponseModel order = model!.hhcAllPresOrders.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); @@ -142,14 +142,14 @@ class OrdersLogDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ 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.4, height: 16 / 10), ), SizedBox(height: 12), if (order.statusId == 1 || order.statusId == 2) InkWell( onTap: () { - showConfirmMessage(model, order); + showConfirmMessage(model!, order); }, child: Container( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), @@ -172,7 +172,7 @@ class OrdersLogDetailsPage extends StatelessWidget { ); }, separatorBuilder: (context, index) => SizedBox(height: 12), - itemCount: model.hhcAllPresOrders.length) + itemCount: model!.hhcAllPresOrders.length) : getNoDataWidget(context), ); } diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 6ed4a47b..719b7851 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -48,9 +48,9 @@ import 'h2o/h2o_page.dart'; class AllHabibMedicalService extends StatefulWidget { //TODO - final Function goToMyProfile; + final Function? goToMyProfile; - AllHabibMedicalService({Key? key, required this.goToMyProfile}); + AllHabibMedicalService({Key? key, this.goToMyProfile}); @override _AllHabibMedicalServiceState createState() => _AllHabibMedicalServiceState(); diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index c0f842b7..225f434d 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -15,7 +15,7 @@ import 'components/SearchByClinic.dart'; class Search extends StatefulWidget { final int type; final List? clnicIds; - VoidCallbackAction? onBackClick; + Function()? onBackClick; Search({this.type = 0, this.clnicIds, this.onBackClick}); @@ -45,7 +45,7 @@ class _SearchState extends State with TickerProviderStateMixin { showNewAppBar: true, appBarTitle: TranslationBase.of(context).bookAppo, backgroundColor: Color(0xFFF7F7F7), - onTap: widget.onBackClick, + onTap: widget.onBackClick!(), body: Column( children: [ TabBar( @@ -68,8 +68,8 @@ class _SearchState extends State with TickerProviderStateMixin { letterSpacing: -0.48, ), tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)], - onTap: (idx){ - if(idx == 0) + onTap: (idx) { + if (idx == 0) projectViewModel.analytics.appointment.book_appointment_by_clinic(); else projectViewModel.analytics.appointment.book_appointment_by_doctor(); diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 987c5dde..c280b08c 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -16,9 +16,9 @@ class SearchResults extends StatefulWidget { bool isLiveCareAppointment; bool isObGyneAppointment; bool isDoctorNameSearch; - OBGyneProcedureListResponse obGyneProcedureListResponse; + OBGyneProcedureListResponse? obGyneProcedureListResponse; - SearchResults({required this.doctorsList, required this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, required this.isLiveCareAppointment, required this.obGyneProcedureListResponse}); + SearchResults({required this.doctorsList, required this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, required this.isLiveCareAppointment, this.obGyneProcedureListResponse}); @override _SearchResultsState createState() => _SearchResultsState(); diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index cac3b745..a7dcf313 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; - VoidCallbackAction? onBackClick; + Function()? onBackClick; MyFamily({this.isAppbarVisible = true, this.onBackClick}); @@ -91,7 +91,7 @@ class _MyFamily extends State with TickerProviderStateMixin { imagesInfo: imagesInfo, showNewAppBar: true, showNewAppBarTitle: true, - onTap: widget.isAppbarVisible == false ? widget.onBackClick : null, + onTap: widget.isAppbarVisible == false ? widget.onBackClick!() : null, icon: "assets/images/new/bottom_nav/family_files.svg", description: TranslationBase.of(context).familyInfo, body: Column( diff --git a/lib/pages/feedback/appointment_history.dart b/lib/pages/feedback/appointment_history.dart index 92a26eb1..69bd54e8 100644 --- a/lib/pages/feedback/appointment_history.dart +++ b/lib/pages/feedback/appointment_history.dart @@ -1,71 +1,71 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class AppointmentHistory { - String setupID; - int projectID; - int appointmentNo; - DateTime appointmentDate; + String? setupID; + int? projectID; + int? appointmentNo; + DateTime? appointmentDate; dynamic appointmentDateN; - int appointmentType; - String bookDate; - int patientType; - int patientID; - int clinicID; - int doctorID; - String endDate; - String startTime; - String endTime; - int status; - int visitType; - int visitFor; - int patientStatusType; - int companyID; - int bookedBy; - String bookedOn; - int confirmedBy; - String confirmedOn; - int arrivalChangedBy; - DateTime arrivedOn; + int? appointmentType; + String? bookDate; + int? patientType; + int? patientID; + int? clinicID; + int? doctorID; + String? endDate; + String? startTime; + String? endTime; + int? status; + int? visitType; + int? visitFor; + int? patientStatusType; + int? companyID; + int? bookedBy; + String ?bookedOn; + int? confirmedBy; + String? confirmedOn; + int? arrivalChangedBy; + DateTime? arrivedOn; dynamic editedBy; dynamic editedOn; dynamic doctorName; dynamic doctorNameN; - String statusDesc; + String? statusDesc; dynamic statusDescN; - bool vitalStatus; + bool? vitalStatus; dynamic vitalSignAppointmentNo; - int episodeID; - int actualDoctorRate; - String clinicName; - bool complainExists; - String doctorImageURL; - String doctorNameObj; - int doctorRate; - List doctorSpeciality; - String doctorTitle; - int gender; - String genderDescription; - bool iSAllowOnlineCheckedIN; - bool isActiveDoctor; - bool isActiveDoctorProfile; - bool isDoctorAllowVedioCall; - bool isExecludeDoctor; - int isFollowup; - bool isLiveCareAppointment; - bool isMedicalReportRequested; - bool isOnlineCheckedIN; - String latitude; + int? episodeID; + int? actualDoctorRate; + String? clinicName; + bool? complainExists; + String? doctorImageURL; + String? doctorNameObj; + int? doctorRate; + List? doctorSpeciality; + String? doctorTitle; + int? gender; + String? genderDescription; + bool? iSAllowOnlineCheckedIN; + bool? isActiveDoctor; + bool? isActiveDoctorProfile; + bool? isDoctorAllowVedioCall; + bool? isExecludeDoctor; + int? isFollowup; + bool? isLiveCareAppointment; + bool? isMedicalReportRequested; + bool? isOnlineCheckedIN; + String? latitude; dynamic listHISGetContactLensPerscription; dynamic listHISGetGlassPerscription; - String longitude; - int nextAction; - int noOfPatientsRate; - int originalClinicID; - int originalProjectID; - String projectName; - String qR; - int remaniningHoursTocanPay; - bool sMSButtonVisable; + String? longitude; + int? nextAction; + int? noOfPatientsRate; + int? originalClinicID; + int? originalProjectID; + String? projectName; + String? qR; + int? remaniningHoursTocanPay; + bool? sMSButtonVisable; AppointmentHistory( {this.setupID, diff --git a/lib/pages/feedback/feedback-detail.dart b/lib/pages/feedback/feedback-detail.dart index 62ab1aa7..e303ed39 100644 --- a/lib/pages/feedback/feedback-detail.dart +++ b/lib/pages/feedback/feedback-detail.dart @@ -8,7 +8,7 @@ class FeedbackDetails extends StatelessWidget { final COCItem items; FeedbackDetails({ - @required this.items, + required this.items, }); @override diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 72f09bed..0f5558df 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -12,16 +12,16 @@ import 'package:flutter/material.dart'; import 'status_feedback_page.dart'; class FeedbackHomePage extends StatefulWidget { - final AppoitmentAllHistoryResultList appointment; + final AppoitmentAllHistoryResultList? appointment; final MessageType messageType; - const FeedbackHomePage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); + const FeedbackHomePage({Key? key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); @override _FeedbackHomePageState createState() => _FeedbackHomePageState(); } class _FeedbackHomePageState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; @override void initState() { @@ -72,7 +72,7 @@ class _FeedbackHomePageState extends State with SingleTickerPr controller: _tabController, children: [ SendFeedbackPage( - appointment: widget.appointment, + appointment: widget.appointment!, messageType: widget.messageType, ), StatusFeedbackPage() diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 06e9560b..a5e9506f 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -29,10 +29,10 @@ import 'package:provider/provider.dart'; // import 'package:speech_to_text/speech_to_text.dart' as stt; class SendFeedbackPage extends StatefulWidget { - final AppoitmentAllHistoryResultList appointment; + final AppoitmentAllHistoryResultList? appointment; final MessageType messageType; - const SendFeedbackPage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); + const SendFeedbackPage({Key? key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); @override _SendFeedbackPageState createState() => _SendFeedbackPageState(); @@ -42,10 +42,10 @@ class _SendFeedbackPageState extends State { TextEditingController titleController = TextEditingController(); TextEditingController messageController = TextEditingController(); List images = []; - String title; - AppoitmentAllHistoryResultList appointHistory; + late String title; + late AppoitmentAllHistoryResultList appointHistory; bool isShowListAppointHistory = true; - String message; + late String message; final formKey = GlobalKey(); MessageType messageType = MessageType.NON; var _currentLocaleId; @@ -83,7 +83,7 @@ class _SendFeedbackPageState extends State { setMessageType(MessageType messageType) { setState(() { this.messageType = messageType; - this.appointHistory = widget.appointment; + this.appointHistory = widget.appointment!; }); } @@ -91,7 +91,7 @@ class _SendFeedbackPageState extends State { void initState() { setState(() { this.messageType = widget.messageType; - this.appointHistory = widget.appointment; + this.appointHistory = widget.appointment!; }); // requestPermissions(); event.controller.stream.listen((p) { @@ -176,14 +176,14 @@ class _SendFeedbackPageState extends State { child: DoctorCard( onTap: null, isInOutPatient: appointHistory.isInOutPatient, - name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, + name: appointHistory.doctorTitle! + " " + appointHistory.doctorNameObj!, // billNo: _appointmentResult.invoiceNo, profileUrl: appointHistory.doctorImageURL, subName: appointHistory.projectName, isLiveCareAppointment: appointHistory.isLiveCareAppointment, - date: DateUtil.convertStringToDate(appointHistory.appointmentDate), - rating: appointHistory.actualDoctorRate + 0.0, - appointmentTime: appointHistory.startTime.substring(0, 5), + date: DateUtil.convertStringToDate(appointHistory.appointmentDate!), + rating: appointHistory.actualDoctorRate! + 0.0, + appointmentTime: appointHistory.startTime!.substring(0, 5), ), ), SizedBox(height: 12), @@ -204,13 +204,13 @@ class _SendFeedbackPageState extends State { child: DoctorCard( onTap: null, isInOutPatient: appoList[index].isInOutPatient, - name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj, + name: appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!, profileUrl: appoList[index].doctorImageURL, subName: appoList[index].projectName, isLiveCareAppointment: appoList[index].isLiveCareAppointment, - date: DateUtil.convertStringToDate(appoList[index].appointmentDate), - rating: appoList[index].actualDoctorRate + 0.0, - appointmentTime: appoList[index].startTime.substring(0, 5), + date: DateUtil.convertStringToDate(appoList[index].appointmentDate!), + rating: appoList[index].actualDoctorRate! + 0.0, + appointmentTime: appoList[index].startTime!.substring(0, 5), ), ), ), @@ -313,7 +313,7 @@ class _SendFeedbackPageState extends State { ? null : () { final form = formKey.currentState; - if (form.validate()) { + if (form!.validate()) { GifLoaderDialogUtils.showMyDialog(context); model .sendCOCItem( @@ -351,7 +351,7 @@ class _SendFeedbackPageState extends State { ); } - Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines}) { + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), alignment: Alignment.center, @@ -494,7 +494,7 @@ class _SendFeedbackPageState extends State { appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); }); setState(() { - appointHistory = null; + appointHistory = AppoitmentAllHistoryResultList(); isShowListAppointHistory = true; }); } else {} diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 419cf1b0..28c8fb52 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -29,7 +29,7 @@ class _StatusFeedbackPageState extends State { TextEditingController complainNumberController = TextEditingController(); StatusType statusType = StatusType.ComplaintNumber; int selectedStatusIndex = 3; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -243,22 +243,22 @@ class _StatusFeedbackPageState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(isArabic ? cOCItemList[index].statusAr : cOCItemList[index].status, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), + Text(isArabic ? cOCItemList[index].statusAr! : cOCItemList[index].status!, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), Container( margin: EdgeInsets.only(top: 5.0), child: Text(cOCItemList[index].formType.toString(), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12))), MyRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic), - Text(cOCItemList[index].cOCTitle, + Text(cOCItemList[index].cOCTitle!, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)), ], ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text(cOCItemList[index].date.split(" ")[0], + Text(cOCItemList[index].date!.split(" ")[0], style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)), - Text(cOCItemList[index].date.split(" ")[1].substring(0, 4), + Text(cOCItemList[index].date!.split(" ")[1].substring(0, 4), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)), ], ), @@ -272,7 +272,7 @@ class _StatusFeedbackPageState 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/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 03e61116..c00b44ef 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -17,7 +17,7 @@ class AttachInsuranceCardImageDialog extends StatefulWidget { final String mobileNo; final Function(File file, String image) image; - const AttachInsuranceCardImageDialog({Key key, this.name, this.fileNo, this.identificationNo, this.mobileNo, this.image}) : super(key: key); + const AttachInsuranceCardImageDialog({Key? key, required this.name, required this.fileNo, required this.identificationNo, required this.mobileNo, required this.image}) : super(key: key); @override _AttachInsuranceCardImageDialogState createState() => _AttachInsuranceCardImageDialogState(); @@ -29,8 +29,8 @@ class _AttachInsuranceCardImageDialogState extends State createState() => _UpdateInsuranceManuallyState(); @@ -31,7 +31,7 @@ class _UpdateInsuranceManuallyState extends State { TextEditingController _cardHolderNameTextController = TextEditingController(); TextEditingController _membershipNoTextController = TextEditingController(); TextEditingController _policyNoTextController = TextEditingController(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; InsuranceCardService _insuranceCardService = locator(); @@ -41,8 +41,8 @@ class _UpdateInsuranceManuallyState extends State { int _selectedInsuranceCompanyIndex = -1; int _selectedInsuranceCompanySchemeIndex = -1; - InsuranceCompaniesGetModel selectedInsuranceCompanyObj; - InsuranceCompaniesSchemeModel selectedInsuranceCompaniesSchemesObj; + late InsuranceCompaniesGetModel selectedInsuranceCompanyObj; + late InsuranceCompaniesSchemeModel selectedInsuranceCompaniesSchemesObj; @override void initState() { @@ -92,7 +92,7 @@ class _UpdateInsuranceManuallyState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - selectedInsuranceCompanyObj != null ? selectedInsuranceCompanyObj.companyName : TranslationBase.of(context).insuranceCompany, + selectedInsuranceCompanyObj != null ? selectedInsuranceCompanyObj.companyName! : TranslationBase.of(context).insuranceCompany, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -142,7 +142,7 @@ class _UpdateInsuranceManuallyState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - selectedInsuranceCompaniesSchemesObj != null ? selectedInsuranceCompaniesSchemesObj.subCategoryDesc : TranslationBase.of(context).insuranceClassName, + selectedInsuranceCompaniesSchemesObj != null ? selectedInsuranceCompaniesSchemesObj.subCategoryDesc! : TranslationBase.of(context).insuranceClassName, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -189,7 +189,7 @@ class _UpdateInsuranceManuallyState extends State { void confirmSelectInsuranceCompanyDialog() { List list = [ - for (int i = 0; i < insuranceCompaniesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesList[i].companyName, i), + for (int i = 0; i < insuranceCompaniesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesList[i].companyName!, i), ]; showDialog( context: context, @@ -210,7 +210,7 @@ class _UpdateInsuranceManuallyState extends State { void confirmSelectInsuranceCompanySchemeDialog() { List list = [ - for (int i = 0; i < insuranceCompaniesSchemesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesSchemesList[i].subCategoryDesc, i), + for (int i = 0; i < insuranceCompaniesSchemesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesSchemesList[i].subCategoryDesc!, i), ]; showDialog( context: context, @@ -267,7 +267,7 @@ class _UpdateInsuranceManuallyState extends State { void getInsuranceScheme() { GifLoaderDialogUtils.showMyDialog(context); - _insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID, selectedInsuranceCompanyObj.companyID).then((value) { + _insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID!, selectedInsuranceCompanyObj.companyID!).then((value) { value.forEach((result) { insuranceCompaniesSchemesList.add(InsuranceCompaniesSchemeModel.fromJson(result)); }); diff --git a/lib/pages/insurance/insurance_approval_detail_screen.dart b/lib/pages/insurance/insurance_approval_detail_screen.dart index c5f84602..b17da0cf 100644 --- a/lib/pages/insurance/insurance_approval_detail_screen.dart +++ b/lib/pages/insurance/insurance_approval_detail_screen.dart @@ -13,7 +13,7 @@ import 'package:provider/provider.dart'; class InsuranceApprovalDetail extends StatelessWidget { final InsuranceApprovalModel insuranceApprovalModel; - InsuranceApprovalDetail({Key key, this.insuranceApprovalModel}) : super(key: key); + InsuranceApprovalDetail({Key? key, required this.insuranceApprovalModel}) : super(key: key); @override Widget build(BuildContext context) { @@ -45,11 +45,11 @@ class InsuranceApprovalDetail extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - insuranceApprovalModel.approvalStatusDescption, + insuranceApprovalModel.approvalStatusDescption!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: insuranceApprovalModel.status == 9 ? Color(0xff359846) : Color(0xffD02127), letterSpacing: -0.4, height: 18 / 10), ), Text( - insuranceApprovalModel.doctorName, + insuranceApprovalModel.doctorName!, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -62,8 +62,8 @@ class InsuranceApprovalDetail extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ LargeAvatar( - name: insuranceApprovalModel.doctorName, - url: insuranceApprovalModel.doctorImageURL, + name: insuranceApprovalModel.doctorName!, + url: insuranceApprovalModel.doctorImageURL!, width: 48, height: 48, ), @@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget { MyRichText(TranslationBase.of(context).unusedCount, insuranceApprovalModel?.unUsedCount.toString() ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic), SizedBox(height: 6), - MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.receiptOn)) ?? "", + MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.receiptOn!)) ?? "", projectViewModel.isArabic), - MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.expiryDate)) ?? "", + MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.expiryDate!)) ?? "", projectViewModel.isArabic), ], ), diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index f0391ea7..9e555d9d 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -19,7 +19,7 @@ import 'insurance_approval_detail_screen.dart'; class InsuranceApproval extends StatefulWidget { int appointmentNo; - InsuranceApproval({this.appointmentNo}); + InsuranceApproval({required this.appointmentNo}); @override _InsuranceApprovalState createState() => _InsuranceApprovalState(); @@ -37,7 +37,7 @@ class _InsuranceApprovalState extends State { .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); return BaseView( onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(), - builder: (BuildContext _context, InsuranceViewModel model, Widget child) => AppScaffold( + builder: (BuildContext _context, InsuranceViewModel model, Widget? child) => AppScaffold( isShowAppBar: true, showNewAppBar: true, baseViewModel: model, @@ -54,10 +54,10 @@ class _InsuranceApprovalState extends State { Color _patientStatusColor; String _patientStatusString; - if (model.insuranceApproval[index].isLiveCareAppointment) { + if (model.insuranceApproval[index].isLiveCareAppointment!) { _patientStatusColor = Color(0xff2E303A); _patientStatusString = TranslationBase.of(context).liveCare.capitalizeFirstofEach; - } else if (!model.insuranceApproval[index].isInOutPatient) { + } else if (!model.insuranceApproval[index].isInOutPatient!) { _patientStatusColor = Color(0xffD02127); _patientStatusString = TranslationBase.of(context).inPatient.capitalizeFirstofEach; } else { @@ -108,7 +108,7 @@ class _InsuranceApprovalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - model.insuranceApproval[index].approvalStatusDescption, + model.insuranceApproval[index].approvalStatusDescption!, style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, @@ -117,7 +117,7 @@ class _InsuranceApprovalState extends State { height: 18 / 10), ), Text( - model.insuranceApproval[index].doctorName, + model.insuranceApproval[index].doctorName!, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -129,8 +129,8 @@ class _InsuranceApprovalState extends State { Row( children: [ LargeAvatar( - name: model.insuranceApproval[index].doctorName, - url: model.insuranceApproval[index].doctorImageURL, + name: model.insuranceApproval[index].doctorName!, + url: model.insuranceApproval[index].doctorImageURL!, width: 48, height: 48, ), @@ -140,9 +140,9 @@ class _InsuranceApprovalState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, children: [ - MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName != null ? model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach : "", + MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index].clinicName != null ? model.insuranceApproval[index].clinicName!.toLowerCase().capitalizeFirstofEach : "", projectViewModel.isArabic), - MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic), + MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index].approvalNo.toString() ?? "", projectViewModel.isArabic), ], ), ), diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 15862f66..2a96b2d4 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -21,7 +21,7 @@ import '../base/base_view.dart'; class InsuranceCard extends StatefulWidget { int appointmentNo; - InsuranceCard({this.appointmentNo}); + InsuranceCard({required this.appointmentNo}); @override _InsuranceCardState createState() => _InsuranceCardState(); @@ -38,7 +38,7 @@ class _InsuranceCardState extends State { return BaseView( onModelReady: (model) => model.getInsurance(), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( isShowAppBar: true, baseViewModel: model, showHomeAppBarIcon: false, @@ -76,12 +76,12 @@ class _InsuranceCardState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - model.insurance[index].groupName, + model.insurance[index].groupName!, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.64), ), mHeight(8), Text( - TranslationBase.of(context).companyName + model.insurance[index].companyName, + TranslationBase.of(context).companyName + model.insurance[index].companyName!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.48), ), Divider( @@ -99,7 +99,7 @@ class _InsuranceCardState extends State { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), Text( - model.insurance[index].subCategoryDesc, + model.insurance[index].subCategoryDesc!, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), ], @@ -112,7 +112,7 @@ class _InsuranceCardState extends State { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.insurance[index].cardValidTo)), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.insurance[index].cardValidTo!)), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), ], @@ -147,7 +147,7 @@ class _InsuranceCardState extends State { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), Text( - model.insurance[index].patientCardID, + model.insurance[index].patientCardID!, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), ], @@ -160,7 +160,7 @@ class _InsuranceCardState extends State { style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ), Text( - model.insurance[index].insurancePolicyNumber, + model.insurance[index].insurancePolicyNumber!, style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xFF575757)), ) ], diff --git a/lib/pages/insurance/insurance_card_update_details.dart b/lib/pages/insurance/insurance_card_update_details.dart index 2f0cc5a5..fc0e1a78 100644 --- a/lib/pages/insurance/insurance_card_update_details.dart +++ b/lib/pages/insurance/insurance_card_update_details.dart @@ -24,7 +24,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { final String name; final String mobileNo; - const InsuranceCardUpdateDetails({Key key, this.insuranceCardDetailsModel, this.patientIdentificationID, this.patientID, this.name, this.mobileNo}) : super(key: key); + const InsuranceCardUpdateDetails({Key? key, required this.insuranceCardDetailsModel, required this.patientIdentificationID, required this.patientID, required this.name, required this.mobileNo}) : super(key: key); @override Widget build(BuildContext context) { @@ -61,7 +61,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - insuranceCardDetailsModel[index].memberID, + insuranceCardDetailsModel[index].memberID!, style: TextStyle( color: Colors.white, letterSpacing: -0.48, @@ -73,7 +73,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { height: 2, ), Text( - insuranceCardDetailsModel[index].companyName, + insuranceCardDetailsModel[index].companyName!, style: TextStyle( color: Colors.white, letterSpacing: -0.48, @@ -100,7 +100,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { ), ), Text( - insuranceCardDetailsModel[index].memberName, + insuranceCardDetailsModel[index].memberName!, style: TextStyle( color: Colors.white, letterSpacing: -0.48, @@ -123,7 +123,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { ), ), Text( - insuranceCardDetailsModel[index].policyNumber, + insuranceCardDetailsModel[index].policyNumber!, style: TextStyle( color: Colors.white, letterSpacing: -0.48, @@ -154,7 +154,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { ), ), Text( - insuranceCardDetailsModel[index].effectiveTo, + insuranceCardDetailsModel[index].effectiveTo!, style: TextStyle( color: Colors.white, letterSpacing: -0.48, @@ -177,7 +177,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { ), ), Text( - insuranceCardDetailsModel[index].subCategory, + insuranceCardDetailsModel[index].subCategory!, style: TextStyle( color: Colors.white, letterSpacing: -0.48, @@ -349,7 +349,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget { ); } - void confirmAttachInsuranceCardImageDialogDialog({BuildContext context, String name, String fileNo, String identificationNo, String mobileNo, InsuranceViewModel model}) { + void confirmAttachInsuranceCardImageDialogDialog({required BuildContext context, required String name, required String fileNo, required String identificationNo, required String mobileNo, required InsuranceViewModel model}) { showDialog( context: context, builder: (cxt) => AttachInsuranceCardImageDialog( diff --git a/lib/pages/insurance/insurance_details.dart b/lib/pages/insurance/insurance_details.dart index 807987c8..9f456f63 100644 --- a/lib/pages/insurance/insurance_details.dart +++ b/lib/pages/insurance/insurance_details.dart @@ -8,7 +8,7 @@ import 'package:flutter_html/flutter_html.dart'; class InsuranceCardDetails extends StatelessWidget { final String data; - InsuranceCardDetails({this.data}); + InsuranceCardDetails({required this.data}); @override Widget build(BuildContext context) { diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index 5d19789a..24b4d956 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -18,9 +18,9 @@ class InsurancePage extends StatelessWidget { final InsuranceViewModel model; InsuranceCardService _insuranceCardService = locator(); - InsurancePage({Key key, this.model}) : super(key: key); + InsurancePage({Key? key, required this.model}) : super(key: key); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -41,15 +41,15 @@ class InsurancePage extends StatelessWidget { getDetails( setupID: '010266', projectID: 15, - patientIdentificationID: projectViewModel.user.patientIdentificationNo, + patientIdentificationID: projectViewModel.user!.patientIdentificationNo!, //model.user.patientIdentificationNo, - patientID: projectViewModel.user.patientID, + patientID: projectViewModel.user!.patientID!, //model.user.patientID, parentID: 0, isFamily: projectViewModel.isLoginChild, //false, - name: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, - mobileNumber: projectViewModel.user.mobileNumber, + name: projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, + mobileNumber: projectViewModel.user!.mobileNumber!, //model.user.firstName + " " + model.user.lastName, context: context, ); @@ -64,7 +64,7 @@ class InsurancePage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -72,7 +72,7 @@ class InsurancePage extends StatelessWidget { ), ), Text( - TranslationBase.of(context).fileno + ": " + projectViewModel.user.patientID.toString(), //model.user.patientID.toString(), + TranslationBase.of(context).fileno + ": " + projectViewModel.user!.patientID.toString(), //model.user.patientID.toString(), style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, @@ -95,18 +95,18 @@ class InsurancePage extends StatelessWidget { physics: NeverScrollableScrollPhysics(), shrinkWrap: true, itemBuilder: (context, index) { - return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 + return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].status == 3 ? InkWell( onTap: () { getDetails( projectID: 15, - patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientIdenficationNumber, + patientIdentificationID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].patientIdenficationNumber!, setupID: '010266', - patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID, - name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, - parentID: model.user.patientID, + patientID: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].responseID!, + name: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].patientName!, + parentID: model.user!.patientID!, isFamily: true, - mobileNumber: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].mobileNumber, + mobileNumber: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].mobileNumber!, context: context); }, child: Container( @@ -125,11 +125,11 @@ class InsurancePage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].patientName, + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].patientName!, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.46), ), Text( - TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].responseID.toString(), + TranslationBase.of(context).fileno + ": " + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].responseID.toString(), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46), ), ], @@ -145,9 +145,9 @@ class InsurancePage extends StatelessWidget { : Container(); }, separatorBuilder: (context, index) { - return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3 ? 8 : 0); + return mHeight(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList![index].status == 3 ? 8 : 0); }, - itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, + itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!.length, ), ], ), @@ -155,7 +155,7 @@ class InsurancePage extends StatelessWidget { ); } - getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, String mobileNumber, bool isFamily, int parentID = 0, BuildContext context}) { + getDetails({required String setupID, required int projectID, required String patientIdentificationID, required int patientID, required String name, required String mobileNumber, required bool isFamily, int parentID = 0, required BuildContext context}) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService .getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID) @@ -176,7 +176,7 @@ class InsurancePage extends StatelessWidget { }); } else { // AppToast.showErrorToast(message: _insuranceCardService.error); - updateManually(context, _insuranceCardService.error, patientIdentificationID, patientID, mobileNumber); + updateManually(context, _insuranceCardService.error!, patientIdentificationID, patientID, mobileNumber); } }); } diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index bb8a67b4..be5112fd 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -17,9 +17,9 @@ class InsuranceUpdate extends StatefulWidget { } class _InsuranceUpdateState extends State with SingleTickerProviderStateMixin { - TabController _tabController; + late TabController _tabController; List imagesInfo =[]; - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override void initState() { @@ -39,7 +39,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), - builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, InsuranceViewModel model, Widget? child) => AppScaffold( appBarTitle: TranslationBase.of(context).updateInsurCards, description: TranslationBase.of(context).infoInsurCards, infoList: TranslationBase.of(context).infoPrescriptionsPoints, @@ -127,7 +127,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -146,7 +146,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv ), ), Text( - model.insuranceUpdate[index].createdOn, + model.insuranceUpdate[index].createdOn!, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -167,7 +167,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv Container( margin: EdgeInsets.only(top: 6.5, left: 2.0), child: Text( - model.insuranceUpdate[index].statusDescription, + model.insuranceUpdate[index].statusDescription!, style: TextStyle( fontSize: 10, fontWeight: FontWeight.w600, diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 207310b4..e5e1a24f 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -25,7 +25,7 @@ import 'package:provider/provider.dart'; class HomePageFragment2 extends StatefulWidget { DashboardViewModel model; - Function onPharmacyClick, onLoginClick, onMedicalFileClick; + Function? onPharmacyClick, onLoginClick, onMedicalFileClick; HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick, this.onMedicalFileClick}); @@ -34,10 +34,10 @@ class HomePageFragment2 extends StatefulWidget { } class _HomePageFragment2State extends State { - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; List hmgServices = []; List appoList = []; - ApplePayResponse applePayResponse; + late ApplePayResponse applePayResponse; @override void initState() { @@ -80,12 +80,12 @@ class _HomePageFragment2State extends State { padding: const EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: InkWell( onTap: () { - widget.onMedicalFileClick(); + widget.onMedicalFileClick!(); }, child: LoggedSliderView( projectViewModel, new SliderData(TranslationBase.of(context).fileno + ": " + (projectViewModel.user?.patientID?.toString() ?? ""), - projectViewModel.user.firstName + ' ' + (projectViewModel.user?.lastName ?? ""), "", bannerColor[0].darkColor, bannerColor[0].lightColor), + projectViewModel.user!.firstName! + ' ' + (projectViewModel.user?.lastName ?? ""), "", bannerColor[0].darkColor, bannerColor[0].lightColor), widget.model, ), ), @@ -97,7 +97,7 @@ class _HomePageFragment2State extends State { margin: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: SliderView( onLoginClick: () { - widget.onLoginClick(); + widget.onLoginClick!(); projectViewModel.analytics.loginRegistration.login_register_initiate(); }, ), @@ -133,7 +133,7 @@ class _HomePageFragment2State extends State { ), TextButton( onPressed: () { - widget.onMedicalFileClick(); + widget.onMedicalFileClick!(); // navigateTo(context, MedicalProfilePageNew()); }, child: Text( @@ -349,7 +349,7 @@ class _HomePageFragment2State extends State { Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4), + padding: EdgeInsets.all(SizeConfig.widthMultiplier! * 3.4), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, @@ -417,7 +417,7 @@ class _HomePageFragment2State extends State { flex: 1, child: InkWell( onTap: () { - if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick(); + if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick!(); }, child: Stack(children: [ Container( @@ -477,7 +477,7 @@ class _HomePageFragment2State extends State { Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4), + padding: EdgeInsets.all(SizeConfig.widthMultiplier! * 3.4), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 17b24a64..cf31f6f4 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -31,7 +31,7 @@ import 'landing_page_pharmcy.dart'; class HomePage extends StatefulWidget { final Function goToMyProfile; - HomePage({Key key, this.goToMyProfile}); + HomePage({Key? key, required this.goToMyProfile}); @override _HomePageState createState() => _HomePageState(); @@ -86,7 +86,7 @@ class _HomePageState extends State { ), color: Colors.white.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(5))), - child: (model.user != null && model.user.outSA == 1) + child: (model.user != null && model.user!.outSA == 1) ? Container( width: double.infinity, height: double.infinity, @@ -133,7 +133,7 @@ class _HomePageState extends State { elevation: 0, disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38), disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12), - onPressed: (model.user != null && model.user.outSA == 1) + onPressed: (model.user != null && model.user!.outSA == 1) ? () {} : () { navigateToCovidDriveThru(); @@ -268,11 +268,11 @@ class _HomePageState extends State { SizedBox( height: 8, ), - model.user.cRSVerificationStatus == 2 + model.user!.cRSVerificationStatus == 2 ? Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, + model.user!.firstName! + " " + model.user!.lastName!, color: Colors.grey[100], bold: true, fontSize: 15, @@ -283,11 +283,11 @@ class _HomePageState extends State { ), ], ) - : model.user.cRSVerificationStatus == 3 + : model.user!.cRSVerificationStatus == 3 ? Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, + model.user!.firstName! + " " + model.user!.lastName!, color: Colors.grey[100], bold: true, fontSize: 15, @@ -301,7 +301,7 @@ class _HomePageState extends State { : Row( children: [ Texts( - model.user.firstName + " " + model.user.lastName, + model.user!.firstName! + " " + model.user!.lastName!, color: Colors.grey[100], bold: true, fontSize: 15, @@ -309,7 +309,7 @@ class _HomePageState extends State { ], ), Texts( - '${model.user.patientID}', + '${model.user!.patientID!}', color: Colors.white, fontSize: 14, ), @@ -317,7 +317,7 @@ class _HomePageState extends State { height: 5, ), Texts( - '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user.age.toString() + "y"}', + '${DateUtil.getMonthDayYearDateFormatted(model.user!.dateofBirthDataTime!)} ,${model.user!.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${model.user!.age.toString() + "y"}', color: Colors.grey[100], fontWeight: FontWeight.normal, fontSize: 14, @@ -414,7 +414,7 @@ class _HomePageState extends State { padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15), child: InkWell( onTap: () { - Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(projectViewModel.user))); + Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(projectViewModel.user!))); }, child: Container( decoration: BoxDecoration( @@ -447,7 +447,7 @@ class _HomePageState extends State { children: [ if (projectViewModel.havePrivilege(64)) DashboardItem( - onTap: (model.user != null && model.user.outSA == 1) + onTap: (model.user != null && model.user!.outSA == 1) ? () {} : () { Navigator.push( @@ -459,8 +459,8 @@ class _HomePageState extends State { }, child: Center( child: Padding( - padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), - child: (model.user != null && model.user.outSA == 1) + padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), + child: (model.user != null && model.user!.outSA == 1) ? Container( width: double.infinity, height: double.infinity, @@ -485,7 +485,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + fontSize: SizeConfig.textMultiplier! * 1.55, ) ], )), @@ -496,11 +496,11 @@ class _HomePageState extends State { ), if (projectViewModel.havePrivilege(65)) DashboardItem( - onTap: () => (model.user != null && model.user.outSA == 1) ? () {} : getPharmacyToken(model), + onTap: () => (model.user != null && model.user!.outSA == 1) ? () {} : getPharmacyToken(model), child: Center( child: Padding( - padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), - child: (model.user != null && model.user.outSA == 1) + padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), + child: (model.user != null && model.user!.outSA == 1) ? Container( width: double.infinity, height: double.infinity, @@ -531,7 +531,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + fontSize: SizeConfig.textMultiplier! * 1.55, ) ], ), @@ -542,7 +542,7 @@ class _HomePageState extends State { ), if (projectViewModel.havePrivilege(67)) DashboardItem( - onTap: (model.user != null && model.user.outSA == 1) + onTap: (model.user != null && model.user!.outSA == 1) ? () {} : () { Navigator.push( @@ -554,8 +554,8 @@ class _HomePageState extends State { }, child: Center( child: Padding( - padding: (model.user != null && model.user.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), - child: (model.user != null && model.user.outSA == 1) + padding: (model.user != null && model.user!.outSA == 1) ? const EdgeInsets.all(0.0) : const EdgeInsets.all(15.0), + child: (model.user != null && model.user!.outSA == 1) ? Container( width: double.infinity, height: double.infinity, @@ -580,7 +580,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + fontSize: SizeConfig.textMultiplier! * 1.55, ) ], )), @@ -621,7 +621,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: SizeConfig.textMultiplier! * 1.7, ) ], ), @@ -657,7 +657,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: SizeConfig.textMultiplier! * 1.7, ) ], ), @@ -698,7 +698,7 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: SizeConfig.textMultiplier! * 1.7, ) ], ), @@ -755,7 +755,7 @@ class _HomePageState extends State { height: 100, imageName: 'contact_us_bg.png', opacity: 0.5, - color: Colors.grey[700], + color: Colors.grey[700]!, width: MediaQuery.of(context).size.width * 0.45, onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())), ), @@ -796,7 +796,7 @@ class _HomePageState extends State { height: 100, imageName: 'contact_us_bg.png', opacity: 0.5, - color: Colors.grey[700], + color: Colors.grey[700]!, width: MediaQuery.of(context).size.width * 0.45, ), ], @@ -833,22 +833,22 @@ class _HomePageState extends State { } class DashboardItem extends StatelessWidget { - const DashboardItem({this.hasBorder = false, this.imageName, @required this.child, this.onTap, Key key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true}) + const DashboardItem({this.hasBorder = false, this.imageName, this.child, this.onTap, Key? key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true}) : super(key: key); final bool hasBorder; - final String imageName; - final Widget child; - final Function onTap; - final double width; - final double height; - final Color color; - final double opacity; + final String? imageName; + final Widget? child; + final Function? onTap; + final double? width; + final double? height; + final Color? color; + final double? opacity; final bool hasColorFilter; @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, + onTap: onTap!(), child: Container( width: width != null ? width : MediaQuery.of(context).size.width * 0.29, height: height != null @@ -860,7 +860,7 @@ class DashboardItem extends StatelessWidget { color: !hasBorder ? color != null ? color - : Color(0xFF050705).withOpacity(opacity) + : Color(0xFF050705).withOpacity(opacity!) : Colors.white, borderRadius: BorderRadius.circular(6.0), border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart index 7374d273..ae8183aa 100644 --- a/lib/pages/landing/home_page_2.dart +++ b/lib/pages/landing/home_page_2.dart @@ -16,10 +16,10 @@ import 'fragments/home_page_fragment2.dart'; import 'landing_page_pharmcy.dart'; class HomePage2 extends StatefulWidget { - final Function goToMyProfile; - Function onLoginClick, onMedicalFileClick; + final Function? goToMyProfile; + Function? onLoginClick, onMedicalFileClick; - HomePage2({Key key, this.goToMyProfile, this.onLoginClick, this.onMedicalFileClick}); + HomePage2({Key? key, this.goToMyProfile, this.onLoginClick, this.onMedicalFileClick}); @override _HomePageState2 createState() => _HomePageState2(); @@ -27,7 +27,7 @@ class HomePage2 extends StatefulWidget { class _HomePageState2 extends State { PharmacyModuleViewModel pharmacyModuleViewModel = locator(); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -45,13 +45,13 @@ class _HomePageState2 extends State { HomePageFragment2( model, onLoginClick: () { - widget.onLoginClick(); + widget.onLoginClick!(); }, onPharmacyClick: () { getPharmacyToken(model); }, onMedicalFileClick: () { - widget.onMedicalFileClick(); + widget.onMedicalFileClick!(); }, ) ], diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0c044e6b..a6cd128f 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -50,8 +50,8 @@ import '../../locator.dart'; import '../../routes.dart'; class LandingPage extends StatefulWidget { - static LandingPage shared; - _LandingPageState state; + static late LandingPage shared; + late _LandingPageState state; LandingPage() { LandingPage.shared = this; @@ -73,16 +73,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); int currentTab = 0; - PageController pageController; - ProjectViewModel projectViewModel; - ToDoCountProviderModel model; + late PageController pageController; + late ProjectViewModel projectViewModel; + late ToDoCountProviderModel model; var notificationCount = ''; var themeNotifier; - DateTime currentBackPressTime; + DateTime? currentBackPressTime; // SignalRUtil signalRUtil; - ToDoCountProviderModel toDoProvider; + late ToDoCountProviderModel toDoProvider; bool _showBottomNavigationBar = true; @@ -99,7 +99,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { final voIPKit = FlutterIOSVoIPKit.instance; var dummyCallId = '123456'; var dummyCallerName = 'Dummy Tester'; - Timer timeOutTimer; + late Timer timeOutTimer; bool isTalking = false; var sharedPref = new AppSharedPreferences(); @@ -151,7 +151,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } bool isPageNavigated = false; - LocationUtils locationUtils; + late LocationUtils locationUtils; Future onWillPop() { if (currentTab != 0) { @@ -159,7 +159,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { return Future.value(false); } else { DateTime now = DateTime.now(); - if (currentBackPressTime == null || now.difference(currentBackPressTime) > Duration(seconds: 2)) { + if (currentBackPressTime == null || now.difference(currentBackPressTime!) > Duration(seconds: 2)) { currentBackPressTime = now; AppToast.showToast(message: TranslationBase.of(context).pressAgain); return Future.value(false); @@ -302,13 +302,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { // for now commented to reduce this call will enable it when needed // HMGNetworkConnectivity(context).start(); - _firebaseMessaging.getToken().then((String token) { - print("Firebase Token: " + token); + _firebaseMessaging.getToken().then((String? token) { + print("Firebase Token: " + token!); sharedPref.setString(PUSH_TOKEN, token); if (Platform.isIOS) { voIPKit.getVoIPToken().then((value) { print('🎈 example: getVoIPToken: $value'); - AppSharedPreferences().setString(APNS_TOKEN, value); + AppSharedPreferences().setString(APNS_TOKEN, value!); getOneSignalVOIPToken(value); }); } @@ -470,13 +470,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { elevation: 0, backgroundColor: CustomColors.backgroudGreyColor, textTheme: TextTheme( - headline6: TextStyle(color: Theme.of(context).textTheme.headline1.color, fontWeight: FontWeight.bold), + headline6: TextStyle(color: Theme.of(context).textTheme.headline1!.color, fontWeight: FontWeight.bold), ), title: Text( getText(currentTab).toUpperCase(), style: TextStyle( fontWeight: FontWeight.bold, - color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1.color, + color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1!.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // bold: true, ), @@ -487,7 +487,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { currentTab == 0 ? IconButton( icon: SvgPicture.asset("assets/images/new/menu.svg"), - color: Theme.of(context).textTheme.headline1.color, + color: Theme.of(context).textTheme.headline1!.color, onPressed: () => Scaffold.of(context).openDrawer(), ) : IconButton( @@ -647,14 +647,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); - FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); + FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); } }), }); } projectViewModel.analytics.setUser(data); } else { - projectViewModel.analytics.setUser(null); + //changed by Aamir + projectViewModel.analytics.setUser(AuthenticatedUser()); } if (Platform.isIOS) { String voipToken = await sharedPref.getString(APNS_TOKEN); diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index 4ba5758e..3e3637b7 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -26,15 +26,15 @@ import '../../locator.dart'; class LandingPagePharmacy extends StatefulWidget { final int currentTab; - const LandingPagePharmacy({Key key, this.currentTab = 0}) : super(key: key); + const LandingPagePharmacy({Key? key, this.currentTab = 0}) : super(key: key); @override _LandingPagePharmacyState createState() => _LandingPagePharmacyState(); } class _LandingPagePharmacyState extends State { - ProjectViewModel projectProvider; + late ProjectViewModel projectProvider; int currentTab = 0; - PageController pageController; + late PageController pageController; void initState() { super.initState(); @@ -88,7 +88,7 @@ class _LandingPagePharmacyState extends State { try { ScanResult result = await BarcodeScanner.scan(); try { - String barcode = result?.rawContent; + String barcode = result.rawContent; GifLoaderDialogUtils.showMyDialog(context); await BaseAppClient() .getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart index a74e2231..1c4a39be 100644 --- a/lib/pages/landing/widgets/logged_slider_view.dart +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -122,7 +122,7 @@ class LoggedSliderView extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 20, right: 20), child: Text( - '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user.dateofBirthDataTime)} ,${projectViewModel.user.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}', + '${DateUtil.getMonthDayYearDateFormatted(projectViewModel.user!.dateofBirthDataTime!)} ,${projectViewModel.user!.gender == 1 ? TranslationBase.of(context).male : TranslationBase.of(context).female} ${projectViewModel.user!.age.toString() + " " + TranslationBase.of(context).patientAge.toString()}', style: TextStyle( color: Colors.white, fontSize: 12, diff --git a/lib/pages/landing/widgets/offer_view.dart b/lib/pages/landing/widgets/offer_view.dart index c8269bc6..82afbc4a 100644 --- a/lib/pages/landing/widgets/offer_view.dart +++ b/lib/pages/landing/widgets/offer_view.dart @@ -7,7 +7,7 @@ class OfferView extends StatelessWidget { return Container( width: double.infinity, height: MediaQuery.of(context).size.width / 5, - decoration: containerColorRadiusBorderWidth(Colors.grey[200], 20, Colors.grey[300], 2), + decoration: containerColorRadiusBorderWidth(Colors.grey[200]!, 20, Colors.grey[300]!, 2), child: Row( children: [ Expanded( diff --git a/lib/pages/landing/widgets/pharmacy_view.dart b/lib/pages/landing/widgets/pharmacy_view.dart index ad33f529..288eb20c 100644 --- a/lib/pages/landing/widgets/pharmacy_view.dart +++ b/lib/pages/landing/widgets/pharmacy_view.dart @@ -1,12 +1,14 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; class PharmacyView extends StatelessWidget { Function onPharmacyClick; - PharmacyView({this.onPharmacyClick}); + PharmacyView({required this.onPharmacyClick}); @override Widget build(BuildContext context) { return InkWell( @@ -55,4 +57,9 @@ class PharmacyView extends StatelessWidget { ), ); } + @override + void debugFillProperties(DiagnosticPropertiesBuilder properties) { + super.debugFillProperties(properties); + properties.add(DiagnosticsProperty('onPharmacyClick', onPharmacyClick)); + } } diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index f1753f3c..10bd5397 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -48,7 +48,7 @@ class ServicesView extends StatelessWidget { AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); PharmacyModuleViewModel pharmacyModuleViewModel = locator(); - LocationUtils locationUtils; + late LocationUtils locationUtils; bool isHomePage; ServicesView(this.hmgServices, this.index, this.isHomePage); @@ -111,7 +111,7 @@ class ServicesView extends StatelessWidget { Container( width: double.infinity, height: double.infinity, - padding: EdgeInsets.only(left: SizeConfig.widthMultiplier * 3, right: SizeConfig.widthMultiplier * 3, top: SizeConfig.widthMultiplier * 3, bottom: SizeConfig.widthMultiplier * 2), + padding: EdgeInsets.only(left: SizeConfig.widthMultiplier! * 3, right: SizeConfig.widthMultiplier! * 3, top: SizeConfig.widthMultiplier! * 3, bottom: SizeConfig.widthMultiplier! * 2), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -137,7 +137,7 @@ class ServicesView extends StatelessWidget { maxLines: 1, minFontSize: 10, style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: SizeConfig.textMultiplier! * 1.6, fontWeight: FontWeight.bold, letterSpacing: -0.39, height: 0.8, @@ -148,7 +148,7 @@ class ServicesView extends StatelessWidget { maxLines: 1, minFontSize: 8, style: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.4, + fontSize: SizeConfig.textMultiplier! * 1.4, letterSpacing: -0.27, fontWeight: FontWeight.w600, ), diff --git a/lib/pages/landing/widgets/slider_view.dart b/lib/pages/landing/widgets/slider_view.dart index d73cb7c5..93058b0e 100644 --- a/lib/pages/landing/widgets/slider_view.dart +++ b/lib/pages/landing/widgets/slider_view.dart @@ -11,9 +11,9 @@ import 'package:provider/provider.dart'; class SliderView extends StatelessWidget { Function onLoginClick; - SliderView({this.onLoginClick}); + SliderView({required this.onLoginClick}); - ProjectViewModel projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -92,6 +92,7 @@ class SliderView extends StatelessWidget { width: MediaQuery.of(context).size.width / (projectViewModel.isArabic ? 4 : 6), child: CustomTextButton( shape: cardRadiusNew(8), + //shape: OutlinedBorder(), backgroundColor: Color(0xFFFBF2E31), elevation: 0, onPressed: () { diff --git a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart index 76b83d2f..1006dc86 100644 --- a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart +++ b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart @@ -5,11 +5,11 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class ScheduleClinicCard extends StatefulWidget { - bool isSelected; + bool? isSelected; final ClinicsHaveScheduleList clinicsHaveScheduleList; var languageID; - ScheduleClinicCard({this.isSelected, this.languageID, @required this.clinicsHaveScheduleList}); + ScheduleClinicCard({this.isSelected, this.languageID, required this.clinicsHaveScheduleList}); @override _ScheduleClinicCardState createState() => _ScheduleClinicCardState(); @@ -27,7 +27,7 @@ class _ScheduleClinicCardState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(width: widget.isSelected ? 3 : 0, color: widget.isSelected ? CustomColors.green : Colors.transparent), + border: Border.all(width: widget.isSelected! ? 3 : 0, color: widget.isSelected! ? CustomColors.green : Colors.transparent), boxShadow: [ BoxShadow( color: Color(0xff000000).withOpacity(.05), @@ -48,11 +48,11 @@ class _ScheduleClinicCardState extends State { margin: EdgeInsets.only( left: projectViewModel.isArabic ? 0 - : widget.isSelected + : widget.isSelected! ? 4 : 6, right: projectViewModel.isArabic - ? widget.isSelected + ? widget.isSelected! ? 4 : 6 : 0), diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index 822137cd..5b814cb3 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -471,7 +471,7 @@ BoxDecoration cardRadius(double radius, {Color color, double elevation}) { ); } -ShapeBorder cardRadiusNew(double radius) { +OutlinedBorder cardRadiusNew(double radius) { return RoundedRectangleBorder( side: BorderSide(color: Colors.transparent, width: 0), borderRadius: BorderRadius.all(Radius.circular(radius)),