diff --git a/lib/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart b/lib/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart index a1e747ac..7db2b736 100644 --- a/lib/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart +++ b/lib/core/model/packages_offers/responses/PackagesCategoriesResponseModel.dart @@ -1,7 +1,7 @@ import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; -class PackagesCategoriesResponseModel with JsonConvert { +class PackagesCategoriesResponseModel extends JsonConvert { int? id; String? name; String? namen; @@ -63,14 +63,14 @@ class PackagesCategoriesResponseModel with JsonConvert { +class OfferCategoriesResponseModelLocalizedName extends JsonConvert { @JSONField(name: "language_id") int? languageId; @JSONField(name: "localized_name") String? localizedName; } -class OfferCategoriesResponseModelImage with JsonConvert { +class OfferCategoriesResponseModelImage extends JsonConvert { String? src; dynamic thumb; dynamic attachment; diff --git a/lib/core/model/packages_offers/responses/PackagesResponseModel.dart b/lib/core/model/packages_offers/responses/PackagesResponseModel.dart index 80169400..90feacfa 100644 --- a/lib/core/model/packages_offers/responses/PackagesResponseModel.dart +++ b/lib/core/model/packages_offers/responses/PackagesResponseModel.dart @@ -1,7 +1,7 @@ import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; -class PackagesResponseModel with JsonConvert { +class PackagesResponseModel extends JsonConvert { int? id; @JSONField(name: "visible_individually") bool? visibleIndividually; @@ -219,14 +219,14 @@ class PackagesResponseModel with JsonConvert { } } -class OfferProductsResponseModelLocalizedName with JsonConvert { +class OfferProductsResponseModelLocalizedName extends JsonConvert { @JSONField(name: "language_id") int? languageId; @JSONField(name: "localized_name") String? localizedName; } -class OfferProductsResponseModelImage with JsonConvert { +class OfferProductsResponseModelImage extends JsonConvert { int? id; int? position; String? src; @@ -234,7 +234,7 @@ class OfferProductsResponseModelImage with JsonConvert { +class OfferProductsResponseModelSpecification extends JsonConvert { int? id; @JSONField(name: "display_order") int? displayOrder; diff --git a/lib/core/service/packages_offers/PackagesOffersServices.dart b/lib/core/service/packages_offers/PackagesOffersServices.dart index 02d19e73..7c797192 100644 --- a/lib/core/service/packages_offers/PackagesOffersServices.dart +++ b/lib/core/service/packages_offers/PackagesOffersServices.dart @@ -74,7 +74,7 @@ class OffersAndPackagesServices extends BaseService { return projectsList; } - Future> getAllProducts({required OffersProductsRequestModel request, required BuildContext context, bool showLoading = true, bool byOffset = true}) async { + Future> getAllProducts({required OffersProductsRequestModel request, BuildContext? context, bool showLoading = true, bool byOffset = true}) async { Future errorThrow; productList = []; var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS; diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 2f861bd3..0b84fb7d 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -26,22 +26,22 @@ import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_svg/flutter_svg.dart'; class QRCode extends StatefulWidget { - PatientShareResponse patientShareResponse; - AppoitmentAllHistoryResultList appointment; - String appoQR; - AuthenticatedUser authUser; + late PatientShareResponse? patientShareResponse; + late AppoitmentAllHistoryResultList? appointment; + late String? appoQR; + AuthenticatedUser? authUser; AppSharedPreferences sharedPref = AppSharedPreferences(); - QRCode({@required this.patientShareResponse, @required this.appoQR, @required this.appointment}); + QRCode({required this.patientShareResponse, required this.appoQR, required this.appointment}); @override _QRCodeState createState() => _QRCodeState(); } class _QRCodeState extends State { - Uint8List _bytes; + late Uint8List _bytes; bool _supportsNFC = false; - BuildContext _context; + late BuildContext _context; @override void initState() { @@ -66,11 +66,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!); }); }); } @@ -89,20 +89,20 @@ 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), + 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, + widget.appointment!.doctorRate, + widget.appointment!.actualDoctorRate, + widget.appointment!.noOfPatientsRate, "", ), isShowName: true, diff --git a/lib/widgets/buttons/GestureIconButton.dart b/lib/widgets/buttons/GestureIconButton.dart index 0f035b71..40f8ceaf 100644 --- a/lib/widgets/buttons/GestureIconButton.dart +++ b/lib/widgets/buttons/GestureIconButton.dart @@ -5,15 +5,15 @@ class GestureIconButton extends StatefulWidget { GestureIconButton( this.label, this.icon, { - Key key, + Key? key, this.onTap, this.backgroundColor, }) : super(key: key); final String label; final Widget icon; - final VoidCallback onTap; - final Color backgroundColor; + final VoidCallback? onTap; + final Color? backgroundColor; @override _GestureIconButtonState createState() => _GestureIconButtonState(); diff --git a/lib/widgets/buttons/mini_button.dart b/lib/widgets/buttons/mini_button.dart index 153c74b1..c9f4479e 100644 --- a/lib/widgets/buttons/mini_button.dart +++ b/lib/widgets/buttons/mini_button.dart @@ -12,15 +12,15 @@ enum MINI_BUTTON { Secondary, Primary } class MiniButton extends StatefulWidget { MiniButton( { - this.label: "", + this.label= "", this.icon, this.onTap, - this.variant: MINI_BUTTON.Secondary}); + this.variant= MINI_BUTTON.Secondary}); - final String label; - final IconData icon; - final VoidCallback onTap; + final String? label; + final IconData? icon; + final VoidCallback? onTap; final MINI_BUTTON variant; @override @@ -29,8 +29,8 @@ class MiniButton extends StatefulWidget { class _MiniButtonState extends State with TickerProviderStateMixin { double _buttonSize = 1.0; - AnimationController _animationController; - Animation _animation; + late AnimationController _animationController; + late Animation _animation; PermissionService permission = new PermissionService(); @override void initState() { @@ -87,7 +87,7 @@ class _MiniButtonState extends State with TickerProviderStateMixin { _animationController.forward(); }, // onTap: Feedback.wrapForTap(widget.onTap, context), - onTap: () =>{ widget.onTap(), }, + onTap: () =>{ widget.onTap!(), }, behavior: HitTestBehavior.opaque, child: Transform.scale( scale: _buttonSize, diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index a5ac63aa..9fce3b90 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -16,14 +16,14 @@ import 'package:provider/provider.dart'; /// [noBorderRadius] remove border radius class SecondaryButton extends StatefulWidget { SecondaryButton( - {Key key, + {Key? key, this.label = "", this.icon, this.iconOnly = false, this.color, this.textColor = Colors.white, this.onTap, - this.loading: false, + this.loading= false, this.small = false, this.disabled = false, this.borderColor, @@ -34,20 +34,20 @@ class SecondaryButton extends StatefulWidget { : super(key: key); final String label; - final Widget icon; - final VoidCallback onTap; - final bool loading; - final Color color; - final Color textColor; - final Color borderColor; + final Widget? icon; + final VoidCallback? onTap; + final bool? loading; + final Color? color; + final Color? textColor; + final Color? borderColor; final bool small; final bool iconOnly; final bool disabled; final bool noBorderRadius; - final double borderRadius; - final Color disableColor; - final FontWeight fontWeight; - final double fontSize; + final double? borderRadius; + final Color? disableColor; + final FontWeight? fontWeight; + final double? fontSize; @override @@ -57,12 +57,12 @@ class SecondaryButton extends StatefulWidget { class _SecondaryButtonState extends State with TickerProviderStateMixin { double _buttonSize = 1.0; - AnimationController _animationController; - Animation _animation; + late AnimationController _animationController; + late Animation _animation; PermissionService permission = new PermissionService(); double _rippleSize = 0.0; - AnimationController _rippleController; - Animation _rippleAnimation; + late AnimationController _rippleController; + late Animation _rippleAnimation; @override void initState() { @@ -139,7 +139,7 @@ class _SecondaryButtonState extends State Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return IgnorePointer( - ignoring: widget.loading, + ignoring: widget.loading!, child: GestureDetector( onTapDown: (TapDownDetails tap) { _animationController.reverse(from: 1.0); @@ -151,7 +151,7 @@ class _SecondaryButtonState extends State _animationController.forward(); }, onTap: () => { - widget.disabled ? null : widget.onTap(), + widget.disabled ? null : widget.onTap!(), }, // onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context), behavior: HitTestBehavior.opaque, @@ -161,7 +161,7 @@ class _SecondaryButtonState extends State decoration: BoxDecoration( border: widget.borderColor != null ? Border.all( - color: widget.borderColor.withOpacity(0.1), width: 2.0) + color: widget.borderColor!.withOpacity(0.1), width: 2.0) : null, borderRadius: BorderRadius.all(Radius.circular(100.0)), boxShadow: [ @@ -188,7 +188,7 @@ class _SecondaryButtonState extends State decoration: BoxDecoration( color: widget.disabled ? widget.disableColor ?? Colors.grey - : widget.color ?? Theme.of(context).buttonColor), + : widget.color ?? Theme.of(context).buttonTheme.colorScheme!.background), ), ), Positioned( @@ -203,7 +203,7 @@ class _SecondaryButtonState extends State // shape: BoxShape.circle, color: widget.disabled ? widget.disableColor ?? Colors.grey - : widget.color ?? Theme.of(context).buttonColor, + : widget.color ?? Theme.of(context).buttonTheme.colorScheme!.background, ), ), ), @@ -226,7 +226,7 @@ class _SecondaryButtonState extends State mainAxisAlignment: MainAxisAlignment.center, mainAxisSize: MainAxisSize.max, children: [ - widget.loading + widget.loading! ? Padding( padding: EdgeInsets.all(2.6), child: SizedBox( @@ -236,7 +236,7 @@ class _SecondaryButtonState extends State backgroundColor: Colors.white, valueColor: AlwaysStoppedAnimation( - Colors.grey[300], + Colors.grey[300]!, ), ), ), diff --git a/lib/widgets/card/rounded_container.dart b/lib/widgets/card/rounded_container.dart index b0d0fb8d..3922e3a0 100644 --- a/lib/widgets/card/rounded_container.dart +++ b/lib/widgets/card/rounded_container.dart @@ -6,8 +6,8 @@ import 'package:flutter/material.dart'; // DESCRIPTION : Custom widget for rounded container and custom decoration class RoundedContainer extends StatefulWidget { - final double width; - final double height; + final double? width; + final double? height; final double raduis; final Color backgroundColor; final double margin; @@ -19,11 +19,11 @@ class RoundedContainer extends StatefulWidget { final double bottomRight; final double topRight; final double bottomLeft; - final Widget child; + final Widget? child; final double borderWidth; RoundedContainer( - {@required this.child, + {required this.child, this.width, this.height, this.raduis = 10, diff --git a/lib/widgets/carousel_indicator/carousel_indicator.dart b/lib/widgets/carousel_indicator/carousel_indicator.dart index 88c9ddd3..0300ad27 100644 --- a/lib/widgets/carousel_indicator/carousel_indicator.dart +++ b/lib/widgets/carousel_indicator/carousel_indicator.dart @@ -105,11 +105,11 @@ class _CarouselIndicatorState extends State _animationController.reset(); /// for each new index we want to change value so setting [_tween] to (oldWidget.index,widget.index) so animation tween from old position to new position rather not start from 0.0 again and again. - createAnimation(oldWidget.index.toDouble(), widget.index.toDouble()); + createAnimation(oldWidget.index!.toDouble(), widget.index!.toDouble()); _animationController.forward(); } else { _animationController.reset(); - createAnimation(oldWidget.index.toDouble(), 0.0); + createAnimation(oldWidget.index!.toDouble(), 0.0); _animationController.forward(); } } @@ -155,7 +155,7 @@ abstract class BasePainter extends CustomPainter { double height = widget.height; double distance = width + space; double radius = width / 2; - for (int i = 0, c = widget.count; i < c; ++i) { + for (int i = 0, c = widget.count!; i < c; ++i) { canvas.drawRRect( RRect.fromRectAndRadius( Rect.fromCenter( diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index ceb72f35..1e11d402 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -109,7 +109,7 @@ class LabResultWidget extends StatelessWidget { Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) { print(value); if (value != null && value == true) { - showConfirmMessage(context, projectViewModel.user.emailAddress, "yes"); + showConfirmMessage(context, projectViewModel.user!.emailAddress!, "yes"); } }); } @@ -125,7 +125,7 @@ class LabResultWidget extends StatelessWidget { openPassportUpdatePage(context) // showConfirmMessage(context, projectViewModel.user.emailAddress, "yes") }, - cancelFunction: () => {showConfirmMessage(context, projectViewModel.user.emailAddress, "no")}); + cancelFunction: () => {showConfirmMessage(context, projectViewModel.user!.emailAddress!, "no")}); dialog.showAlertDialog(context); } @@ -144,7 +144,7 @@ class LabResultWidget extends StatelessWidget { bool checkIfCovidLab(List labResultList) { bool isCovidResult = false; labResultList.forEach((order) { - if ((order.testCode.toUpperCase().contains("COVID") || order.testCode.toUpperCase().contains("COV")) && order.isCertificateAllowed.toString().toLowerCase() == "true") { + if ((order.testCode!.toUpperCase().contains("COVID") || order.testCode!.toUpperCase().contains("COV")) && order.isCertificateAllowed.toString().toLowerCase() == "true") { isCovidResult = true; covidLabResult = order; } @@ -185,8 +185,8 @@ class LabResultWidget extends StatelessWidget { padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0), child: Utils.tableColumnValue(labResultList[i].description ?? "", isLast: true, mProjectViewModel: projectViewModel), ), - Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(labResultList[i].resultValue! + " " + labResultList![i].uOM!, isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(labResultList[i]!.referanceRange!, isLast: true, isCapitable: false, mProjectViewModel: projectViewModel), !checkIfCovidLab(patientLabResultList!) ? InkWell( onTap: () { diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart index e27f8554..e52ca036 100644 --- a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -46,8 +46,8 @@ class _VitalSignDetailsWidgetState extends State { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime)), isLast: i == (labOrderResultList.length - 1)), - Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(labOrderResultList![i].verifiedOnDateTime!)), isLast: i == (labOrderResultList.length - 1)), + Utils.tableColumnValue(labOrderResultList[i].resultValue!, isLast: i == (labOrderResultList.length - 1)), ], ), ); diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart index 59bdb3e5..f939e2ae 100644 --- a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -88,7 +88,7 @@ class LineChartCurvedState extends State { rotateAngle: -0, getTitles: (value) { print(value); - DateTime date = DateUtil.convertStringToDate(widget.labResult![value.toInt()].verifiedOnDateTime); + DateTime date = DateUtil.convertStringToDate(widget.labResult![value.toInt()]!.verifiedOnDateTime!); if (widget.labResult!.length < 8) { if (widget.labResult!.length > value.toInt()) { return '${date.day}/ ${date.year}'; @@ -155,7 +155,7 @@ class LineChartCurvedState extends State { double max = 0; widget.labResult!.forEach((element) { try { - double resultValueDouble = double.parse(element.resultValue); + double resultValueDouble = double.parse(element.resultValue!); if (resultValueDouble > max) max = resultValueDouble; } catch (e) { print(e); @@ -168,10 +168,10 @@ class LineChartCurvedState extends State { double getMinY() { double min = 0; try { - min = double.parse(widget.labResult![0].resultValue); + min = double.parse(widget.labResult![0].resultValue!); widget.labResult!.forEach((element) { - double resultValueDouble = double.parse(element.resultValue); + double resultValueDouble = double.parse(element.resultValue!); if (resultValueDouble < min) min = resultValueDouble; }); } catch (e) { @@ -186,7 +186,7 @@ class LineChartCurvedState extends State { List spots =[]; for (int index = 0; index < widget.labResult!.length; index++) { try { - var resultValueDouble = double.parse(widget.labResult![index].resultValue); + var resultValueDouble = double.parse(widget.labResult![index].resultValue!); print("$index:$resultValueDouble"); spots.add(FlSpot(index.toDouble(), resultValueDouble)); } catch (e) { diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index f2a2b867..2177bda5 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -36,7 +36,7 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID)), patientLabOrder: widget.patientLabOrder!), + onModelReady: (model) => model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrder!.projectID!)), patientLabOrder: widget.patientLabOrder!), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Column( @@ -44,19 +44,19 @@ class _LaboratoryResultWidgetState extends State { children: [ DoctorHeader( headerModel: HeaderModel( - widget.patientLabOrder!.doctorName, - widget.patientLabOrder!.doctorID, - widget.patientLabOrder!.doctorImageURL, - widget.patientLabOrder!.speciality, + widget.patientLabOrder!.doctorName!, + widget.patientLabOrder!.doctorID!, + widget.patientLabOrder!.doctorImageURL!, + widget.patientLabOrder!.speciality!, widget.billNo!, - widget.patientLabOrder!.projectName, - widget.patientLabOrder!.orderDate, + widget.patientLabOrder!.projectName!, + widget.patientLabOrder!.orderDate!, "", - widget.patientLabOrder!.nationalityFlagURL, - widget.patientLabOrder!.doctorRate, - widget.patientLabOrder!.actualDoctorRate, - widget.patientLabOrder!.noOfPatientsRate, - projectViewModel.user.emailAddress), + widget.patientLabOrder!.nationalityFlagURL!, + widget.patientLabOrder!.doctorRate!, + widget.patientLabOrder!.actualDoctorRate!, + widget.patientLabOrder!.noOfPatientsRate!, + projectViewModel.user!.emailAddress!), onTap: widget.onTap!, ), SizedBox(height: 10), diff --git a/lib/widgets/data_display/medical/time_line_new_widget.dart b/lib/widgets/data_display/medical/time_line_new_widget.dart index 65ff243b..08e80ddb 100644 --- a/lib/widgets/data_display/medical/time_line_new_widget.dart +++ b/lib/widgets/data_display/medical/time_line_new_widget.dart @@ -45,10 +45,10 @@ class _TimeLineViewState extends State { for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { tempList.add(widget.appoitmentAllHistoryResultList[i]); dateObjs.add(new DateObj( - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate).month, - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate).year, + DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).month, + DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).year, DateUtil.getMonthYearLangDateFormatted( - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate), + DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!), widget.isArabic ? "ar" : "en", ))); } @@ -70,7 +70,7 @@ class _TimeLineViewState extends State { } else { for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { if (DateUtil.getMonthYearLangDateFormatted( - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate), + DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!), widget.isArabic ? "ar" : "en", ) == selectedDateObj.monthYear) { @@ -327,7 +327,7 @@ class TimelineNewWidget extends StatelessWidget { children: [ Text( DateUtil.getDayMonthYearLangDateFormatted( - DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate), + DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate!), projectViewModel.isArabic ? "ar" : "en", ), style: TextStyle( @@ -353,16 +353,16 @@ class TimelineNewWidget extends StatelessWidget { parentIndex: 2, ))); }, - name: appoitmentAllHistoryResul!.doctorNameObj, + name: appoitmentAllHistoryResul!.doctorNameObj!, disableProfileView: false, - url: appoitmentAllHistoryResul!.doctorImageURL, + url: appoitmentAllHistoryResul!.doctorImageURL!, width: 30, height: 30, isAppointmentAvatar: true, ), mHeight(6), Text( - appoitmentAllHistoryResul!.doctorNameObj, + appoitmentAllHistoryResul!.doctorNameObj!, style: TextStyle( color: CustomColors.white, fontSize: 10, @@ -371,7 +371,7 @@ class TimelineNewWidget extends StatelessWidget { ), ), Text( - appoitmentAllHistoryResul!.clinicName, + appoitmentAllHistoryResul!.clinicName!, style: TextStyle( color: CustomColors.grey2, fontSize: 10, diff --git a/lib/widgets/data_display/medical/time_line_widget.dart b/lib/widgets/data_display/medical/time_line_widget.dart index 6027f2a9..e07d62db 100644 --- a/lib/widgets/data_display/medical/time_line_widget.dart +++ b/lib/widgets/data_display/medical/time_line_widget.dart @@ -62,7 +62,7 @@ class TimeLineWidget extends StatelessWidget { ), ); }, - name: appoitmentAllHistoryResul!.doctorImageURL, + name: appoitmentAllHistoryResul!.doctorImageURL!, width: 30, height: 30, ), @@ -87,7 +87,7 @@ class TimeLineWidget extends StatelessWidget { height: 4, ), Texts( - DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate), projectViewModel.isArabic ? "ar" : "en"), + DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate!), projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -110,13 +110,13 @@ class TimeLineWidget extends StatelessWidget { child: Column( children: [ Texts( - appoitmentAllHistoryResul!.clinicName.trim(), + appoitmentAllHistoryResul!.clinicName!.trim(), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, ), Texts( - DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate), projectViewModel.isArabic ? "ar" : "en"), + DateUtil.getMonthDayYearLangDateFormatted(DateUtil.convertStringToDate(appoitmentAllHistoryResul!.appointmentDate!), projectViewModel.isArabic ? "ar" : "en"), color: Colors.white, fontSize: 12.5, fontWeight: FontWeight.normal, @@ -150,8 +150,8 @@ class TimeLineWidget extends StatelessWidget { appo: appoitmentAllHistoryResul!, ))); }, - name: appoitmentAllHistoryResul!.doctorNameObj, - url: appoitmentAllHistoryResul!.doctorImageURL, + name: appoitmentAllHistoryResul!.doctorNameObj!, + url: appoitmentAllHistoryResul!.doctorImageURL!, width: 30, height: 30, ), @@ -159,7 +159,7 @@ class TimeLineWidget extends StatelessWidget { height: 3, ), Texts( - appoitmentAllHistoryResul!.doctorNameObj.trim(), + appoitmentAllHistoryResul!.doctorNameObj!.trim(), color: Colors.white, fontSize: 10.5, fontWeight: FontWeight.normal, diff --git a/lib/widgets/dialogs/select_location_dialog.dart b/lib/widgets/dialogs/select_location_dialog.dart index 4ae3554a..fbe8e8d8 100644 --- a/lib/widgets/dialogs/select_location_dialog.dart +++ b/lib/widgets/dialogs/select_location_dialog.dart @@ -65,7 +65,7 @@ class _SelectLocationDialogState extends State { }, child: ListTile( title: Text( - widget.addresses![index].address1, + widget.addresses![index].address1!, style: TextStyle( fontWeight: FontWeight.w600, letterSpacing: -0.46, diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index e1ccee5a..63b99042 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -142,7 +142,7 @@ class _AppDrawerState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - (user != null && projectProvider!.isLogin) ? user!.firstName + ' ' + user!.lastName : TranslationBase.of(context).cantSeeProfile, + (user != null && projectProvider!.isLogin) ? user!.firstName! + ' ' + user!.lastName! : TranslationBase.of(context).cantSeeProfile, style: TextStyle(color: Color(0xff2E303A), fontWeight: FontWeight.bold, fontSize: 20, letterSpacing: -1.2, height: 35 / 20), ), Text( @@ -248,7 +248,7 @@ class _AppDrawerState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - mainUser!.firstName + ' ' + mainUser!.lastName, + mainUser!.firstName! + ' ' + mainUser!.lastName!, color: Color(0xff2E303A), //Theme.of(context).textTheme.bodyText1.color, fontWeight: FontWeight.w600, fontSize: 12, @@ -276,7 +276,7 @@ class _AppDrawerState extends State { Column( mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, - children: snapshot.data!.getAllSharedRecordsByStatusList.map((result) { + children: snapshot.data!.getAllSharedRecordsByStatusList!.map((result) { return result.status == 3 ? Container( padding: EdgeInsets.only(bottom: 5), @@ -298,7 +298,7 @@ class _AppDrawerState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - result.patientName, + result.patientName!, color: result.responseID == user!.patientID ? Color(0xffC5272D) : Color(0xff2B353E), fontWeight: FontWeight.w600, fontSize: 11, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 67fe894e..105e7657 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -204,7 +204,7 @@ class MyInAppBrowser extends InAppBrowser { tamaraRequestModel.orderDescription = orderDesc; tamaraRequestModel.isInstallment = true; tamaraRequestModel.projectID = num.parse(projId); - tamaraRequestModel.accessCode = authenticatedUser.mobileNumber; + tamaraRequestModel.accessCode = authenticatedUser.mobileNumber!; tamaraRequestModel.appointmentNo = (appoNo != null && appoNo != "") ? appoNo.toString() : "0"; tamaraRequestModel.customerName = patientName; tamaraRequestModel.fileNumber = patientID.toString(); @@ -247,7 +247,7 @@ class MyInAppBrowser extends InAppBrowser { MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); // getPatientData(); generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { - if (order.customValuesXml.contains("ApplePay")) { + if (order.customValuesXml!.contains("ApplePay")) { safariBrowser.open(url: Uri.parse(value)); } else { this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); @@ -336,9 +336,9 @@ class MyInAppBrowser extends InAppBrowser { form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamaralive/Home/Checkout"); form = form.replaceFirst('INSTALLMENTS_VALUE', installments); - form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo); - form = form.replaceFirst('CUSTMOBILE_VALUE', authUser.mobileNumber); - form = form.replaceFirst('CUSTDOB_VALUE', DateUtil.getDayMonthYearDateFormatted(authUser.dateofBirthDataTime)); + form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo!); + form = form.replaceFirst('CUSTMOBILE_VALUE', authUser.mobileNumber!); + form = form.replaceFirst('CUSTDOB_VALUE', DateUtil.getDayMonthYearDateFormatted(authUser.dateofBirthDataTime!)); form = form.replaceFirst('CURRENCY_VALUE', authUser.outSA == 0 ? "SAR" : "AED"); form = form.replaceFirst('COUNTRY_CODE_VALUE', authUser.outSA == 0 ? "966" : "971"); @@ -353,7 +353,7 @@ class MyInAppBrowser extends InAppBrowser { Future generatePharmacyURL( OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, AuthenticatedUser authUser) async { - String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID + order.orderGuid + '&&CustomerId=' + "${order.customerId}"; + String pharmacyURL = PRESCRIPTION_PAYMENT_WITH_ORDERID + order.orderGuid! + '&&CustomerId=' + "${order.customerId}"; return pharmacyURL; } diff --git a/lib/widgets/offers_packages/PackagesCartItemCard.dart b/lib/widgets/offers_packages/PackagesCartItemCard.dart index 014fcd19..97ee68f2 100644 --- a/lib/widgets/offers_packages/PackagesCartItemCard.dart +++ b/lib/widgets/offers_packages/PackagesCartItemCard.dart @@ -42,12 +42,12 @@ class PackagesCartItemCardState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ _itemName(widget.itemModel.product.getName()), - Expanded(child: _itemDescription(widget.itemModel.product.shortDescription)), + Expanded(child: _itemDescription(widget.itemModel.product.shortDescription!)), Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - _itemPrice(widget.itemModel.product.price, context: context), + _itemPrice(widget.itemModel.product.price!, context: context), InkWell( onTap: () async { await widget.viewModel.service.deleteProductFromCart(widget.itemModel.id, context: context, showLoading: false); @@ -87,7 +87,7 @@ class PackagesCartItemCardState extends State { Widget _image(PackagesResponseModel model) => AspectRatio( aspectRatio: 1 / 1, child: ClipRRect( - borderRadius: BorderRadius.circular(15), child: (model.images.isNotEmpty) ? Utils.loadNetworkImage(url: model.images.first.src, fitting: BoxFit.fill) : Container(color: Colors.grey[200])), + borderRadius: BorderRadius.circular(15), child: (model.images!.isNotEmpty) ? Utils.loadNetworkImage(url: model.images!.first.src!, fitting: BoxFit.fill) : Container(color: Colors.grey[200])), ); Widget _itemName(String name) => Text( diff --git a/lib/widgets/offers_packages/PackagesOfferCard.dart b/lib/widgets/offers_packages/PackagesOfferCard.dart index 72f6802f..3e539b1e 100644 --- a/lib/widgets/offers_packages/PackagesOfferCard.dart +++ b/lib/widgets/offers_packages/PackagesOfferCard.dart @@ -24,7 +24,7 @@ class PackagesItemCard extends StatefulWidget { } class PackagesItemCardState extends State { - imageUrl() => widget.itemModel.images.isNotEmpty ? widget.itemModel.images.first.src : "https://wallpaperaccess.com/full/30103.jpg"; + imageUrl() => widget.itemModel.images!.isNotEmpty ? widget.itemModel.images!.first.src : "https://wallpaperaccess.com/full/30103.jpg"; @override Widget build(BuildContext context) { @@ -47,12 +47,12 @@ class PackagesItemCardState extends State { aspectRatio: 144 / 144, child: ClipRRect( borderRadius: BorderRadius.circular(12.0), - child: Image.network(widget.itemModel.images.isNotEmpty ? widget.itemModel.images[0].src : "https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), + child: Image.network(widget.itemModel!.images!.isNotEmpty ? widget.itemModel!.images![0].src! : "https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), ), ), SizedBox(height: 6), Text( - widget.itemModel.name, + widget.itemModel.name!, maxLines: 1, style: TextStyle( fontSize: 14.0, @@ -61,7 +61,7 @@ class PackagesItemCardState extends State { color: Color(0xff2B353E), ), ), - Text(widget.itemModel.shortDescription, + Text(widget.itemModel.shortDescription!, maxLines: 2, style: TextStyle( fontSize: 12.0, @@ -70,7 +70,7 @@ class PackagesItemCardState extends State { color: Color(0xff535353), ), overflow: TextOverflow.ellipsis), - if (widget.itemModel.hasDiscountsApplied) + if (widget.itemModel.hasDiscountsApplied!) Container( margin: const EdgeInsets.only(top: 19.0), child: Text( @@ -85,7 +85,7 @@ class PackagesItemCardState extends State { ), ), Container( - margin: widget.itemModel.hasDiscountsApplied ? const EdgeInsets.only(top: 0.0) : const EdgeInsets.only(top: 19.0), + margin: widget.itemModel.hasDiscountsApplied! ? const EdgeInsets.only(top: 0.0) : const EdgeInsets.only(top: 19.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -146,18 +146,18 @@ class PackagesItemCardState extends State { borderRadius: BorderRadius.circular(15.0), child: Image.network("https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), ), - Container(margin: const EdgeInsets.only(top: 8.0), child: Text(widget.itemModel.name, maxLines: 1, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))), + Container(margin: const EdgeInsets.only(top: 8.0), child: Text(widget.itemModel.name!, maxLines: 1, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))), Container( width: MediaQuery.of(context).size.width * 0.4, child: Text("Special discount for all HMG Employees and their first…", maxLines: 2, style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, letterSpacing: -0.4, color: CustomColors.textColor), overflow: TextOverflow.clip)), - if (widget.itemModel.hasDiscountsApplied) + if (widget.itemModel.hasDiscountsApplied!) Container( margin: const EdgeInsets.only(top: 19.0), child: Text(widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar, style: TextStyle(fontSize: 9.0, fontWeight: FontWeight.w600, letterSpacing: -0.36, decoration: TextDecoration.lineThrough, color: CustomColors.grey2))), Container( - margin: widget.itemModel.hasDiscountsApplied ? const EdgeInsets.only(top: 0.0) : const EdgeInsets.only(top: 19.0), + margin: widget.itemModel.hasDiscountsApplied! ? const EdgeInsets.only(top: 0.0) : const EdgeInsets.only(top: 19.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/widgets/offers_packages/PackagesOrderHistoryItemCard.dart b/lib/widgets/offers_packages/PackagesOrderHistoryItemCard.dart index a12ea9b3..38fa4ce1 100644 --- a/lib/widgets/offers_packages/PackagesOrderHistoryItemCard.dart +++ b/lib/widgets/offers_packages/PackagesOrderHistoryItemCard.dart @@ -40,13 +40,13 @@ class PackagesOrderHistoryItemCardState extends State AspectRatio( aspectRatio: 1 / 1, child: ClipRRect( - borderRadius: BorderRadius.circular(15), child: ((model.images ?? []).isNotEmpty) ? Utils.loadNetworkImage(url: model.images.first.src, fitting: BoxFit.fill) : Container(color: Colors.grey[200])), + borderRadius: BorderRadius.circular(15), child: ((model.images ?? []).isNotEmpty) ? Utils.loadNetworkImage(url: model.images!.first.src!, fitting: BoxFit.fill) : Container(color: Colors.grey[200])), ); Widget _itemName(String name) => Text( diff --git a/lib/widgets/offers_packages/offers_packages.dart b/lib/widgets/offers_packages/offers_packages.dart index e131d177..c55c1e79 100644 --- a/lib/widgets/offers_packages/offers_packages.dart +++ b/lib/widgets/offers_packages/offers_packages.dart @@ -261,7 +261,7 @@ class OfferPackagesItemModel { }); var vm_products = locator(); - vm_products.service.getAllProducts(request: OffersProductsRequestModel(categoryId: 125, limit: 100)).then((value) { + vm_products.service.getAllProducts!( request: OffersProductsRequestModel(categoryId: 125, limit: 100)).then((value) { print(value.toString()); print(value.toString()); }); diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index dff0e1da..08485e4f 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -435,7 +435,7 @@ class _SearchBot extends State { res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { v1['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); + arr.add(new DoctorList.fromJson(v).projectName!); arrDistance.add(new DoctorList.fromJson(v) .projectDistanceInKiloMeters .toString()); @@ -454,7 +454,7 @@ class _SearchBot extends State { res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); + arr.add(new DoctorList.fromJson(v).projectName!); arrDistance.add(new DoctorList.fromJson(v) .projectDistanceInKiloMeters .toString()); diff --git a/lib/widgets/others/entity_checkbox_list.dart b/lib/widgets/others/entity_checkbox_list.dart index 1716c8c3..1e45d3da 100644 --- a/lib/widgets/others/entity_checkbox_list.dart +++ b/lib/widgets/others/entity_checkbox_list.dart @@ -159,7 +159,7 @@ class _ProcedureListWidgetState extends State { if (query.isNotEmpty) { List dummyListData = []; dummySearchList.forEach((item) { - if (item.name.toLowerCase().contains(query.toLowerCase())) { + if (item.name!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 11df1639..bfc41f57 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -763,7 +763,7 @@ class _FloatingSearchButton extends State with TickerProvi res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { v1['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); + arr.add(new DoctorList.fromJson(v).projectName!); arrDistance.add(new DoctorList.fromJson(v).projectDistanceInKiloMeters.toString()); }); }); @@ -779,7 +779,7 @@ class _FloatingSearchButton extends State with TickerProvi res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName); + arr.add(new DoctorList.fromJson(v).projectName!); arrDistance.add(new DoctorList.fromJson(v).projectDistanceInKiloMeters.toString()); }); diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index 0cf853c5..741c9062 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -89,7 +89,7 @@ class _NotAutPageState extends State { builder: (BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset ? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + child: image.isAsset! ? Image.asset(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!) : Image.network(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!)); }, ); }).toList(), @@ -181,7 +181,7 @@ class _NotAutPageState extends State { builder: (BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset ? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + child: image.isAsset! ? Image.asset(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!) : Image.network(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!)); }, ); }).toList(), @@ -292,7 +292,7 @@ class _NotAutPageState extends State { builder: (BuildContext context) { return SizedBox( width: MediaQuery.of(context).size.width * 0.50, - child: image.isAsset ? Image.asset(projectViewModel.isArabic ? image.imageAr : image.imageEn) : Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn)); + child: image.isAsset! ? Image.asset(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!) : Image.network(projectViewModel.isArabic! ? image.imageAr! : image.imageEn!)); }, ); }).toList(), diff --git a/lib/widgets/weather_slider/weather_slider.dart b/lib/widgets/weather_slider/weather_slider.dart index 87bf1c37..a494c031 100644 --- a/lib/widgets/weather_slider/weather_slider.dart +++ b/lib/widgets/weather_slider/weather_slider.dart @@ -23,9 +23,9 @@ class WeatherSlider extends StatelessWidget { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding(padding: EdgeInsets.only(top: 10), child: AppText(data.name)), + Padding(padding: EdgeInsets.only(top: 10), child: AppText(data.name!)), AppText( - data.category, + data.category!, fontSize: 24, ), Padding( @@ -54,7 +54,7 @@ class WeatherSlider extends StatelessWidget { : grey, borderRadius: BorderRadius.circular(10)), height: 15, - width: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)), + width: (MediaQuery.of(context).size.width * (double.parse(data.value!) / 10)), padding: EdgeInsets.all(15), child: SizedBox(), )), @@ -76,7 +76,7 @@ class WeatherSlider extends StatelessWidget { shape: MessageBorder(), )), top: 25, - right: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)), + right: (MediaQuery.of(context).size.width * (double.parse(data.value!) / 10)), ) : Positioned( child: Container( @@ -95,7 +95,7 @@ class WeatherSlider extends StatelessWidget { shape: MessageBorder(), )), top: 25, - left: (MediaQuery.of(context).size.width * (double.parse(data.value) / 10)), + left: (MediaQuery.of(context).size.width * (double.parse(data.value!) / 10)), ) ], ), @@ -106,59 +106,59 @@ class WeatherSlider extends StatelessWidget { ? Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText(data.categoriesNames.category1, + AppText(data.categoriesNames!.category1!, fontSize: 12, - color: data.categoriesNames.category1 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category1! == data.category && data.colorName == 'red' ? Colors.redAccent! - : data.categoriesNames.category1 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category1 == data.category && data.colorName == 'orange' ? Colors.orangeAccent! - : data.categoriesNames.category1 == data.category && data.colorName == 'green' + : data.categoriesNames!.category1 == data.category && data.colorName == 'green' ? Colors.greenAccent! - : data.categoriesNames.category1 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category1 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black!), - AppText(data.categoriesNames.category2, + AppText(data.categoriesNames!.category2!, fontSize: 12, - color: data.categoriesNames.category2 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category2 == data.category && data.colorName == 'red' ? Colors.redAccent! - : data.categoriesNames.category2 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category2 == data.category && data.colorName == 'orange' ? Colors.orangeAccent! - : data.categoriesNames.category2 == data.category && data.colorName == 'green' + : data.categoriesNames!.category2 == data.category && data.colorName == 'green' ? Colors.greenAccent! - : data.categoriesNames.category2 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category2 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), - AppText(data.categoriesNames.category3, + AppText(data.categoriesNames!.category3!, fontSize: 12, - color: data.categoriesNames.category3 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category3 == data.category && data.colorName == 'red' ? Colors.redAccent! - : data.categoriesNames.category3 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category3! == data.category && data.colorName == 'orange' ? Colors.orangeAccent! - : data.categoriesNames.category3 == data.category && data.colorName == 'green' + : data.categoriesNames!.category3 == data.category && data.colorName == 'green' ? Colors.greenAccent! - : data.categoriesNames.category3 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category3 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), - AppText(data.categoriesNames.category4, + AppText(data.categoriesNames!.category4!, fontSize: 12, - color: data.categoriesNames.category4 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category4 == data.category && data.colorName == 'red' ? Colors.redAccent - : data.categoriesNames.category4 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category4 == data.category && data.colorName == 'orange' ? Colors.orangeAccent - : data.categoriesNames.category4 == data.category && data.colorName == 'green' + : data.categoriesNames!.category4 == data.category && data.colorName == 'green' ? Colors.greenAccent - : data.categoriesNames.category4 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category4 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), - AppText(data.categoriesNames.category5, + AppText(data.categoriesNames!.category5!, fontSize: 12, - color: data.categoriesNames.category5 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category5 == data.category && data.colorName == 'red' ? Colors.redAccent - : data.categoriesNames.category5 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category5! == data.category && data.colorName == 'orange' ? Colors.orangeAccent - : data.categoriesNames.category5 == data.category && data.colorName == 'green' + : data.categoriesNames!.category5! == data.category && data.colorName == 'green' ? Colors.greenAccent - : data.categoriesNames.category5 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category5 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), ], @@ -166,59 +166,59 @@ class WeatherSlider extends StatelessWidget { : Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText(data.categoriesNames.category5, + AppText(data.categoriesNames!.category5!, fontSize: 12, - color: data.categoriesNames.category5 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category5 == data.category && data.colorName == 'red' ? Colors.redAccent - : data.categoriesNames.category5 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category5 == data.category && data.colorName == 'orange' ? Colors.orangeAccent - : data.categoriesNames.category5 == data.category && data.colorName == 'green' + : data.categoriesNames!.category5 == data.category && data.colorName == 'green' ? Colors.greenAccent - : data.categoriesNames.category5 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category5 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), - AppText(data.categoriesNames.category4, + AppText(data.categoriesNames!.category4!, fontSize: 12, - color: data.categoriesNames.category4 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category4 == data.category && data.colorName == 'red' ? Colors.redAccent - : data.categoriesNames.category4 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category4 == data.category && data.colorName == 'orange' ? Colors.orangeAccent - : data.categoriesNames.category4 == data.category && data.colorName == 'green' + : data.categoriesNames!.category4 == data.category && data.colorName == 'green' ? Colors.greenAccent - : data.categoriesNames.category4 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category4 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), - AppText(data.categoriesNames.category3, + AppText(data.categoriesNames!.category3!, fontSize: 12, - color: data.categoriesNames.category3 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category3 == data.category && data.colorName == 'red' ? Colors.redAccent - : data.categoriesNames.category3 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category3 == data.category && data.colorName == 'orange' ? Colors.orangeAccent - : data.categoriesNames.category3 == data.category && data.colorName == 'green' + : data.categoriesNames!.category3 == data.category && data.colorName == 'green' ? Colors.greenAccent - : data.categoriesNames.category3 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category3 == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), - AppText(data.categoriesNames.category2, + AppText(data.categoriesNames!.category2!, fontSize: 12, - color: data.categoriesNames.category2 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category2 == data.category && data.colorName == 'red' ? Colors.redAccent - : data.categoriesNames.category2 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category2 == data.category && data.colorName == 'orange' ? Colors.orangeAccent - : data.categoriesNames.category2 == data.category && data.colorName == 'green' + : data.categoriesNames!.category2! == data.category && data.colorName == 'green' ? Colors.greenAccent - : data.categoriesNames.category2 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category2! == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), - AppText(data.categoriesNames.category1, + AppText(data.categoriesNames!.category1!, fontSize: 12, - color: data.categoriesNames.category1 == data.category && data.colorName == 'red' + color: data.categoriesNames!.category1 == data.category && data.colorName == 'red' ? Colors.redAccent - : data.categoriesNames.category1 == data.category && data.colorName == 'orange' + : data.categoriesNames!.category1! == data.category && data.colorName == 'orange' ? Colors.orangeAccent - : data.categoriesNames.category1 == data.category && data.colorName == 'green' + : data.categoriesNames!.category1! == data.category && data.colorName == 'green' ? Colors.greenAccent - : data.categoriesNames.category1 == data.category && data.colorName == 'yellow' + : data.categoriesNames!.category1! == data.category && data.colorName == 'yellow' ? Colors.yellow[900]! : Colors.black), ],