merge-update-with-lab-changes
devamirsaleemahmad 2 years ago
parent 47801ecb36
commit 49d3df8c87

@ -28,7 +28,7 @@ class ReportsMonthlyViewModel extends BaseViewModel {
}
}
updatePatientHealthSummaryReport({required String message, required bool isSummary, bool isUpdateEmail = false, required String email}) async {
updatePatientHealthSummaryReport({required String message, required bool isSummary, bool isUpdateEmail = false, String? email}) async {
setState(ViewState.BusyLocal);
await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary);
if (_reportsService.hasError) {

@ -111,13 +111,13 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderS
Tab(
child: Text(
localize.rapidResponseTeam,
style: TextStyle(color: Theme.of(context).appBarTheme.color),
style: TextStyle(color: Theme.of(context).appBarTheme.backgroundColor),
),
),
Tab(
child: Text(
localize.orderLog,
style: TextStyle(color: Theme.of(context).appBarTheme.color),
style: TextStyle(color: Theme.of(context).appBarTheme.backgroundColor!),
),
),
]),

@ -96,7 +96,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
widget.incomingCallData.doctorname!,
widget.incomingCallData!.doctorname!,
style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white, letterSpacing: -1.26, height: 23 / 12),
),
Text(
@ -128,14 +128,14 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0),
child: Text(
widget.incomingCallData.appointmentdate! + ", " + widget.incomingCallData.appointmenttime!,
widget.incomingCallData!.appointmentdate! + ", " + widget.incomingCallData!.appointmenttime!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
),
),
Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 21.0),
child: Text(
widget.incomingCallData.clinicname!,
widget.incomingCallData!.clinicname!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
),
),
@ -232,8 +232,8 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
// }else{
return OpenTokConnectCallPage(
apiKey: OPENTOK_API_KEY,
sessionId: widget.incomingCallData.sessionId!,
token: widget.incomingCallData.token!
sessionId: widget.incomingCallData!.sessionId!,
token: widget.incomingCallData!.token!
);
// }
@ -254,7 +254,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
void changeCallStatusAPI(int sessionStatus) {
LiveCareService service = new LiveCareService();
service.endCallAPI(widget.incomingCallData.sessionId!, sessionStatus, context).then((res) {
service.endCallAPI(widget.incomingCallData!.sessionId!, sessionStatus, context).then((res) {
}).catchError((err) {
print(err);
});

@ -6,10 +6,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ClassesPage extends StatelessWidget {
final ListHISGetGlassPerscription glassPerscription;
final int appointmentNo;
final String projectName;
final int projectID;
final ListHISGetGlassPerscription? glassPerscription;
final int? appointmentNo;
final String? projectName;
final int? projectID;
const ClassesPage({Key? key, this.glassPerscription, this.appointmentNo, this.projectName, this.projectID}) : super(key: key);
@ -38,11 +38,11 @@ class ClassesPage extends StatelessWidget {
),
),
),
getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-',isLast:true),
getRow(TranslationBase.of(context).sphere, '${glassPerscription?.rightEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder, '${glassPerscription?.rightEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription?.rightEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism, '${glassPerscription?.rightEyePrism}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription?.rightEyeVA}', '-',isLast:true),
],
),
),
@ -66,11 +66,11 @@ class ClassesPage extends StatelessWidget {
),
),
),
getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-',isLast:true),
getRow(TranslationBase.of(context).sphere, '${glassPerscription?.leftEyeSpherical}', '-'),
getRow(TranslationBase.of(context).cylinder, '${glassPerscription?.leftEyeCylinder}', '-'),
getRow(TranslationBase.of(context).axis, '${glassPerscription?.leftEyeAxis}', '-'),
getRow(TranslationBase.of(context).prism, '${glassPerscription?.leftEyePrism}', '-'),
getRow(TranslationBase.of(context).va, '${glassPerscription?.leftEyeVA}', '-',isLast:true),
],
),
),

@ -11,12 +11,12 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ContactLensPage extends StatelessWidget {
final ListHISGetContactLensPerscription listHISGetContactLensPerscription;
final int appointmentNo;
final String projectName;
final int projectID;
final ListHISGetContactLensPerscription? listHISGetContactLensPerscription;
final int? appointmentNo;
final String? projectName;
final int? projectID;
const ContactLensPage({Key key, this.listHISGetContactLensPerscription, this.appointmentNo, this.projectName, this.projectID}) : super(key: key);
const ContactLensPage({Key? key, this.listHISGetContactLensPerscription, this.appointmentNo, this.projectName, this.projectID}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -45,14 +45,14 @@ class ContactLensPage extends StatelessWidget {
),
),
),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}', isLast: true),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription!.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription!.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription!.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription!.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription!.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription!.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription!.remarks}', isLast: true),
],
),
),
@ -77,14 +77,14 @@ class ContactLensPage extends StatelessWidget {
),
),
),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}', isLast: true),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription!.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription!.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription!.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription!.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription!.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription!.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription!.remarks}', isLast: true),
],
),
),

@ -18,24 +18,24 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'ClassesPage.dart';
import 'ContactLensPage.dart';
class EyeHomePage extends StatefulWidget {
final AppoimentAllHistoryResultList appointmentAllHistoryResultList;
final AppoimentAllHistoryResultList? appointmentAllHistoryResultList;
const EyeHomePage({Key key, this.appointmentAllHistoryResultList}) : super(key: key);
const EyeHomePage({Key? key, this.appointmentAllHistoryResultList}) : super(key: key);
@override
_EyeHomePageState createState() => _EyeHomePageState();
}
class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStateMixin {
TabController _tabController;
List<DoctorRateDetails> doctorDetailsList =[];
late TabController _tabController;
List<DoctorRateDetails> doctorDetailsList = [];
@override
void initState() {
@ -59,7 +59,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
appBarTitle: widget.appointmentAllHistoryResultList!.doctorTitle! + " " + widget.appointmentAllHistoryResultList!.doctorNameObj!,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
@ -67,18 +67,18 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
children: <Widget>[
DoctorHeader(
headerModel: HeaderModel(
widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj,
widget.appointmentAllHistoryResultList.doctorID,
widget.appointmentAllHistoryResultList.doctorImageURL,
widget.appointmentAllHistoryResultList.doctorSpeciality,
widget.appointmentAllHistoryResultList!.doctorTitle! + " " + widget.appointmentAllHistoryResultList!.doctorNameObj!,
widget.appointmentAllHistoryResultList!.doctorID!,
widget.appointmentAllHistoryResultList!.doctorImageURL!,
widget.appointmentAllHistoryResultList!.doctorSpeciality!,
"",
widget.appointmentAllHistoryResultList.projectName,
DateUtil.convertStringToDate(widget.appointmentAllHistoryResultList.appointmentDate),
widget.appointmentAllHistoryResultList.startTime.substring(0, 5),
null,
widget.appointmentAllHistoryResultList.doctorRate,
widget.appointmentAllHistoryResultList.actualDoctorRate,
widget.appointmentAllHistoryResultList.noOfPatientsRate,
widget.appointmentAllHistoryResultList!.projectName!,
DateUtil.convertStringToDate(widget.appointmentAllHistoryResultList!.appointmentDate!),
widget.appointmentAllHistoryResultList!.startTime!.substring(0, 5),
"null",
widget.appointmentAllHistoryResultList!.doctorRate,
widget.appointmentAllHistoryResultList!.actualDoctorRate,
widget.appointmentAllHistoryResultList!.noOfPatientsRate,
"",
//model.user.emailAddress,
),
@ -89,11 +89,11 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
showConfirmMessage(context, () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendGlassesPrescriptionEmail(
appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo,
projectName: widget.appointmentAllHistoryResultList.projectName,
projectID: widget.appointmentAllHistoryResultList.projectID);
appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo!,
projectName: widget.appointmentAllHistoryResultList!.projectName!,
projectID: widget.appointmentAllHistoryResultList!.projectID!);
GifLoaderDialogUtils.hideDialog(context);
}, projectViewModel.user.emailAddress);
}, projectViewModel.user!.emailAddress!);
},
),
Container(
@ -145,16 +145,16 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
controller: _tabController,
children: <Widget>[
ClassesPage(
glassPerscription: widget.appointmentAllHistoryResultList.listHISGetGlassPerscription[0],
appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo,
projectName: widget.appointmentAllHistoryResultList.projectName,
projectID: widget.appointmentAllHistoryResultList.projectID,
glassPerscription: widget.appointmentAllHistoryResultList!.listHISGetGlassPerscription![0],
appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo,
projectName: widget.appointmentAllHistoryResultList!.projectName,
projectID: widget.appointmentAllHistoryResultList!.projectID,
),
ContactLensPage(
listHISGetContactLensPerscription: widget.appointmentAllHistoryResultList.listHISGetContactLensPerscription[0],
appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo,
projectName: widget.appointmentAllHistoryResultList.projectName,
projectID: widget.appointmentAllHistoryResultList.projectID,
listHISGetContactLensPerscription: widget.appointmentAllHistoryResultList!.listHISGetContactLensPerscription![0],
appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo,
projectName: widget.appointmentAllHistoryResultList!.projectName,
projectID: widget.appointmentAllHistoryResultList!.projectID,
)
],
),
@ -180,7 +180,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
void getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, context).then((res) {
service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList!.doctorID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
@ -226,24 +226,32 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))),
Container(
margin: EdgeInsets.only(top: 0.0),
child: Text(this.widget.appointmentAllHistoryResultList.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
child: Text(this.widget.appointmentAllHistoryResultList!.actualDoctorRate!.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: this.widget.appointmentAllHistoryResultList.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
child: RatingBar(
initialRating: this.widget.appointmentAllHistoryResultList!.actualDoctorRate!.toDouble(),
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 35,
ignoreGestures: true,
ratingWidget: RatingWidget(
full: Icon(Icons.star),
half: Icon(Icons.star_half),
empty: Icon(Icons.star),
),
tapOnlyMode: true,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
},
),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(this.widget.appointmentAllHistoryResultList.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews,
child: Text(this.widget.appointmentAllHistoryResultList!.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews,
style: TextStyle(fontSize: 14.0, color: Colors.black))),
Container(
margin: EdgeInsets.only(top: 10.0),
@ -387,11 +395,13 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
pageBuilder: (context, animation1, animation2) {
return SizedBox();
});
}
double getRatingWidth(int patientNumber) {
var width = (patientNumber / this.widget.appointmentAllHistoryResultList.noOfPatientsRate) * 100;
var width = (patientNumber / this.widget.appointmentAllHistoryResultList!.noOfPatientsRate!) * 100;
return width;
}
}

@ -70,14 +70,14 @@ class EyeMeasurementsPage extends StatelessWidget {
),
),
isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj,
name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!,
// billNo: "appointmentResult.do",
profileUrl: _appointmentResult.doctorImageURL,
subName: _appointmentResult.clinicName,
isLiveCareAppointment: _appointmentResult.isLiveCareAppointment,
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate),
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate!),
isSortByClinic: false,
rating: _appointmentResult.actualDoctorRate + 0.0,
rating: _appointmentResult.actualDoctorRate! + 0.0,
// appointmentTime: _appointmentResult.startTime.substring(0, 5),
// remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)
// ? _appointmentResult.remaniningHoursTocanPay

@ -20,9 +20,9 @@ import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
class LaboratoryResultPage extends StatefulWidget {
final PatientLabOrders patientLabOrders;
final PatientLabOrders? patientLabOrders;
LaboratoryResultPage({Key key, this.patientLabOrders});
LaboratoryResultPage({Key? key, this.patientLabOrders});
@override
_LaboratoryResultPageState createState() => _LaboratoryResultPageState();
@ -34,16 +34,16 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLaboratoryResult(
invoiceNo: widget.patientLabOrders.invoiceNo,
clinicID: widget.patientLabOrders.clinicID,
projectID: widget.patientLabOrders.projectID,
orderNo: widget.patientLabOrders.orderNo,
setupID: widget.patientLabOrders.setupID,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)),
invoiceNo: widget.patientLabOrders!.invoiceNo!,
clinicID: widget.patientLabOrders!.clinicID!,
projectID: widget.patientLabOrders!.projectID!,
orderNo: widget.patientLabOrders!.orderNo!,
setupID: widget.patientLabOrders!.setupID!,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)),
),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: widget.patientLabOrders.doctorName,
appBarTitle: widget.patientLabOrders!.doctorName!,
baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
@ -58,13 +58,21 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
itemBuilder: (context, index) => LaboratoryResultWidget(
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)));
await model.sendLabReportEmail(
patientLabOrder: widget.patientLabOrders,
mes: TranslationBase.of(context).sendSuc,
userObj: projectViewModel.user,
isVidaPlus: Utils.isVidaPlusProject(
projectViewModel,
int.parse(widget.patientLabOrders!.projectID!),
),
);
GifLoaderDialogUtils.hideDialog(context);
},
billNo: widget.patientLabOrders.invoiceNo,
billNo: widget.patientLabOrders!.invoiceNo,
// details: model.patientLabSpecialResult[index].resultDataHTML,
details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model),
orderNo: widget.patientLabOrders.orderNo,
orderNo: widget.patientLabOrders!.orderNo,
patientLabOrder: widget.patientLabOrders,
),
itemCount: 1,
@ -119,7 +127,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
String labResults = "";
model.patientLabSpecialResult.forEach((element) {
if (element.resultDataHTML != null) {
labResults += (element.resultDataHTML + "<br/> <br/>");
labResults += (element.resultDataHTML! + "<br/> <br/>");
} else {
labResults += ("<h6>No Result Available</h6>");
}

@ -79,7 +79,7 @@ class LabsHomePage extends StatelessWidget {
),
),
isInOutPatient: labOrder.isInOutPatient,
name: TranslationBase.of(context).dr + " " + labOrder.doctorName,
name: TranslationBase.of(context).dr + " " + labOrder.doctorName!,
billNo: labOrder.invoiceNo,
profileUrl: labOrder.doctorImageURL,
subName: _isSortByClinic ? (labOrder.projectName ?? labOrder.clinicDescription) : (labOrder.clinicDescription ?? labOrder.projectName),

@ -18,8 +18,8 @@ class PassportUpdatePage extends StatefulWidget {
class _PassportUpdatePageState extends State<PassportUpdatePage> {
TextEditingController passportNumber = new TextEditingController();
bool _isButtonDisabled;
ProjectViewModel projectViewModel;
bool? _isButtonDisabled;
ProjectViewModel? projectViewModel;
@override
void initState() {
@ -78,7 +78,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel!.user!.firstName! + " " + projectViewModel!.user!.lastName!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -100,7 +100,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
projectViewModel!.user!.patientIdentificationNo!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -144,8 +144,8 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xFFc5272d),
disabledForegroundColor: Colors.red[300].withOpacity(0.38),
disabledBackgroundColor: Colors.red[300].withOpacity(0.12),
disabledForegroundColor: Colors.red[300]!.withOpacity(0.38),
disabledBackgroundColor: Colors.red[300]!.withOpacity(0.12),
elevation: 0,
onPressed: () {
if (_isButtonDisabled == false)
@ -170,7 +170,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

@ -56,19 +56,19 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
// DoctorView(doctor: doctor, isLiveCareAppointment: false, isShowFlag: false),
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
widget.doctor.clinicName,
widget.doctor.projectName,
widget.doctor.name!,
widget.doctor.doctorID!,
widget.doctor.doctorImageURL!,
widget.doctor.speciality!,
widget.doctor.clinicName!,
widget.doctor.projectName!,
DateUtil.convertStringToDate(widget.doctor.date),
null,
widget.doctor.nationalityFlagURL,
widget.doctor.nationalityFlagURL!,
widget.doctor.doctorRate,
widget.doctor.actualDoctorRate,
widget.doctor.noOfPatientsRate ?? 0,
projectViewModel.user.emailAddress,
projectViewModel.user!.emailAddress!,
decimalDoctorRate: widget.doctor.decimalDoctorRate.toString()),
onTap: () {
sendInvoiceEmail();
@ -114,12 +114,12 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
MyRichText(
TranslationBase.of(context).insuranceCompany + ": ",
projectViewModel.isArabic
? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].groupNameN
: widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName,
? widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].groupNameN
: widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].companyName,
projectViewModel.isArabic),
MyRichText(
TranslationBase.of(context).insuranceID + ": ",
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A",
widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].insuranceID! : "N/A",
projectViewModel.isArabic),
],
),
@ -163,11 +163,11 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
Expanded(
child: _getNormalText(TranslationBase.of(context).totalVAT.toString() +
" (" +
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() +
widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![0].vATPercentage.toString() +
"%): "),
),
Expanded(
child: _getNormalText(num.tryParse(this.totalVAT.toString()).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true),
child: _getNormalText(num.tryParse(this.totalVAT.toString())!.toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true),
)
],
),
@ -222,9 +222,9 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
subTotal = 0;
grandTotal = 0;
List<ListConsultation> listConsultations = new[];
List<ListConsultation> listConsultations = [];
widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.forEach((item) {
widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.forEach((item) {
var i = listConsultations.indexWhere((x) => x.procedureID == item.procedureID);
if (i <= -1) {
listConsultations.add(item);
@ -246,7 +246,7 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
GifLoaderDialogUtils.showMyDialog(widget.context);
MyInvoicesService myInvoicesService = new MyInvoicesService();
myInvoicesService.sendDentalAppointmentInvoiceEmail(widget.listDentalAppointments.projectID, widget.listDentalAppointments.appointmentNo, widget.context).then((res) {
myInvoicesService.sendDentalAppointmentInvoiceEmail(widget.listDentalAppointments.projectID!, widget.listDentalAppointments.appointmentNo!, widget.context).then((res) {
GifLoaderDialogUtils.hideDialog(widget.context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(widget.context).emailSentSuccessfully);
@ -274,17 +274,17 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
],
),
);
for (int i = 0; i < widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length; i++) {
for (int i = 0; i < widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length; i++) {
tableRow.add(
TableRow(children: [
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].procedureName}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].quantity}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].price.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)),
Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation![i].total.toString() + " " + TranslationBase.of(context).sar}',
isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental![0].listConsultation!.length - 1)),
]),
);
}

@ -22,10 +22,10 @@ class MyInvoices extends StatefulWidget {
class _MyInvoicesState extends State<MyInvoices> {
bool isDataLoaded = false;
GetDentalAppointmentsResponse getDentalAppointmentsResponse;
DentalInvoiceDetailResponse dentalInvoiceDetailResponse;
GetDentalAppointmentsResponse? getDentalAppointmentsResponse;
DentalInvoiceDetailResponse? dentalInvoiceDetailResponse;
ProjectViewModel projectViewModel;
ProjectViewModel? projectViewModel;
List<ImagesInfo> imagesInfo =[];
@override
@ -34,7 +34,7 @@ class _MyInvoicesState extends State<MyInvoices> {
.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/ar/0.png'));
WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin) getDentalAppointments();
if (projectViewModel!.isLogin) getDentalAppointments();
});
super.initState();
}
@ -61,18 +61,18 @@ class _MyInvoicesState extends State<MyInvoices> {
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => openInvoiceDetailsPage(getDentalAppointmentsResponse.listDentalAppointments[index]),
onTap: () => openInvoiceDetailsPage(getDentalAppointmentsResponse!.listDentalAppointments![index]),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (projectViewModel.isArabic ? getDentalAppointmentsResponse.listDentalAppointments[index].doctorNameN.toString() : getDentalAppointmentsResponse.listDentalAppointments[index].doctorName.toString()),
billNo: getDentalAppointmentsResponse.listDentalAppointments[index].invoiceNo.toString(),
profileUrl: getDentalAppointmentsResponse.listDentalAppointments[index].doctorImageURL,
subName: getDentalAppointmentsResponse.listDentalAppointments[index].projectName,
name: TranslationBase.of(context).dr.toString() + " " + (projectViewModel!.isArabic ? getDentalAppointmentsResponse!.listDentalAppointments![index].doctorNameN.toString() : getDentalAppointmentsResponse!.listDentalAppointments![index].doctorName.toString()),
billNo: getDentalAppointmentsResponse!.listDentalAppointments![index].invoiceNo.toString(),
profileUrl: getDentalAppointmentsResponse!.listDentalAppointments![index].doctorImageURL,
subName: getDentalAppointmentsResponse!.listDentalAppointments![index].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(getDentalAppointmentsResponse.listDentalAppointments[index].appointmentDate),
date: DateUtil.convertStringToDate(getDentalAppointmentsResponse!.listDentalAppointments![index].appointmentDate!),
isSortByClinic: true,
);
},
itemCount: getDentalAppointmentsResponse.listDentalAppointments.length,
itemCount: getDentalAppointmentsResponse!.listDentalAppointments!.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
],
@ -88,7 +88,7 @@ class _MyInvoicesState extends State<MyInvoices> {
DoctorListResponse.DoctorList doctor = new DoctorListResponse.DoctorList();
doctor.name = projectViewModel.isArabic ? listDentalAppointments.doctorNameN : listDentalAppointments.doctorName;
doctor.name = projectViewModel!.isArabic ? listDentalAppointments.doctorNameN : listDentalAppointments.doctorName;
doctor.projectName = listDentalAppointments.projectName;
doctor.date = listDentalAppointments.appointmentDate;
doctor.actualDoctorRate = 0;
@ -102,12 +102,12 @@ class _MyInvoicesState extends State<MyInvoices> {
doctor.decimalDoctorRate = listDentalAppointments.decimalDoctorRate;
doctor.doctorID = listDentalAppointments.doctorID;
myInvoicesService.getDentalAppointmentInvoice(listDentalAppointments.projectID, listDentalAppointments.appointmentNo, listDentalAppointments.invoiceNo, context).then((res) {
myInvoicesService.getDentalAppointmentInvoice(listDentalAppointments.projectID!, listDentalAppointments.appointmentNo!, listDentalAppointments.invoiceNo!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['MessageStatus'] == 1) {
dentalInvoiceDetailResponse = DentalInvoiceDetailResponse.fromJson(res);
Navigator.push(context, FadePage(page: InvoiceDetail(doctor, listDentalAppointments, dentalInvoiceDetailResponse, context)));
dentalInvoiceDetailResponse = DentalInvoiceDetailResponse.fromJson(res as Map<String, dynamic>);
Navigator.push(context, FadePage(page: InvoiceDetail(doctor, listDentalAppointments, dentalInvoiceDetailResponse!, context)));
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -128,7 +128,7 @@ class _MyInvoicesState extends State<MyInvoices> {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['MessageStatus'] == 1) {
getDentalAppointmentsResponse = GetDentalAppointmentsResponse.fromJson(res);
getDentalAppointmentsResponse = GetDentalAppointmentsResponse.fromJson(res as Map<String, dynamic>);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}

@ -17,15 +17,15 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart';
class AddWeightPage extends StatefulWidget {
final WeightPressureViewModel model;
final bool isUpdate;
final DateTime dayWeightDate;
final int lineItemNo;
final String weightValue;
final String measureTimeSelectedType;
final int weightUnit;
final WeightPressureViewModel? model;
final bool? isUpdate;
final DateTime? dayWeightDate;
final int? lineItemNo;
final String? weightValue;
final String? measureTimeSelectedType;
final int? weightUnit;
AddWeightPage({Key key, this.model, this.isUpdate = false, this.dayWeightDate, this.lineItemNo, this.weightValue, this.measureTimeSelectedType, this.weightUnit}) : super(key: key);
AddWeightPage({Key? key, this.model, this.isUpdate = false, this.dayWeightDate, this.lineItemNo, this.weightValue, this.measureTimeSelectedType, this.weightUnit}) : super(key: key);
@override
_AddWeightPageState createState() => _AddWeightPageState();
@ -44,18 +44,18 @@ class _AddWeightPageState extends State<AddWeightPage> {
"باوند",
"كيلو جرام",
];
String measureTimeSelectedType;
late String measureTimeSelectedType;
bool isButtonDisabled = true;
@override
void initState() {
super.initState();
if (widget.isUpdate) {
dayWeightDate = widget.dayWeightDate;
timeWeightDate = widget.dayWeightDate;
measureTimeSelectedType = widget.measureTimeSelectedType;
weightUnit = widget.weightUnit;
_weightValueController.text = widget.weightValue;
if (widget.isUpdate!) {
dayWeightDate = widget.dayWeightDate!;
timeWeightDate = widget.dayWeightDate!;
measureTimeSelectedType = widget.measureTimeSelectedType!;
weightUnit = widget.weightUnit!;
_weightValueController.text = widget.weightValue!;
validateForm();
}
}
@ -66,7 +66,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
return AppScaffold(
isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
appBarTitle: widget.isUpdate! ? TranslationBase.of(context).update : TranslationBase.of(context).add,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Column(
@ -180,7 +180,7 @@ class _AddWeightPageState extends State<AddWeightPage> {
),
),
),
widget.isUpdate
widget.isUpdate!
? Container(
padding: EdgeInsets.all(10),
child: Row(
@ -200,15 +200,15 @@ class _AddWeightPageState extends State<AddWeightPage> {
message: TranslationBase.of(context).removeMeasure,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deleteWeightResult(lineItemNo: widget.lineItemNo).then((value) {
widget.model!.deleteWeightResult(lineItemNo: widget.lineItemNo!).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
if (widget.model!.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model!.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
AppToast.showErrorToast(message: widget.model!.error);
});
},
),
@ -232,31 +232,31 @@ class _AddWeightPageState extends State<AddWeightPage> {
: () async {
if (_weightValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate) {
widget.model
if (widget.isUpdate!) {
widget.model!
.updateWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
lineItemNo: widget.lineItemNo)
lineItemNo: widget.lineItemNo!)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
if (widget.model!.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model!.error);
else
Navigator.pop(context);
});
} else
widget.model
.addWeightResult(
!.addWeightResult(
weightDate: '${dayWeightDate.year}-${dayWeightDate.month}-${dayWeightDate.day} ${timeWeightDate.hour}:${timeWeightDate.minute}:00',
weightMeasured: _weightValueController.text.toString(),
weightUnit: weightUnit,
)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model.error);
if (widget.model!.state == ViewState.Error)
AppToast.showErrorToast(message: widget.model!.error);
else
Navigator.pop(context);
});

@ -24,7 +24,7 @@ class WeightHomePage extends StatefulWidget {
}
class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
@override
void initState() {
@ -58,7 +58,7 @@ class _WeightHomePageState extends State<WeightHomePage> with SingleTickerProvid
showDialog(
context: context,
builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress,
email: model.user!.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {

@ -13,14 +13,14 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class WeightMonthlyPage extends StatelessWidget {
final WeightPressureViewModel model;
final WeightPressureViewModel? model;
WeightMonthlyPage({
Key key,
Key? key,
this.model,
}) : super(key: key);
List<List> monthlyGroup = [];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -34,8 +34,8 @@ class WeightMonthlyPage extends StatelessWidget {
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5,
timeSeries: model!.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model!.weighMonthTimeSeriesData,
indexes: model!.weighMonthTimeSeriesData.length ~/ 5.5,
),
),
Container(
@ -54,7 +54,7 @@ class WeightMonthlyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weighMonthTimeSeriesData.isEmpty
model!.weighMonthTimeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
@ -117,7 +117,7 @@ class WeightMonthlyPage extends StatelessWidget {
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.monthWeightMeasurementResult, (obj) => DateUtil.getMonth(obj.weightDate.month) + ' ' + obj.weightDate.year.toString());
var groupedArray = groupBy(model!.monthWeightMeasurementResult, (obj) => DateUtil.getMonth(obj.weightDate!.month) + ' ' + obj.weightDate!.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
}

@ -18,9 +18,9 @@ import 'AddWeightPage.dart';
class WeightWeeklyPage extends StatelessWidget {
final WeightPressureViewModel model;
WeightWeeklyPage({Key key, this.model}) : super(key: key);
WeightWeeklyPage({ Key? key, required this.model}) : super(key: key);
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -93,8 +93,8 @@ class WeightWeeklyPage extends StatelessWidget {
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate!)} ', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${diabtec.weightDate!.hour}:${diabtec.weightDate!.minute}', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false, mProjectViewModel: projectViewModel),
Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
SizedBox(height: 12),

@ -19,11 +19,11 @@ class WeightYearPage extends StatelessWidget {
final WeightPressureViewModel model;
WeightYearPage({
Key key,
this.model,
Key? key,
required this.model,
}) : super(key: key);
List<List> monthlyGroup = [];
ProjectViewModel projectViewModel;
ProjectViewModel? projectViewModel;
@override
Widget build(BuildContext context) {
if (projectViewModel == null) projectViewModel = Provider.of(context);
@ -37,7 +37,7 @@ class WeightYearPage extends StatelessWidget {
horizontalInterval: 2.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesData,
indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "",
indexes: model.weightYearTimeSeriesData.length ~/ 5.5,
)),
Container(
@ -116,7 +116,7 @@ class WeightYearPage extends StatelessWidget {
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.yearWeightMeasurementResult.reversed, (obj) => DateUtil.getMonth(obj.weightDate.month) + ' ' + obj.weightDate.year.toString());
var groupedArray = groupBy(model.yearWeightMeasurementResult.reversed, (obj) => DateUtil.getMonth(obj.weightDate!.month) + ' ' + obj.weightDate!.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
}

@ -17,17 +17,17 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart';
class AddBloodPressurePage extends StatefulWidget {
final DateTime bloodSugarDate;
final String measureTimeSelectedType;
final bool isUpdate;
final int lineItemNo;
final int measuredArm;
final String bloodSystolicValue;
final String bloodDiastolicValue;
final BloodPressureViewMode model;
final DateTime? bloodSugarDate;
final String? measureTimeSelectedType;
final bool? isUpdate;
final int? lineItemNo;
final int? measuredArm;
final String? bloodSystolicValue;
final String? bloodDiastolicValue;
final BloodPressureViewMode? model;
const AddBloodPressurePage(
{Key key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.measuredArm, this.model, this.bloodSystolicValue, this.bloodDiastolicValue})
{Key? key, this.bloodSugarDate, this.measureTimeSelectedType, this.isUpdate = false, this.lineItemNo, this.measuredArm, this.model, this.bloodSystolicValue, this.bloodDiastolicValue})
: super(key: key);
@override
@ -48,15 +48,15 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
@override
void initState() {
super.initState();
if (widget.isUpdate) {
bloodSugarDate = widget.bloodSugarDate;
bloodSugarDate = widget.bloodSugarDate;
measureTimeSelectedType = widget.measureTimeSelectedType;
measuredArm = widget.measuredArm;
if (widget.isUpdate!) {
bloodSugarDate = widget.bloodSugarDate!;
bloodSugarDate = widget.bloodSugarDate!;
measureTimeSelectedType = widget.measureTimeSelectedType!;
measuredArm = widget.measuredArm!;
if (measuredArm > 1) measuredArm = measuredArm - 1;
_bloodSystolicValueController.text = widget.bloodSystolicValue;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue;
_bloodSystolicValueController.text = widget.bloodSystolicValue!;
_bloodDiastolicValueController.text = widget.bloodDiastolicValue!;
validateForm();
}
}
@ -67,7 +67,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold(
isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
appBarTitle: widget.isUpdate! ? TranslationBase.of(context).update : TranslationBase.of(context).add,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Column(
@ -182,7 +182,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
),
),
),
widget.isUpdate
widget.isUpdate!
? Container(
padding: EdgeInsets.all(10),
child: Row(
@ -205,15 +205,15 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
widget.model!.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo!).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error);
if (widget.model!.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model!.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
AppToast.showErrorToast(message: widget.model!.error);
});
},
cancelFunction: () => {});
@ -236,8 +236,8 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model
.addORUpdateDiabtecResult(
isUpdate: widget.isUpdate,
!.addORUpdateDiabtecResult(
isUpdate: widget.isUpdate!,
bloodPressureDate: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(),
systolicePressure: _bloodSystolicValueController.text.toString(),
@ -245,14 +245,14 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.BusyLocal)
AppToast.showErrorToast(message: widget.model.error);
if (widget.model!.state == ViewState.BusyLocal)
AppToast.showErrorToast(message: widget.model!.error);
else
Navigator.pop(context);
;
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
AppToast.showErrorToast(message: widget.model!.error);
});
}
},

@ -24,7 +24,7 @@ class BloodPressureHomePage extends StatefulWidget {
}
class _BloodPressureHomePageState extends State<BloodPressureHomePage> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
@override
void initState() {
@ -128,7 +128,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage> with Sing
showDialog(
context: context,
builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress,
email: model.user!.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {

@ -12,11 +12,11 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BloodPressureMonthlyPage extends StatelessWidget {
final BloodPressureViewMode model;
final BloodPressureViewMode? model;
BloodPressureMonthlyPage({Key key, this.model}) : super(key: key);
BloodPressureMonthlyPage({Key? key, this.model}) : super(key: key);
List<List> monthlyGroup = [];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -31,9 +31,9 @@ class BloodPressureMonthlyPage extends StatelessWidget {
MonthCurvedChartBloodPressure(
horizontalInterval: 20.0,
title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataTop,
timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesDataLow,
indexes: model.weighMonthTimeSeriesDataLow.length ~/ 5.5,
timeSeries1: model!.weighMonthTimeSeriesDataTop.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model!.weighMonthTimeSeriesDataTop,
timeSeries2: model!.weighMonthTimeSeriesDataLow.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model!.weighMonthTimeSeriesDataLow,
indexes: model!.weighMonthTimeSeriesDataLow.length ~/ 5.5,
),
),
SizedBox(
@ -49,7 +49,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.weighMonthTimeSeriesDataTop.isEmpty
model!.weighMonthTimeSeriesDataTop.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
@ -111,7 +111,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.bloodPressureService.monthDiabtecPatientResult, (obj) => DateUtil.getMonth(obj.bloodPressureDate.month) + ' ' + obj.bloodPressureDate.year.toString());
var groupedArray = groupBy(model!.bloodPressureService.monthDiabtecPatientResult, (obj) => DateUtil.getMonth(obj.bloodPressureDate!.month) + ' ' + obj.bloodPressureDate!.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
}

@ -16,9 +16,9 @@ import 'package:provider/provider.dart';
class BloodPressureYearPage extends StatelessWidget {
final BloodPressureViewMode model;
BloodPressureYearPage({Key key, this.model}) : super(key: key);
BloodPressureYearPage({Key? key, required this.model}) : super(key: key);
List<List> monthlyGroup = [];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -107,7 +107,7 @@ class BloodPressureYearPage extends StatelessWidget {
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(model.bloodPressureService.yearDiabtecPatientResult.reversed, (obj) => DateUtil.getMonth(obj.bloodPressureDate.month) + ' ' + obj.bloodPressureDate.year.toString());
var groupedArray = groupBy(model.bloodPressureService.yearDiabtecPatientResult.reversed, (obj) => DateUtil.getMonth(obj.bloodPressureDate!.month) + ' ' + obj.bloodPressureDate!.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
}

@ -14,11 +14,11 @@ import 'package:provider/provider.dart';
import 'AddBloodPressurePage.dart';
class BloodPressureWeeklyPage extends StatelessWidget {
final BloodPressureViewMode model;
final BloodPressureViewMode? model;
BloodPressureWeeklyPage({Key key, this.model}) : super(key: key);
BloodPressureWeeklyPage({Key? key, this.model}) : super(key: key);
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -31,9 +31,9 @@ class BloodPressureWeeklyPage extends StatelessWidget {
color: Colors.white,
child: LineChartCurvedBloodPressure(
title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop,
timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
timeSeries1: model!.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model!.weightWeekTimeSeriesDataTop,
timeSeries2: model!.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model!.weightWeekTimeSeriesDataLow,
indexes: model!.weightWeekTimeSeriesDataLow.length ~/ 5.5,
),
),
SizedBox(
@ -49,7 +49,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.bloodPressureService.weekDiabtecPatientResult.isEmpty
model!.bloodPressureService.weekDiabtecPatientResult.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
@ -60,7 +60,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
0: FlexColumnWidth(1.8),
2: FlexColumnWidth(1.8),
},
children: fullData(context, model),
children: fullData(context, model!),
),
SizedBox(height: 80)
],
@ -83,13 +83,13 @@ class BloodPressureWeeklyPage extends StatelessWidget {
],
),
);
model.weekDiabtecPatientResult.reversed.forEach(
model!.weekDiabtecPatientResult!.reversed.forEach(
(diabtec) {
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(diabtec.bloodPressureDate.hour.toString() + ':' + diabtec.bloodPressureDate.minute.toString(), isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate!)} ', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(diabtec.bloodPressureDate!.hour.toString() + ':' + diabtec.bloodPressureDate!.minute.toString(), isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${diabtec.measuredArmDesc}', isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false, mProjectViewModel: projectViewModel),
Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
@ -112,10 +112,10 @@ class BloodPressureWeeklyPage extends StatelessWidget {
),
),
).then((value) {
model.getBloodPressure();
if (model.weekDiabtecPatientResult.isEmpty) {
model.weightWeekTimeSeriesDataTop.clear();
model.weightWeekTimeSeriesDataLow.clear();
model!.getBloodPressure();
if (model!.weekDiabtecPatientResult.isEmpty) {
model!.weightWeekTimeSeriesDataTop.clear();
model!.weightWeekTimeSeriesDataLow.clear();
}
});
},

@ -17,17 +17,17 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart';
class AddBloodSugarPage extends StatefulWidget {
final DateTime bloodSugarDate;
final String measureUnitSelectedType;
final bool isUpdate;
final String measuredTime;
final String bloodSugarValue;
final int lineItemNo;
final String measuredSelectedType;
final BloodSugarViewMode bloodSugarViewMode;
final DateTime? bloodSugarDate;
final String? measureUnitSelectedType;
final bool? isUpdate;
final String? measuredTime;
final String? bloodSugarValue;
final int? lineItemNo;
final String? measuredSelectedType;
final BloodSugarViewMode? bloodSugarViewMode;
AddBloodSugarPage(
{Key key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType})
{Key? key, this.bloodSugarDate, this.measureUnitSelectedType, this.isUpdate = false, this.measuredTime, this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode, this.measuredSelectedType})
: super(key: key);
@override
@ -68,20 +68,20 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
"صائم",
"آخر",
];
int _selectedMeasureTimeIndex;
String measureTimeSelectedType;
int? _selectedMeasureTimeIndex;
String? measureTimeSelectedType;
@override
void initState() {
super.initState();
if (widget.isUpdate) {
bloodSugarDate = widget.bloodSugarDate;
timeSugarDate = widget.bloodSugarDate;
measureUnitSelectedType = widget.measureUnitSelectedType;
if (widget.isUpdate!) {
bloodSugarDate = widget.bloodSugarDate!;
timeSugarDate = widget.bloodSugarDate!;
measureUnitSelectedType = widget.measureUnitSelectedType!;
if (measureTimeEnList.contains(widget.measuredTime))
measuredTime = measureTimeEnList.indexOf(widget.measuredTime);
else if (measureTimeArList.contains(widget.measuredTime)) measuredTime = measureTimeArList.indexOf(widget.measuredTime);
_bloodSugarValueController.text = widget.bloodSugarValue;
measuredTime = measureTimeEnList.indexOf(widget.measuredTime!);
else if (measureTimeArList.contains(widget.measuredTime)) measuredTime = measureTimeArList.indexOf(widget.measuredTime!);
_bloodSugarValueController.text = widget.bloodSugarValue!;
measureTimeSelectedType = widget.measuredSelectedType;
validateForm();
}
@ -94,7 +94,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
appBarTitle: widget.isUpdate! ? TranslationBase.of(context).update : TranslationBase.of(context).add,
body: Column(
children: [
Expanded(
@ -198,7 +198,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
),
),
),
widget.isUpdate
widget.isUpdate!
? Container(
padding: EdgeInsets.all(10),
child: Row(
@ -218,15 +218,15 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
message: TranslationBase.of(context).removeMeasure,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
widget.bloodSugarViewMode!.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo!).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
if (widget.bloodSugarViewMode!.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode!.error);
else
Navigator.pop(context);
}).catchError((e) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
AppToast.showErrorToast(message: widget.bloodSugarViewMode!.error);
});
},
),
@ -248,8 +248,8 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
: () async {
if (_bloodSugarValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate) {
await widget.bloodSugarViewMode.updateDiabtecResult(
if (widget.isUpdate!) {
await widget.bloodSugarViewMode!.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
@ -258,12 +258,12 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
bloodSugerResult: _bloodSugarValueController.text.toString());
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
if (widget.bloodSugarViewMode!.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.bloodSugarViewMode!.error);
else
Navigator.pop(context);
} else {
await widget.bloodSugarViewMode.addDiabtecResult(
await widget.bloodSugarViewMode!.addDiabtecResult(
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
bloodSugerResult: _bloodSugarValueController.text.toString(),
@ -271,8 +271,8 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
);
GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
if (widget.bloodSugarViewMode!.state == ViewState.Error)
AppToast.showErrorToast(message: widget.bloodSugarViewMode!.error);
else
Navigator.pop(context);
}

@ -14,14 +14,14 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BloodMonthlyPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales3> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode;
final List<DiabtecPatientResult>? diabtecPatientResult;
final List<TimeSeriesSales3>? timeSeriesData;
final BloodSugarViewMode? bloodSugarViewMode;
BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
BloodMonthlyPage({Key? key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
List<List> monthlyGroup = [];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -36,8 +36,8 @@ class BloodMonthlyPage extends StatelessWidget {
color: Colors.white,
child: MonthLineChartCurved(
title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
timeSeries: timeSeriesData!.isEmpty ? [TimeSeriesSales3(0, 0.0)] : timeSeriesData!,
indexes: timeSeriesData!.length ~/ 5.5,
)),
SizedBox(
height: 12,
@ -50,7 +50,7 @@ class BloodMonthlyPage extends StatelessWidget {
padding: EdgeInsets.all(10),
color: Colors.transparent,
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
timeSeriesData.isEmpty
timeSeriesData!.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
@ -110,7 +110,7 @@ class BloodMonthlyPage extends StatelessWidget {
groupData() {
monthlyGroup.clear();
var groupedArray = groupBy(diabtecPatientResult, (obj) => DateUtil.getMonth(obj.dateChart.month) + ' ' + obj.dateChart.year.toString());
var groupedArray = groupBy(diabtecPatientResult!, (obj) => DateUtil.getMonth(obj.dateChart!.month) + ' ' + obj.dateChart!.year.toString());
groupedArray.entries.forEach((e) => monthlyGroup.add([e.key, e.value]));
}
}

@ -13,13 +13,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BloodYearPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales2> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode;
final List<DiabtecPatientResult>? diabtecPatientResult;
final List<TimeSeriesSales2>? timeSeriesData;
final BloodSugarViewMode? bloodSugarViewMode;
BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
BloodYearPage({Key? key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
List<List> yearlyGroup = [];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -34,8 +34,8 @@ class BloodYearPage extends StatelessWidget {
color: Colors.white,
child: ShowChart(
title: TranslationBase.of(context).weight,
timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
timeSeries: timeSeriesData!.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData!.length ~/ 5.5,
horizontalInterval: 2,
),
),
@ -52,7 +52,7 @@ class BloodYearPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
timeSeriesData.isEmpty
timeSeriesData!.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
@ -114,7 +114,7 @@ class BloodYearPage extends StatelessWidget {
groupData() {
yearlyGroup.clear();
var groupedArray = groupBy(diabtecPatientResult.reversed, (obj) => DateUtil.getMonth(obj.dateChart.month) + ' ' + obj.dateChart.year.toString());
var groupedArray = groupBy(diabtecPatientResult!.reversed, (obj) => DateUtil.getMonth(obj.dateChart!.month) + ' ' + obj.dateChart!.year.toString());
groupedArray.entries.forEach((e) => yearlyGroup.add([e.key, e.value]));
}
}

@ -24,7 +24,7 @@ class BloodSugarHomePage extends StatefulWidget {
}
class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
@override
void initState() {
@ -136,7 +136,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage> with SingleTick
showDialog(
context: context,
builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress,
email: model.user!.emailAddress,
onTapSendEmail: () async {
GifLoaderDialogUtils.showMyDialog(context);
model.sendReportByEmail().then((value) {

@ -17,12 +17,12 @@ import 'package:provider/provider.dart';
import 'AddBloodSugarPage.dart';
class BloodSugarWeeklyPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult;
final BloodSugarViewMode bloodSugarViewMode;
final List<TimeSeriesSales2> timeSeriesData;
ProjectViewModel projectViewModel;
final List<DiabtecPatientResult>? diabtecPatientResult;
final BloodSugarViewMode? bloodSugarViewMode;
final List<TimeSeriesSales2>? timeSeriesData;
ProjectViewModel? projectViewModel;
BloodSugarWeeklyPage({Key key, this.diabtecPatientResult, this.bloodSugarViewMode, this.timeSeriesData}) : super(key: key);
BloodSugarWeeklyPage({Key? key, this.diabtecPatientResult, this.bloodSugarViewMode, this.timeSeriesData}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -35,8 +35,8 @@ class BloodSugarWeeklyPage extends StatelessWidget {
color: Colors.white,
child: ShowChart(
title: TranslationBase.of(context).weight,
timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5,
timeSeries: timeSeriesData!.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData,
indexes: timeSeriesData!.length ~/ 5.5,
horizontalInterval: 2,
),
),
@ -53,7 +53,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
timeSeriesData.isEmpty
timeSeriesData!.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(AppGlobal.context).noDataAvailable),
@ -64,7 +64,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
0: FlexColumnWidth(1.8),
2: FlexColumnWidth(1.8),
},
children: fullData(context, bloodSugarViewMode),
children: fullData(context, bloodSugarViewMode!),
),
SizedBox(
height: 80,
@ -90,14 +90,14 @@ class BloodSugarWeeklyPage extends StatelessWidget {
],
),
);
diabtecPatientResult.forEach(
diabtecPatientResult!.forEach(
(diabtec) {
tableRow.add(
TableRow(
children: [
Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart!), isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(diabtec.dateChart!.hour.toString() + ':' + diabtec.dateChart!.minute.toString(), isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(diabtec.measuredDesc!, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false, mProjectViewModel: projectViewModel),
Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [
SizedBox(height: 12),
@ -120,7 +120,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
),
).then((value) {
if (bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) {
timeSeriesData.clear();
timeSeriesData!.clear();
}
});
},

@ -38,7 +38,7 @@ class MyTrackers extends StatelessWidget {
child: MedicalProfileItem(
title: TranslationBase.of(context).bloodSugar,
imagePath: 'assets/tracker/blood-suger.png',
subTitle: null,
subTitle: "",
isPngImage: true,
width: 45.0,
height: 45.0,
@ -51,7 +51,7 @@ class MyTrackers extends StatelessWidget {
child: MedicalProfileItem(
title: TranslationBase.of(context).bloodPressure,
imagePath: 'assets/tracker/blood-pressure.png',
subTitle: null,
subTitle: "",
isPngImage: true,
width: 45.0,
height: 45.0,
@ -64,7 +64,7 @@ class MyTrackers extends StatelessWidget {
child: MedicalProfileItem(
title: TranslationBase.of(context).weight,
imagePath: 'assets/tracker/weight.png',
subTitle: null,
subTitle: "",
isPngImage: true,
width: 45.0,
height: 45.0,

@ -7,11 +7,11 @@ import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class CurvedChartBloodPressure extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2;
final int indexes;
final double horizontalInterval;
final String? title;
final List<TimeSeriesSales2>? timeSeries1;
final List<TimeSeriesSales2>? timeSeries2;
final int? indexes;
final double? horizontalInterval;
CurvedChartBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.horizontalInterval = 20.0});
@ -37,7 +37,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
height: 15,
),
Text(
title,
title!,
style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center,
),
@ -100,9 +100,9 @@ class CurvedChartBloodPressure extends StatelessWidget {
}
getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries1.length) {
for (int index = 0; index < timeSeries1!.length; index++) {
int mIndex = indexes! * index;
if (mIndex < timeSeries1!.length) {
xAxixs.add(mIndex);
}
}
@ -114,7 +114,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
touchCallback: (touchEvent, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true),
@ -127,16 +127,16 @@ class CurvedChartBloodPressure extends StatelessWidget {
),
margin: 22,
getTitles: (value) {
if (timeSeries1.length < 15) {
if (timeSeries1.length > value.toInt()) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (timeSeries1!.length < 15) {
if (timeSeries1!.length > value.toInt()) {
return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == 0) return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}';
if (value.toInt() == timeSeries1!.length - 1) return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
return '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}';
}
}
return '';
@ -176,7 +176,7 @@ class CurvedChartBloodPressure extends StatelessWidget {
),
),
minX: 0,
maxX: (timeSeries1.length - 1).toDouble(),
maxX: (timeSeries1!.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: getMinY(),
lineBarsData: getData(context),
@ -185,11 +185,11 @@ class CurvedChartBloodPressure extends StatelessWidget {
double getMaxY() {
double max = 0;
timeSeries1.forEach((element) {
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
timeSeries2.forEach((element) {
timeSeries2!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
@ -198,12 +198,12 @@ class CurvedChartBloodPressure extends StatelessWidget {
}
double getMinY() {
double min = timeSeries1[0].sales;
timeSeries1.forEach((element) {
double min = timeSeries1![0].sales;
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
timeSeries2.forEach((element) {
timeSeries2!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
@ -215,13 +215,13 @@ class CurvedChartBloodPressure extends StatelessWidget {
List<LineChartBarData> getData(context) {
List<FlSpot> spots =[];
for (int index = 0; index < timeSeries1.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
for (int index = 0; index < timeSeries1!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales));
}
List<FlSpot> spots2 =[];
for (int index = 0; index < timeSeries2.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
for (int index = 0; index < timeSeries2!.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(

@ -5,10 +5,10 @@ import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class LineChartCurved extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries;
final int indexes;
final double horizontalInterval;
final String? title;
final List<TimeSeriesSales2>? timeSeries;
final int? indexes;
final double? horizontalInterval;
LineChartCurved({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 20.0});
@ -35,7 +35,7 @@ class LineChartCurved extends StatelessWidget {
height: 4,
),
Text(
title,
title!,
style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
@ -63,20 +63,20 @@ class LineChartCurved extends StatelessWidget {
}
getXaxix() {
for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries.length) {
for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexes! * index;
if (mIndex < timeSeries!.length) {
xAxixs.add(mIndex);
}
}
}
getYaxix() {
int indexess = (timeSeries.length * 0.30).toInt();
for (int index = 0; index < timeSeries.length; index++) {
int indexess = (timeSeries!.length * 0.30).toInt();
for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexess * index;
if (mIndex < timeSeries.length) {
yAxixs.add(timeSeries[mIndex].sales);
if (mIndex < timeSeries!.length) {
yAxixs.add(timeSeries![mIndex].sales);
}
}
}
@ -163,7 +163,7 @@ class LineChartCurved extends StatelessWidget {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
touchCallback: (touchEvent, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
@ -177,16 +177,16 @@ class LineChartCurved extends StatelessWidget {
rotateAngle: -65,
margin: 22,
getTitles: (value) {
if (timeSeries.length < 15) {
if (timeSeries.length > value.toInt()) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (timeSeries!.length < 15) {
if (timeSeries!.length > value.toInt()) {
return '${timeSeries![value.toInt()].time.month}/ ${timeSeries![value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
if (value.toInt() == 0) return '${timeSeries![value.toInt()].time.month}/ ${timeSeries![value.toInt()].time.year}';
if (value.toInt() == timeSeries!.length - 1) return '${timeSeries![value.toInt()].time.month}/ ${timeSeries![value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}';
return '${timeSeries![value.toInt()].time.month}/ ${timeSeries![value.toInt()].time.year}';
}
}
return '';
@ -231,7 +231,7 @@ class LineChartCurved extends StatelessWidget {
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxX: (timeSeries!.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: 0,
//getMinY(),
@ -240,7 +240,7 @@ class LineChartCurved extends StatelessWidget {
}
double getMaxY() {
double max = 0;
timeSeries.forEach((element) {
timeSeries!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
@ -249,8 +249,8 @@ class LineChartCurved extends StatelessWidget {
}
double getMinY() {
double min = timeSeries.isEmpty ? 0 : timeSeries.first.sales;
timeSeries.forEach((element) {
double min = timeSeries!.isEmpty ? 0 : timeSeries!.first.sales;
timeSeries!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
@ -261,14 +261,14 @@ class LineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) {
List<FlSpot> spots =[];
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
for (int index = 0; index < timeSeries!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries![index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [secondaryColor],
colors: [secondaryColor!],
barWidth: 1.5,
isStrokeCapRound: true,
dotData: FlDotData(

@ -6,16 +6,16 @@ import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class MonthCurvedChartBloodPressure extends StatelessWidget {
final String title;
final List<TimeSeriesSales3> timeSeries1;
final List<TimeSeriesSales3> timeSeries2;
final int indexes;
final double horizontalInterval;
final String? title;
final List<TimeSeriesSales3>? timeSeries1;
final List<TimeSeriesSales3>? timeSeries2;
final int? indexes;
final double? horizontalInterval;
MonthCurvedChartBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.horizontalInterval = 20.0});
List<int> xAxixs =[];
List<double> yAxixs =[];
List<int> xAxixs = [];
List<double> yAxixs = [];
@override
Widget build(BuildContext context) {
@ -36,7 +36,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
height: 15,
),
Text(
title,
title!,
style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center,
),
@ -99,9 +99,9 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
}
getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries1.length) {
for (int index = 0; index < timeSeries1!.length; index++) {
int mIndex = indexes! * index;
if (mIndex < timeSeries1!.length) {
xAxixs.add(mIndex);
}
}
@ -113,7 +113,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
touchCallback: (touchEvent, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14),
@ -126,7 +126,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
),
margin: 22,
getTitles: (value) {
return timeSeries1[value.toInt()].time;
return timeSeries1![value.toInt()].time;
// return '';
},
),
@ -173,7 +173,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
),
),
minX: 0,
maxX: (timeSeries1.length - 1).toDouble(),
maxX: (timeSeries1!.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: getMinY(),
lineBarsData: getData(context),
@ -182,11 +182,11 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
double getMaxY() {
double max = 0;
timeSeries1.forEach((element) {
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
timeSeries2.forEach((element) {
timeSeries2!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
@ -195,12 +195,12 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
}
double getMinY() {
double min = timeSeries1[0].sales;
timeSeries1.forEach((element) {
double min = timeSeries1![0].sales;
timeSeries1!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
timeSeries2.forEach((element) {
timeSeries2!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
@ -211,14 +211,14 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
}
List<LineChartBarData> getData(context) {
List<FlSpot> spots =[];
for (int index = 0; index < timeSeries1.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
List<FlSpot> spots = [];
for (int index = 0; index < timeSeries1!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales));
}
List<FlSpot> spots2 =[];
for (int index = 0; index < timeSeries2.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
List<FlSpot> spots2 = [];
for (int index = 0; index < timeSeries2!.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(

@ -5,10 +5,10 @@ import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class MonthLineChartCurved extends StatelessWidget {
final String title;
final List<TimeSeriesSales3> timeSeries;
final int indexes;
final double horizontalInterval;
final String? title;
final List<TimeSeriesSales3>? timeSeries;
final int? indexes;
final double? horizontalInterval;
MonthLineChartCurved({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 15.0});
@ -35,7 +35,7 @@ class MonthLineChartCurved extends StatelessWidget {
height: 4,
),
Text(
title,
title!,
style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600),
textAlign: TextAlign.center,
),
@ -63,20 +63,20 @@ class MonthLineChartCurved extends StatelessWidget {
}
getXaxix() {
for (int index = 0; index < timeSeries.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries.length) {
for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexes! * index;
if (mIndex < timeSeries!.length) {
xAxixs.add(mIndex);
}
}
}
getYaxix() {
int indexess = (timeSeries.length * 0.30).toInt();
for (int index = 0; index < timeSeries.length; index++) {
int indexess = (timeSeries!.length * 0.30).toInt();
for (int index = 0; index < timeSeries!.length; index++) {
int mIndex = indexess * index;
if (mIndex < timeSeries.length) {
yAxixs.add(timeSeries[mIndex].sales);
if (mIndex < timeSeries!.length) {
yAxixs.add(timeSeries![mIndex].sales);
}
}
}
@ -87,7 +87,7 @@ class MonthLineChartCurved extends StatelessWidget {
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (touchEvent, LineTouchResponse touchResponse) {},
touchCallback: (touchEvent, LineTouchResponse? touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
@ -152,7 +152,7 @@ class MonthLineChartCurved extends StatelessWidget {
),
),
minX: 0,
maxX: (timeSeries.length - 1).toDouble(),
maxX: (timeSeries!.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: getMinY(),
lineBarsData: getData(context),
@ -161,7 +161,7 @@ class MonthLineChartCurved extends StatelessWidget {
double getMaxY() {
double max = 0;
timeSeries.forEach((element) {
timeSeries!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
@ -170,8 +170,8 @@ class MonthLineChartCurved extends StatelessWidget {
}
double getMinY() {
double min = timeSeries[0].sales;
timeSeries.forEach((element) {
double min = timeSeries![0].sales;
timeSeries!.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
@ -182,17 +182,17 @@ class MonthLineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) {
List<FlSpot> spots =[];
if (timeSeries.length == 0) {
if (timeSeries!.length == 0) {
spots.add(FlSpot(0, 0));
}
for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
for (int index = 0; index < timeSeries!.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries![index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [secondaryColor],
colors: [secondaryColor!],
barWidth: 1.5,
isStrokeCapRound: true,
curveSmoothness: 0.0,

@ -5,10 +5,10 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class TabBarWidget extends StatelessWidget with PreferredSizeWidget{
class TabBarWidget extends StatelessWidget {
final TabController tabController;
const TabBarWidget({Key key, this.tabController}) : super(key: key);
const TabBarWidget({Key? key, required this.tabController}) : super(key: key);
@override
Widget build(BuildContext context) {

@ -33,21 +33,21 @@ import 'PrescriptionOrderOverveiw.dart';
class PrescriptionDeliveryAddressPage extends StatefulWidget {
final Prescriptions prescriptions;
final List<PrescriptionReport> prescriptionReportList;
final List<PrescriptionReportEnh> prescriptionReportEnhList;
final List<PrescriptionReport>? prescriptionReportList;
final List<PrescriptionReportEnh>? prescriptionReportEnhList;
const PrescriptionDeliveryAddressPage({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList}) : super(key: key);
const PrescriptionDeliveryAddressPage({Key? key, required this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList}) : super(key: key);
@override
_PrescriptionDeliveryAddressPageState createState() => _PrescriptionDeliveryAddressPageState();
}
class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAddressPage> {
AddressInfo _selectedAddress;
late AddressInfo _selectedAddress;
int _selectedAddressIndex = -1;
Completer<GoogleMapController> _controller = Completer();
ProjectViewModel projectViewModel;
LocationUtils locationUtils;
late ProjectViewModel projectViewModel;
late LocationUtils locationUtils;
CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(24.665011045779107, 46.73502189439707),
@ -132,7 +132,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
children: [
CommonDropDownView(TranslationBase.of(context).selectAddress, getAddressName(), () {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < model.addressesList.length; i++) RadioSelectionDialogModel(model.addressesList[i].address1, i),
for (int i = 0; i < model.addressesList.length; i++) RadioSelectionDialogModel(model.addressesList[i].address1!, i),
];
showDialog(
@ -144,7 +144,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
onValueSelected: (index) {
_selectedAddressIndex = index;
_selectedAddress = model.addressesList[index];
List latLongArr = _selectedAddress.latLong.split(',');
List latLongArr = _selectedAddress.latLong!.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
@ -181,26 +181,26 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
if (value != null && value is AddNewAddressRequestModel) {
setState(() {
_selectedAddress = AddressInfo(
id: value.customer.id.toString(),
email: value.customer.email,
firstName: value.customer.addresses[0].firstName,
lastName: value.customer.addresses[0].lastName,
address1: value.customer.addresses[0].address1,
address2: value.customer.addresses[0].address2,
city: value.customer.addresses[0].city,
country: value.customer.addresses[0].country,
phoneNumber: value.customer.addresses[0].phoneNumber,
latLong: value.customer.addresses[0].latLong,
company: value.customer.addresses[0].company,
countryId: value.customer.addresses[0].countryId,
createdOnUtc: value.customer.addresses[0].createdOnUtc,
customerAttributes: value.customer.addresses[0].customerAttributes,
faxNumber: value.customer.addresses[0].faxNumber,
province: value.customer.addresses[0].province,
stateProvinceId: value.customer.addresses[0].stateProvinceId,
zipPostalCode: value.customer.addresses[0].zipPostalCode,
id: value.customer!.id.toString(),
email: value.customer!.email,
firstName: value.customer!.addresses![0].firstName,
lastName: value.customer!.addresses![0].lastName,
address1: value.customer!.addresses![0].address1,
address2: value.customer!.addresses![0].address2,
city: value.customer!.addresses![0].city,
country: value.customer!.addresses![0].country,
phoneNumber: value.customer!.addresses![0].phoneNumber,
latLong: value.customer!.addresses![0].latLong,
company: value.customer!.addresses![0].company,
countryId: value.customer!.addresses![0].countryId,
createdOnUtc: value.customer!.addresses![0].createdOnUtc,
customerAttributes: value.customer!.addresses![0].customerAttributes,
faxNumber: value.customer!.addresses![0].faxNumber,
province: value.customer!.addresses![0].province,
stateProvinceId: value.customer!.addresses![0].stateProvinceId,
zipPostalCode: value.customer!.addresses![0].zipPostalCode,
);
List latLongArr = _selectedAddress.latLong.split(',');
List latLongArr = _selectedAddress.latLong!.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
@ -280,19 +280,19 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
),
SizedBox(height: 2),
Text(
'${model.user.firstName} ${model.user.lastName}',
'${model.user!.firstName} ${model.user!.lastName}',
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
Text(
_selectedAddress.address1,
_selectedAddress.address1!,
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
Text(
_selectedAddress.address2,
_selectedAddress.address2!,
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
Text(
_selectedAddress.city + " " + _selectedAddress.country,
_selectedAddress.city! + " " + _selectedAddress.country!,
style: TextStyle(fontSize: 12, color: Color(0xff2B353E), fontWeight: FontWeight.w600, letterSpacing: -0.48),
),
],
@ -313,8 +313,8 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
page: PrescriptionOrderOverview(
latitude: latitude,
longitude: longitude,
prescriptionReportEnhList: widget.prescriptionReportEnhList,
prescriptionReportList: widget.prescriptionReportList,
prescriptionReportEnhList: widget.prescriptionReportEnhList!,
prescriptionReportList: widget.prescriptionReportList!,
prescriptions: widget.prescriptions,
selectedAddress: _selectedAddress,
),
@ -341,7 +341,7 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
onValueSelected: (value) {
setState(() {
_selectedAddress = value;
List latLongArr = value.latLong.split(',');
List latLongArr = value.latLong!.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
@ -365,6 +365,6 @@ class _PrescriptionDeliveryAddressPageState extends State<PrescriptionDeliveryAd
}
String getAddressName() {
return _selectedAddress?.address1 ?? "";
return _selectedAddress.address1 ?? "";
}
}

@ -18,13 +18,13 @@ import 'package:flutter/material.dart';
class PrescriptionOrderOverview extends StatelessWidget {
final Prescriptions prescriptions;
final List<PrescriptionReport> prescriptionReportList;
final List<PrescriptionReportEnh> prescriptionReportEnhList;
final AddressInfo selectedAddress;
final double latitude;
final double longitude;
final List<PrescriptionReport>? prescriptionReportList;
final List<PrescriptionReportEnh>? prescriptionReportEnhList;
final AddressInfo? selectedAddress;
final double? latitude;
final double? longitude;
PrescriptionOrderOverview({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList, this.selectedAddress, this.latitude, this.longitude});
PrescriptionOrderOverview({Key? key, required this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList, this.selectedAddress, this.latitude, this.longitude});
@override
Widget build(BuildContext context) {
@ -43,7 +43,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
Expanded(
child: Column(
children: [
if (!prescriptions.isInOutPatient)
if (!prescriptions.isInOutPatient!)
Container(
margin: EdgeInsets.all(12),
decoration: cardRadius(12),
@ -53,7 +53,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
child: Column(
children: [
...List.generate(
prescriptionReportList.length,
prescriptionReportList!.length,
(index) => Container(
margin: EdgeInsets.all(0.0),
decoration: cardRadius(0),
@ -62,7 +62,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReportList[index].imageSRCUrl,
prescriptionReportList![index].imageSRCUrl!,
fit: BoxFit.cover,
width: 60,
height: 70,
@ -76,10 +76,10 @@ class PrescriptionOrderOverview extends StatelessWidget {
padding: const EdgeInsets.all(8.0),
child: Center(
child: Text(
prescriptionReportList[index].itemDescription.isNotEmpty
? prescriptionReportList[index].itemDescription
: prescriptionReportList[index].itemDescriptionN,
style: TextStyle(fontFamily: prescriptionReportList[index].itemDescription.isNotEmpty ? 'Poppins' : 'Cairo'))),
prescriptionReportList![index].itemDescription!.isNotEmpty
? prescriptionReportList![index].itemDescription!
: prescriptionReportList![index].itemDescriptionN!,
style: TextStyle(fontFamily: prescriptionReportList![index].itemDescription!.isNotEmpty ? 'Poppins' : 'Cairo'))),
)),
],
),
@ -99,7 +99,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
prescriptionReportEnhList.length,
prescriptionReportEnhList!.length,
(index) => Container(
margin: EdgeInsets.all(0.0),
// decoration: cardRadius(0),
@ -149,11 +149,11 @@ class PrescriptionOrderOverview extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
(prescriptionReportList[index].itemDescription.isNotEmpty
? prescriptionReportList[index].itemDescription
: prescriptionReportList[index].itemDescriptionN ?? ''),
(prescriptionReportList![index].itemDescription!.isNotEmpty
? prescriptionReportList![index].itemDescription!
: prescriptionReportList![index].itemDescriptionN! ?? ''),
style: TextStyle(
fontFamily: prescriptionReportList[index].itemDescription.isNotEmpty ? 'Poppins' : 'Cairo',
fontFamily: prescriptionReportList![index].itemDescription!.isNotEmpty ? 'Poppins' : 'Cairo',
letterSpacing: -0.64,
color: Color(0xff2E303A),
fontSize: 16.0,
@ -197,7 +197,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo,
projectID: prescriptions.projectID,
createdBy: model.user.patientID)
createdBy: model.user!.patientID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)

@ -11,9 +11,9 @@ import 'package:flutter/material.dart';
class PharmacyForPrescriptionsPage extends StatelessWidget {
final itemID;
final PrescriptionReport prescriptionReport;
final PrescriptionReport? prescriptionReport;
PharmacyForPrescriptionsPage({Key key, this.itemID, this.prescriptionReport});
PharmacyForPrescriptionsPage({Key? key, this.itemID, this.prescriptionReport});
@override
Widget build(BuildContext context) {

@ -24,10 +24,10 @@ import 'package:jiffy/jiffy.dart';
import 'package:provider/provider.dart';
class PrescriptionDetailsPageINP extends StatelessWidget {
final PrescriptionReportINP prescriptionReport;
final PrescriptionReportINP? prescriptionReport;
final Prescriptions prescriptions;
PrescriptionDetailsPageINP({Key key, this.prescriptionReport, this.prescriptions});
PrescriptionDetailsPageINP({Key? key, this.prescriptionReport, required this.prescriptions});
@override
Widget build(BuildContext context) {
@ -42,15 +42,15 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
children: <Widget>[
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
prescriptions.doctorName!,
prescriptions.doctorID!,
prescriptions.doctorImageURL!,
prescriptions.speciality!,
"",
prescriptions.name,
DateUtil.convertStringToDate(prescriptions.appointmentDate),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
prescriptions.nationalityFlagURL,
prescriptions.name!,
DateUtil.convertStringToDate(prescriptions.appointmentDate!),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate!)),
prescriptions.nationalityFlagURL!,
prescriptions.doctorRate,
prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate,
@ -89,7 +89,7 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
children: [
Container(
child: Image.network(
prescriptionReport.imageSRCUrl,
prescriptionReport!.imageSRCUrl!,
fit: BoxFit.cover,
width: 48,
height: 49,
@ -110,13 +110,13 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
],
),
onTap: () {
showZoomImageDialog(context, prescriptionReport.imageSRCUrl);
showZoomImageDialog(context, prescriptionReport!.imageSRCUrl!);
},
),
SizedBox(width: 12),
Expanded(
child: Text(
(prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? '').toLowerCase().capitalizeFirstofEach,
(prescriptionReport!.itemDescription!.isNotEmpty ? prescriptionReport!.itemDescription : prescriptionReport!.itemDescriptionN ?? '')!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
),
)
@ -146,7 +146,7 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48),
),
Text(
prescriptionReport.remarks,
prescriptionReport!.remarks!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
],
@ -169,8 +169,8 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: prescriptionReport.itemID,
prescriptionReport: PrescriptionReport.fromJson(prescriptionReport.toJson()),
itemID: prescriptionReport!.itemID,
prescriptionReport: PrescriptionReport.fromJson(prescriptionReport!.toJson()),
),
),
);
@ -185,22 +185,22 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
TranslationBase.of(context).addReminder,
() {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days);
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport!.days!);
showReminderDialog(
context,
endDate,
"",
prescriptionReport.itemID.toString(),
prescriptionReport!.itemID.toString(),
"",
"",
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
title: "${prescriptionReport!.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport!.itemDescriptionN} ${prescriptionReport!.frequencyN} ${prescriptionReport!.routeN} ",
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
},
onMultiDateSuccess: (int selectedIndex) {
setCalender(context, prescriptionReport.itemID.toString(), selectedIndex);
setCalender(context, prescriptionReport!.itemID.toString(), selectedIndex);
},
);
return;
@ -221,18 +221,19 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
setCalender(BuildContext context, String eventId, int reminderIndex) async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
int frequencyNumber = int.parse(prescriptionReport?.frequency);
int frequencyNumber = int.parse(prescriptionReport!.frequency!);
DateTime actualDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 0); //Time will start at 8:00 AM from starting date
if (frequencyNumber == null) frequencyNumber = 1; //Some time frequency number is null so by default will be 2
int remainingDays = prescriptionReport.days - (Jiffy(DateTime.now()).diff(DateUtil.convertStringToDate(prescriptionReport.orderDate), Units.DAY));
int remainingDays =
prescriptionReport!.days! - (Jiffy.parseFromDateTime(DateTime.now()).diff(Jiffy.parseFromDateTime(DateUtil.convertStringToDate(prescriptionReport!.orderDate!)), unit: Unit.day).toInt());
GifLoaderDialogUtils.showMyDialog(context);
for (int i = 0; i < remainingDays; i++) {
//event for number of days.
for (int j = 0; j < frequencyNumber ?? 1; j++) {
for (int j = 0; j < frequencyNumber; j++) {
// event for number of times per day.
if (j != 0) {
actualDate.add(new Duration(hours: 8)); // 8 hours addition for daily dose.
@ -240,32 +241,32 @@ class PrescriptionDetailsPageINP extends StatelessWidget {
//Time subtraction from actual reminder time. like before 30, or 1 hour.
if (reminderIndex == 0) {
// Before 30 mints
actualDate = Jiffy(actualDate).subtract(minutes: 30).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(minutes: 30).dateTime;
// dateTime.add(new Duration(minutes: -30));
} else if (reminderIndex == 1) {
// Before 1 hour
// dateTime.add(new Duration(minutes: -60));
actualDate = Jiffy(actualDate).subtract(hours: 1).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(hours: 1).dateTime;
} else if (reminderIndex == 2) {
// Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90));
actualDate = Jiffy(actualDate).subtract(hours: 1, minutes: 30).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(hours: 1, minutes: 30).dateTime;
} else if (reminderIndex == 3) {
// Before 2 hours
// dateTime.add(new Duration(minutes: -120));
actualDate = Jiffy(actualDate).subtract(hours: 2).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(hours: 2).dateTime;
}
calendarUtils
.createOrUpdateEvent(
title: "${prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
title: "${prescriptionReport!.itemDescriptionN} Prescription Reminder",
description: "${prescriptionReport!.itemDescriptionN} ${prescriptionReport!.frequencyN} ${prescriptionReport!.routeN} ",
scheduleDateTime: actualDate,
eventId: eventId + (i.toString() + j.toString()), //event id with varitions
)
.then((value) {});
actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0);
}
actualDate = Jiffy(actualDate).add(days: 1).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).add(days: 1).dateTime;
print(actualDate);
}
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);

@ -27,10 +27,10 @@ import 'package:jiffy/jiffy.dart';
import 'package:provider/provider.dart';
class PrescriptionDetailsPage extends StatefulWidget {
final PrescriptionReport prescriptionReport;
final PrescriptionReport? prescriptionReport;
final Prescriptions prescriptions;
PrescriptionDetailsPage({Key key, this.prescriptionReport, this.prescriptions});
PrescriptionDetailsPage({Key? key, this.prescriptionReport, required this.prescriptions});
@override
_PrescriptionDetailsPageState createState() => _PrescriptionDetailsPageState();
@ -38,7 +38,7 @@ class PrescriptionDetailsPage extends StatefulWidget {
class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
bool hasReminder = false;
LocationUtils locationUtils;
late LocationUtils locationUtils;
@override
void initState() {
@ -61,15 +61,15 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
children: <Widget>[
DoctorHeader(
headerModel: HeaderModel(
widget.prescriptions.doctorName,
widget.prescriptions.doctorID,
widget.prescriptions.doctorImageURL,
widget.prescriptions.speciality,
widget.prescriptions.doctorName!,
widget.prescriptions.doctorID!,
widget.prescriptions.doctorImageURL!,
widget.prescriptions.speciality!,
"",
widget.prescriptions.name,
DateUtil.convertStringToDate(widget.prescriptions.appointmentDate),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.prescriptions.appointmentDate)),
widget.prescriptions.nationalityFlagURL,
widget.prescriptions.name!,
DateUtil.convertStringToDate(widget.prescriptions.appointmentDate!),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.prescriptions.appointmentDate!)),
widget.prescriptions.nationalityFlagURL!,
widget.prescriptions.doctorRate,
widget.prescriptions.actualDoctorRate,
widget.prescriptions.noOfPatientsRate,
@ -135,7 +135,7 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
// SizedBox(width: 12),
Expanded(
child: Text(
(widget.prescriptionReport.itemDescription.isNotEmpty ? widget.prescriptionReport.itemDescription : widget.prescriptionReport.itemDescriptionN ?? '')
(widget.prescriptionReport!.itemDescription!.isNotEmpty ? widget.prescriptionReport!.itemDescription : widget.prescriptionReport!.itemDescriptionN ?? '')!
.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
@ -167,7 +167,7 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48),
),
Text(
widget.prescriptionReport.remarks,
widget.prescriptionReport!.remarks!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
],
@ -190,7 +190,7 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: widget.prescriptionReport.itemID,
itemID: widget.prescriptionReport!.itemID,
prescriptionReport: widget.prescriptionReport,
),
),
@ -209,21 +209,21 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
cancelReminders();
} else {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + widget.prescriptionReport.days);
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + widget.prescriptionReport!.days!);
showReminderDialog(
context,
endDate,
"",
widget.prescriptionReport.itemID.toString(),
widget.prescriptionReport!.itemID.toString(),
"",
"",
title: "${widget.prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${widget.prescriptionReport.itemDescriptionN} ${widget.prescriptionReport.frequencyN} ${widget.prescriptionReport.routeN} ",
title: "${widget.prescriptionReport!.itemDescriptionN} Prescription Reminder",
description: "${widget.prescriptionReport!.itemDescriptionN} ${widget.prescriptionReport!.frequencyN} ${widget.prescriptionReport!.routeN} ",
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
},
onMultiDateSuccess: (int selectedIndex) {
setCalender(context, widget.prescriptionReport.itemID.toString(), selectedIndex);
setCalender(context, widget.prescriptionReport!.itemID.toString(), selectedIndex);
},
);
return;
@ -246,16 +246,16 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
checkIfHasReminder() async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30).dateTime;
DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120).dateTime;
DateTime startEventsDate = Jiffy.parseFromDateTime(DateTime.now()).subtract(days: 30).dateTime;
DateTime endEventsDate = Jiffy.parseFromDateTime(DateTime.now()).add(days: 120).dateTime;
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
if(calendarUtils.calendars != null) {
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) {
if (calendarUtils.calendars != null) {
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id!, params).then((value) {
Result<UnmodifiableListView<Event>> events = value;
events.data.forEach((element) {
if (element.title.contains(widget.prescriptionReport.itemDescriptionN))
events.data!.forEach((element) {
if (element.title!.contains(widget.prescriptionReport!.itemDescriptionN!))
setState(() {
hasReminder = true;
});
@ -267,15 +267,15 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
cancelReminders() async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30).dateTime;
DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120).dateTime;
DateTime startEventsDate = Jiffy.parseFromDateTime(DateTime.now()).subtract(days: 30).dateTime;
DateTime endEventsDate = Jiffy.parseFromDateTime(DateTime.now()).add(days: 120).dateTime;
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) {
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id!, params).then((value) {
Result<UnmodifiableListView<Event>> events = value;
events.data.forEach((element) {
if (element.title.contains(widget.prescriptionReport.itemDescriptionN)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element);
events.data!.forEach((element) {
if (element.title!.contains(widget.prescriptionReport!.itemDescriptionN!)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element);
});
});
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderCancelSuccess);
@ -288,15 +288,16 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime actualDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 0); //Time will start at 8:00 AM from starting date
if (widget.prescriptionReport?.frequencyNumber == null) widget.prescriptionReport.frequencyNumber = 1; //Some time frequency number is null so by default will be 2
if (widget.prescriptionReport?.frequencyNumber == null) widget.prescriptionReport!.frequencyNumber = 1; //Some time frequency number is null so by default will be 2
int remainingDays = widget.prescriptionReport.days - (Jiffy(DateTime.now()).diff(DateUtil.convertStringToDate(widget.prescriptionReport.orderDate), Units.DAY));
int remainingDays = widget.prescriptionReport!.days! -
(Jiffy.parseFromDateTime(DateTime.now()).diff(Jiffy.parseFromDateTime(DateUtil.convertStringToDate(widget.prescriptionReport!.orderDate!)), unit: Unit.day) as int);
GifLoaderDialogUtils.showMyDialog(context);
for (int i = 0; i < remainingDays; i++) {
//event for number of days.
for (int j = 0; j < widget.prescriptionReport.frequencyNumber ?? 1; j++) {
for (int j = 0; j < widget.prescriptionReport!.frequencyNumber!; j++) {
// event for number of times per day.
if (j != 0) {
actualDate.add(new Duration(hours: 8)); // 8 hours addition for daily dose.
@ -304,32 +305,32 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
//Time subtraction from actual reminder time. like before 30, or 1 hour.
if (reminderIndex == 0) {
// Before 30 mints
actualDate = Jiffy(actualDate).subtract(minutes: 30).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(minutes: 30).dateTime;
// dateTime.add(new Duration(minutes: -30));
} else if (reminderIndex == 1) {
// Before 1 hour
// dateTime.add(new Duration(minutes: -60));
actualDate = Jiffy(actualDate).subtract(hours: 1).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(hours: 1).dateTime;
} else if (reminderIndex == 2) {
// Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90));
actualDate = Jiffy(actualDate).subtract(hours: 1, minutes: 30).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(hours: 1, minutes: 30).dateTime;
} else if (reminderIndex == 3) {
// Before 2 hours
// dateTime.add(new Duration(minutes: -120));
actualDate = Jiffy(actualDate).subtract(hours: 2).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).subtract(hours: 2).dateTime;
}
calendarUtils
.createOrUpdateEvent(
title: "${widget.prescriptionReport.itemDescriptionN} Prescription Reminder",
description: "${widget.prescriptionReport.itemDescriptionN} ${widget.prescriptionReport.frequencyN} ${widget.prescriptionReport.routeN} ",
title: "${widget.prescriptionReport!.itemDescriptionN} Prescription Reminder",
description: "${widget.prescriptionReport!.itemDescriptionN} ${widget.prescriptionReport!.frequencyN} ${widget.prescriptionReport!.routeN} ",
scheduleDateTime: actualDate,
eventId: eventId + (i.toString() + j.toString()), //event id with varitions
)
.then((value) {});
actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0);
}
actualDate = Jiffy(actualDate).add(days: 1).dateTime;
actualDate = Jiffy.parseFromDateTime(actualDate).add(days: 1).dateTime;
print(actualDate);
}
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);

@ -27,9 +27,9 @@ import 'PrescriptionIDeliveryAddressPage.dart';
class PrescriptionItemsPage extends StatelessWidget {
final Prescriptions prescriptions;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
PrescriptionItemsPage({Key key, this.prescriptions});
PrescriptionItemsPage({ Key? key, required this.prescriptions});
@override
Widget build(BuildContext context) {
@ -38,7 +38,7 @@ class PrescriptionItemsPage extends StatelessWidget {
onModelReady: (model) => model.getPrescriptionReport(prescriptions: prescriptions),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: prescriptions.doctorName,
appBarTitle: prescriptions.doctorName!,
baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
@ -51,19 +51,19 @@ class PrescriptionItemsPage extends StatelessWidget {
children: [
DoctorHeader(
headerModel: HeaderModel(
prescriptions.doctorName,
prescriptions.doctorID,
prescriptions.doctorImageURL,
prescriptions.speciality,
prescriptions.doctorName!,
prescriptions.doctorID!,
prescriptions.doctorImageURL!,
prescriptions.speciality!,
"",
prescriptions.name,
DateUtil.convertStringToDate(prescriptions.appointmentDate),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.prescriptionReportEnhList.length > 0 ? model.prescriptionReportEnhList[0].orderDate : model.prescriptionReportListINP[0].orderDate)),
prescriptions.nationalityFlagURL,
prescriptions.name!,
DateUtil.convertStringToDate(prescriptions.appointmentDate!),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.prescriptionReportEnhList.length > 0 ? model.prescriptionReportEnhList[0].orderDate! : model!.prescriptionReportListINP![0].orderDate!)),
prescriptions.nationalityFlagURL!,
prescriptions.doctorRate,
prescriptions.actualDoctorRate,
prescriptions.noOfPatientsRate,
projectViewModel.user.emailAddress,
projectViewModel.user!.emailAddress!,
),
isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false,
showConfirmMessageDialog: false,
@ -71,7 +71,7 @@ class PrescriptionItemsPage extends StatelessWidget {
showConfirmMessage(context, model);
},
),
if (!prescriptions.isInOutPatient)
if (!prescriptions.isInOutPatient!)
model.prescriptionReportListINP.length > 0
? ListView.separated(
itemBuilder: (context, index) {
@ -101,8 +101,8 @@ class PrescriptionItemsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.prescriptionReportListINP[index].itemDescription.isNotEmpty
? model.prescriptionReportListINP[index].itemDescription
model.prescriptionReportListINP[index].itemDescription!.isNotEmpty
? model.prescriptionReportListINP[index].itemDescription!
: model.prescriptionReportListINP[index].itemDescriptionN ?? '',
style: TextStyle(
fontSize: 16,
@ -162,7 +162,7 @@ class PrescriptionItemsPage extends StatelessWidget {
),
),
Text(
model.prescriptionReportListINP[index].route,
model.prescriptionReportListINP[index].route!,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
@ -194,7 +194,7 @@ class PrescriptionItemsPage extends StatelessWidget {
),
mHeight(12),
Text(
model.prescriptionReportListINP[index].remarks,
model.prescriptionReportListINP[index].remarks!,
style: TextStyle(
color: Colors.grey,
fontSize: 10,
@ -283,10 +283,10 @@ class PrescriptionItemsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
(model.prescriptionReportEnhList[index].itemDescription.isNotEmpty
(model.prescriptionReportEnhList[index].itemDescription!.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '')
.toLowerCase()
!.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle(
fontSize: 16,
@ -337,12 +337,12 @@ class PrescriptionItemsPage extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
MyRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).route + ": ", model.prescriptionReportEnhList[index].route!, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).dailyDoses + ": ", model.prescriptionReportEnhList[index].doseDailyQuantity.toString(),
projectViewModel.isArabic),
mHeight(9),
Text(
model.prescriptionReportEnhList[index].remarks,
model.prescriptionReportEnhList[index].remarks!,
style: TextStyle(
color: Color(0xff575757),
fontSize: 12,
@ -417,16 +417,16 @@ class PrescriptionItemsPage extends StatelessWidget {
showDialog(
context: context,
builder: (cxt) => ConfirmSendEmailDialog(
email: projectViewModel.user.emailAddress,
email: projectViewModel.user!.emailAddress!,
onTapSendEmail: () {
model.sendPrescriptionEmail(
appointmentDate: prescriptions.appointmentDate,
patientID: prescriptions.patientID,
clinicName: prescriptions.companyName,
doctorName: prescriptions.doctorName,
doctorID: prescriptions.doctorID,
appointmentDate: prescriptions.appointmentDate!,
patientID: prescriptions.patientID!,
clinicName: prescriptions.companyName!,
doctorName: prescriptions.doctorName!,
doctorID: prescriptions.doctorID!,
mes: TranslationBase.of(context).sendSuc,
projectID: prescriptions.projectID);
projectID: prescriptions.projectID!);
},
),
);

@ -15,17 +15,17 @@ import 'package:provider/provider.dart';
class PrescriptionsHistoryDetailsPage extends StatelessWidget {
final GetCMCAllOrdersResponseModel prescriptionsOrder;
PrescriptionsHistoryDetailsPage({Key key, this.prescriptionsOrder});
PrescriptionsHistoryDetailsPage({Key? key, required this.prescriptionsOrder});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptionReportDetailsRC(prescriptionsOrder.iD, projectViewModel.user.patientID),
onModelReady: (model) => model.getPrescriptionReportDetailsRC(prescriptionsOrder.iD!, projectViewModel.user!.patientID),
builder: (_, model, widget) {
int status = prescriptionsOrder.statusId;
String _statusDisp = prescriptionsOrder.statusText;
Color _color;
int status = prescriptionsOrder.statusId!;
String _statusDisp = prescriptionsOrder.statusText!;
late Color _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -108,7 +108,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(prescriptionsOrder.created)),
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(prescriptionsOrder.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
],
@ -129,7 +129,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)),
child: Image.network(
model.prescriptionsOrderListRC[index].image,
model.prescriptionsOrderListRC[index].image!,
fit: BoxFit.cover,
width: 48,
height: 48,
@ -139,9 +139,9 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
SizedBox(width: 14),
Expanded(
child: Text(
(model.prescriptionsOrderListRC[index].itemDescription.isNotEmpty
(model.prescriptionsOrderListRC[index].itemDescription!.isNotEmpty
? model.prescriptionsOrderListRC[index].itemDescription
: model.prescriptionsOrderListRC[index].itemDescription ?? '')
: model.prescriptionsOrderListRC[index].itemDescription ?? '')!
.toLowerCase()
.capitalizeFirstofEach,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
@ -166,9 +166,9 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
// prescriptionsOrder.statusId != 1
// ? null
// :
() {
showCDialog(model, context);
},
() {
showCDialog(model, context);
},
disabledColor: Color(0xff575757),
),
),
@ -187,7 +187,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
cancelText: TranslationBase.of(context).cancel,
okFunction: () async {
Navigator.of(context).pop();
await model.updatePressOrder(presOrderID: prescriptionsOrder.iD);
await model.updatePressOrder(presOrderID: prescriptionsOrder.iD!);
Navigator.of(context).pop(true);
},
cancelFunction: () => {}).showAlertDialog(context);

@ -13,10 +13,10 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionsHistoryPage extends StatelessWidget {
final VoidCallback showOrderLog;
final PrescriptionsViewModel prescriptionsViewModel;
final VoidCallback? showOrderLog;
final PrescriptionsViewModel? prescriptionsViewModel;
PrescriptionsHistoryPage({Key key, this.prescriptionsViewModel, this.showOrderLog});
PrescriptionsHistoryPage({Key? key, this.prescriptionsViewModel, this.showOrderLog});
@override
Widget build(BuildContext context) {
@ -27,7 +27,7 @@ class PrescriptionsHistoryPage extends StatelessWidget {
builder: (_, model, widget) => AppScaffold(
baseViewModel: prescriptionsViewModel,
body: model.state != ViewState.Busy
? prescriptionsViewModel.prescriptionsHistory.length > 0
? prescriptionsViewModel!.prescriptionsHistory.length > 0
? ListView.separated(
physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(21),
@ -35,9 +35,9 @@ class PrescriptionsHistoryPage extends StatelessWidget {
return SizedBox(height: 12);
},
itemBuilder: (context, index) {
int status = prescriptionsViewModel.prescriptionsHistory[index].statusId;
String _statusDisp = prescriptionsViewModel.prescriptionsHistory[index].statusText;
Color _color;
int status = prescriptionsViewModel!.prescriptionsHistory[index].statusId!;
String _statusDisp = prescriptionsViewModel!.prescriptionsHistory[index].statusText!;
late Color _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -58,12 +58,12 @@ class PrescriptionsHistoryPage extends StatelessWidget {
context,
FadePage(
page: PrescriptionsHistoryDetailsPage(
prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index],
prescriptionsOrder: prescriptionsViewModel!.prescriptionsHistory[index],
),
),
);
if (result != null) {
showOrderLog();
showOrderLog!();
}
},
child: Container(
@ -113,7 +113,7 @@ class PrescriptionsHistoryPage extends StatelessWidget {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
Text(
'${TranslationBase.of(context).orderNo}. ${prescriptionsViewModel.prescriptionsHistory[index].iD}',
'${TranslationBase.of(context).orderNo}. ${prescriptionsViewModel!.prescriptionsHistory[index].iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
],
@ -124,11 +124,11 @@ class PrescriptionsHistoryPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(prescriptionsViewModel.prescriptionsHistory[index].created)),
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(prescriptionsViewModel!.prescriptionsHistory[index].created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
Text(
DateUtil.formatDateToTimeLang(DateTime.tryParse(prescriptionsViewModel.prescriptionsHistory[index].created), false),
DateUtil.formatDateToTimeLang(DateTime.tryParse(prescriptionsViewModel!.prescriptionsHistory[index].created!)!, false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
],
@ -146,7 +146,7 @@ class PrescriptionsHistoryPage extends StatelessWidget {
),
));
},
itemCount: prescriptionsViewModel.prescriptionsHistory.length,
itemCount: prescriptionsViewModel!.prescriptionsHistory.length,
)
: getNoDataWidget(context)
: Container(),

@ -19,10 +19,10 @@ class HomePrescriptionsPage extends StatefulWidget {
}
class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
List<ImagesInfo> imagesInfo =[];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
void initState() {

@ -15,11 +15,11 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionsPage extends StatelessWidget {
final VoidCallback showOrderLog;
final VoidCallback? showOrderLog;
final FilterType filterType;
final PrescriptionsViewModel prescriptionsViewModel;
final PrescriptionsViewModel? prescriptionsViewModel;
const PrescriptionsPage(this.filterType, {Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
const PrescriptionsPage(this.filterType, {Key? key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -36,9 +36,9 @@ class PrescriptionsPage extends StatelessWidget {
);
},
itemBuilder: (context, index) {
List<Prescriptions> prescriptionsList = prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].prescriptionsList;
List<Prescriptions> prescriptionsList = prescriptionsViewModel!.prescriptionsOrderListByValue(filterType)[index].prescriptionsList!;
return AppExpandableNotifier(
title: prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].filterName,
title: prescriptionsViewModel!.prescriptionsOrderListByValue(filterType)[index].filterName,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
@ -58,25 +58,24 @@ class PrescriptionsPage extends StatelessWidget {
),
);
if (_shouldRecallApi != null) {
showOrderLog();
showOrderLog!();
}
},
name: prescriptions.doctorName,
profileUrl: prescriptions.doctorImageURL,
rating: prescriptions.actualDoctorRate.toDouble(),
rating: prescriptions.actualDoctorRate!.toDouble(),
subName: _isSortByClinic ? prescriptions.name : prescriptions.clinicDescription,
isSortByClinic: _isSortByClinic,
isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
date: DateUtil.convertStringToDate(prescriptions
.appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
date: DateUtil.convertStringToDate(prescriptions.appointmentDate!) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: prescriptionsList.length),
);
},
itemCount: prescriptionsViewModel.prescriptionsOrderListByValue(filterType).length,
itemCount: prescriptionsViewModel!.prescriptionsOrderListByValue(filterType).length,
));
}
}

@ -18,20 +18,20 @@ import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology;
bool isRadiologyVidaPlus;
final FinalRadiology? finalRadiology;
bool? isRadiologyVidaPlus;
RadiologyDetailsPage({Key key, this.finalRadiology, this.isRadiologyVidaPlus});
RadiologyDetailsPage({Key? key, this.finalRadiology, this.isRadiologyVidaPlus});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID)),
projectId: finalRadiology!.projectID!,
lineItem: finalRadiology!.invoiceLineItemNo!,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP : finalRadiology!.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!)),
builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).report,
isShowAppBar: true,
@ -46,22 +46,22 @@ class RadiologyDetailsPage extends StatelessWidget {
children: <Widget>[
DoctorHeader(
headerModel: new HeaderModel(
finalRadiology.doctorName,
finalRadiology.doctorID,
finalRadiology.doctorImageURL,
finalRadiology.speciality,
Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(),
finalRadiology.projectName,
finalRadiology.orderDate,
finalRadiology!.doctorName!,
finalRadiology!.doctorID!,
finalRadiology!.doctorImageURL!,
finalRadiology!.speciality!,
Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP.toString() : finalRadiology!.invoiceNo.toString(),
finalRadiology!.projectName!,
finalRadiology!.orderDate,
null,
finalRadiology.nationalityFlagURL,
finalRadiology.doctorRate,
finalRadiology.actualDoctorRate,
finalRadiology.noOfPatientsRate,
projectViewModel.user.emailAddress,
finalRadiology!.nationalityFlagURL!,
finalRadiology!.doctorRate,
finalRadiology!.actualDoctorRate,
finalRadiology!.noOfPatientsRate,
projectViewModel.user!.emailAddress!,
),
onTap: () {
showConfirmMessage(finalRadiology: finalRadiology, model: model, userObj: projectViewModel.user);
showConfirmMessage(finalRadiology: finalRadiology!, model: model, userObj: projectViewModel.user!);
},
buttonTitle: TranslationBase.of(context).sendCopyRad,
isNeedToShowButton: projectViewModel.havePrivilege(8),
@ -87,12 +87,12 @@ class RadiologyDetailsPage extends StatelessWidget {
),
mHeight(10),
Text(
'${finalRadiology.reportData}',
'${finalRadiology!.reportData}',
style: TextStyle(fontSize: 12, letterSpacing: -0.48),
),
mHeight(16),
(projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8))
? (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9))
? (finalRadiology!.dIAPACSURL != "" && projectViewModel.havePrivilege(9))
? Container(
child: DefaultButton(
TranslationBase.of(context).openRad,
@ -114,13 +114,13 @@ class RadiologyDetailsPage extends StatelessWidget {
);
}
void showConfirmMessage({FinalRadiology finalRadiology, RadiologyViewModel model, AuthenticatedUser userObj}) {
void showConfirmMessage({FinalRadiology? finalRadiology, RadiologyViewModel? model, AuthenticatedUser? userObj}) {
showDialog(
context: AppGlobal.context,
builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress,
email: model!.user!.emailAddress,
onTapSendEmail: () {
model.sendRadReportEmail(mes: TranslationBase.of(AppGlobal.context).sendSuc, finalRadiology: finalRadiology, userObj: userObj);
model.sendRadReportEmail(mes: TranslationBase.of(AppGlobal.context).sendSuc, finalRadiology: finalRadiology!, userObj: userObj!);
},
),
);

@ -71,7 +71,7 @@ class RadiologyHomePage extends StatelessWidget {
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) {
FinalRadiology radiology = model.finalRadiologyList[index].finalRadiologyList[_index];
FinalRadiology radiology = model.finalRadiologyList[index].finalRadiologyList![_index];
bool _isSortByClinic = model.filterType == FilterType.Clinic;
return DoctorCard(
onTap: () => Navigator.push(
@ -79,13 +79,13 @@ class RadiologyHomePage extends StatelessWidget {
FadePage(
page: RadiologyDetailsPage(
finalRadiology: radiology,
isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID),
isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID!),
),
),
),
isInOutPatient: radiology.isInOutPatient,
name: TranslationBase.of(context).dr + " " + radiology.doctorName,
billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(),
name: TranslationBase.of(context).dr + " " + radiology.doctorName!,
billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID!) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(),
// billNo: radiology.invoiceNo_VP.toString(),
profileUrl: radiology.doctorImageURL,
subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription,
@ -96,7 +96,7 @@ class RadiologyHomePage extends StatelessWidget {
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: model.finalRadiologyList[index].finalRadiologyList.length),
itemCount: model.finalRadiologyList[index].finalRadiologyList!.length),
);
},
itemCount: model.finalRadiologyList.length),

@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
class InPatientMedicalReports extends StatefulWidget {
final AdmissionMedicalReport admissionMedicalReport;
InPatientMedicalReports({@required this.admissionMedicalReport});
InPatientMedicalReports({required this.admissionMedicalReport});
@override
State<InPatientMedicalReports> createState() => _InPatientMedicalReportsState();
@ -57,9 +57,9 @@ class _InPatientMedicalReportsState extends State<InPatientMedicalReports> {
child: IndexedStack(
index: _currentPage,
children: [
ReportListWidget(reportList: model.reportsInPatientOrderRequestList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsInPatientOrderReadyList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsInPatientOrderCanceledList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsInPatientOrderRequestList, emailAddress: model.user!.emailAddress!),
ReportListWidget(reportList: model.reportsInPatientOrderReadyList, emailAddress: model.user!.emailAddress!),
ReportListWidget(reportList: model.reportsInPatientOrderCanceledList, emailAddress: model.user!.emailAddress!),
],
),
),
@ -84,8 +84,8 @@ class _InPatientMedicalReportsState extends State<InPatientMedicalReports> {
context: context,
builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).confirmMsgReport,
onTap: () => reportsViewModel.insertRequestForInPatientMedicalReport(widget.admissionMedicalReport.clinicID, widget.admissionMedicalReport.doctorID, widget.admissionMedicalReport.setupID,
widget.admissionMedicalReport.admissionNo, widget.admissionMedicalReport.projectID, TranslationBase.of(context).successSendReport),
onTap: () => reportsViewModel.insertRequestForInPatientMedicalReport(widget.admissionMedicalReport.clinicID!, widget.admissionMedicalReport.doctorID!, widget.admissionMedicalReport.setupID!,
widget.admissionMedicalReport.admissionNo!, widget.admissionMedicalReport.projectID!, TranslationBase.of(context).successSendReport),
),
);
return;
@ -110,7 +110,7 @@ class _InPatientMedicalReportsState extends State<InPatientMedicalReports> {
groupValue: _currentPage,
onChanged: (index) {
setState(() {
_currentPage = index;
_currentPage = index!;
});
},
),

@ -20,9 +20,9 @@ class MonthlyReportsPage extends StatefulWidget {
}
class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
bool isAgree;
bool isSummary;
String email;
late bool isAgree;
late bool isSummary;
late String email;
final formKey = GlobalKey<FormState>();
List<ImagesInfo> imagesInfo =[];
@ -102,7 +102,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
await model.updatePatientHealthSummaryReport(message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary);
model.receiveHealthSummaryReport = isSummary;
isAgree = isSummary;
model.user.emailAddress = "";
model.user!.emailAddress = "";
GifLoaderDialogUtils.hideDialog(context);
}
},
@ -154,7 +154,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
letterSpacing: -0.44,
),
validator: (value) {
if (value.isEmpty)
if (value!.isEmpty)
return TranslationBase.of(context).enterEmail;
else
return null;
@ -225,12 +225,12 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
TranslationBase.of(context).save,
() async {
final form = formKey.currentState;
if (form.validate()) {
if (form!.validate()) {
GifLoaderDialogUtils.showMyDialog(context);
await model.updatePatientHealthSummaryReport(
message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary, isUpdateEmail: true, email: email.isNotEmpty ? email : model.user.emailAddress);
message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary, isUpdateEmail: true, email: email.isNotEmpty ? email : model.user!.emailAddress);
model.receiveHealthSummaryReport = isSummary;
model.user.emailAddress = email.isNotEmpty ? email : model.user.emailAddress;
model.user!.emailAddress = email.isNotEmpty ? email : model.user!.emailAddress;
GifLoaderDialogUtils.hideDialog(context);
}
},

@ -28,7 +28,7 @@ class HomeReportPage extends StatefulWidget {
}
class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProviderStateMixin {
TabController _tabController_new;
late TabController _tabController_new;
List<ImagesInfo> imagesInfo =[];
int _currentPage = 0;
@ -126,9 +126,9 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
child: IndexedStack(
index: _currentPage,
children: [
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user!.emailAddress!),
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user!.emailAddress!),
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user!.emailAddress!),
],
),
)
@ -187,15 +187,15 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj,
TranslationBase.of(context).dr + " " + admissionMedicalReport.doctorNameObj!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate)),
Text(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(admissionMedicalReport.admissionDate!)),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
Text(admissionMedicalReport.projectName,
Text(admissionMedicalReport.projectName!,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
],
),
@ -209,13 +209,13 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (admissionMedicalReport.clinicName != null)
MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName!, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
MyRichText(
TranslationBase.of(context).status + ":",
projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN : admissionMedicalReport.statusDescription,
projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN! : admissionMedicalReport.statusDescription!,
projectViewModel.isArabic),
Icon(
Icons.arrow_forward,
@ -289,7 +289,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
groupValue: _currentPage,
onChanged: (index) {
setState(() {
_currentPage = index;
_currentPage = index!;
});
},
),

@ -18,18 +18,18 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:open_filex/open_filex.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class ReportListWidget extends StatelessWidget {
final List<Reports> reportList;
final String emailAddress;
final String? emailAddress;
ReportListWidget({@required this.reportList, this.emailAddress});
ReportListWidget({required this.reportList, this.emailAddress});
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -73,9 +73,9 @@ class ReportListWidget extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(DateUtil.getDayMonthYearDateFormatted(report.requestDate),
Text(DateUtil.getDayMonthYearDateFormatted(report.requestDate!),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
Text(DateUtil.formatDateToTimeLang(report.requestDate, projectViewModel.isArabic),
Text(DateUtil.formatDateToTimeLang(report.requestDate!, projectViewModel.isArabic),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
],
),
@ -97,22 +97,34 @@ class ReportListWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (report.projectName != null) MyRichText(TranslationBase.of(context).hospital + ":", report.projectName, projectViewModel.isArabic),
if (report.clinicDescription != null) MyRichText(TranslationBase.of(context).clinic + ":", report.clinicDescription, projectViewModel.isArabic),
if (report.projectName != null) MyRichText(TranslationBase.of(context).hospital + ":", report.projectName!, projectViewModel.isArabic),
if (report.clinicDescription != null) MyRichText(TranslationBase.of(context).clinic + ":", report.clinicDescription!, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar.readOnly(
initialRating: report.actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
RatingBar(
initialRating: report.actualDoctorRate!.toDouble(),
itemSize: 16,
ratingWidget: RatingWidget(
full: Icon(
Icons.star,
color: Colors.yellow[700],
),
half: Icon(
Icons.star_half,
color: Colors.yellow[700],
),
empty: Icon(
Icons.star_border,
color: Colors.grey[500],
),
),
onRatingUpdate: (double value) {},
unratedColor: Colors.grey[500],
updateOnDrag: false,
tapOnlyMode: false,
),
if (reportList[index].status == 2)
Row(
@ -177,8 +189,8 @@ class ReportListWidget extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>();
_reportsService
.getMedicalReportPDF(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID,
DateUtil.convertDateToString(report.requestDate), report.setupId)
.getMedicalReportPDF(report.projectName!, report.clinicDescription!, report.doctorName, DateUtil.convertDateToString(report.requestDate!), report.invoiceNo.toString(), report.projectID!,
DateUtil.convertDateToString(report.requestDate!), report.setupId!)
.then((value) async {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
try {
@ -197,8 +209,8 @@ class ReportListWidget extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>();
_reportsService
.sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID,
DateUtil.convertDateToString(report.requestDate), report.setupId)
.sendEmailForMedicalReport(report.projectName!, report.clinicDescription!, report.doctorName, DateUtil.convertDateToString(report.requestDate!), report.invoiceNo.toString(), report.projectID!,
DateUtil.convertDateToString(report.requestDate!), report.setupId!)
.then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully);

@ -11,8 +11,8 @@ import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class MedicalReports extends StatelessWidget {
@override
@ -80,7 +80,7 @@ class MedicalReports extends StatelessWidget {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Text(
DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate),
DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate!),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
],
@ -101,23 +101,36 @@ class MedicalReports extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (_appointmenHistory.projectName != null) MyRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic),
if (_appointmenHistory.clinicName != null) MyRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic),
if (_appointmenHistory.projectName != null) MyRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName!, projectViewModel.isArabic),
if (_appointmenHistory.clinicName != null) MyRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName!, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
RatingBar.readOnly(
initialRating: _appointmenHistory.actualDoctorRate.toDouble(),
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
RatingBar(
initialRating: _appointmenHistory.actualDoctorRate!.toDouble(),
itemSize: 16,
ratingWidget: RatingWidget(
full: Icon(
Icons.star,
color: Colors.yellow[700],
),
half: Icon(
Icons.star_half,
color: Colors.yellow[700],
),
empty: Icon(
Icons.star_border,
color: Colors.grey[500],
),
),
onRatingUpdate: (double value) {},
unratedColor: Colors.grey[500],
updateOnDrag: false,
tapOnlyMode: false,
),
Icon(Icons.email, color: Color(0xff2B353E))
],
),

@ -19,9 +19,9 @@ class DistanceTracker extends StatefulWidget {
}
class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
num weeklyStatsAvgValue = 0;
num monthlyStatsAvgValue = 0;
@ -35,9 +35,9 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
int monthlyDataLength = 0;
int yearlyDataLength = 0;
List<WeeklyStepsResModel> weekyStepsList =[];
List<WeeklyStepsResModel> monthlyStepsList =[];
List<YearlyStepsResModel> yearlyStepsList =[];
List<WeeklyStepsResModel> weekyStepsList = [];
List<WeeklyStepsResModel> monthlyStepsList = [];
List<YearlyStepsResModel> yearlyStepsList = [];
List<TimeSeriesSales2> weeklyTimeSeriesData = [];
List<TimeSeriesSales2> monthlyTimeSeriesData = [];
@ -130,7 +130,7 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
res['Med_GetWeekStepsTransactionsStsList'].forEach((element) {
weekyStepsList.add(new WeeklyStepsResModel.fromJson(element));
if (element['Value'] != null) {
num value = num.tryParse(element['Value'] ?? "0");
num value = num.tryParse(element['Value']! ?? "0")!;
avgWeeklyStepsValue += value;
weeklyDataLength++;
}
@ -160,7 +160,7 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
res['Med_GetMonthStepsTransactionsStsList'].forEach((element) {
monthlyStepsList.add(new WeeklyStepsResModel.fromJson(element));
if (element['Value'] != null) {
num value = num.tryParse(element['Value'] ?? "0");
num value = num.tryParse(element['Value'] ?? "0")!;
avgMonthlyStepsValue += value;
monthlyDataLength++;
}
@ -216,8 +216,8 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
(element) {
weeklyTimeSeriesData.add(
TimeSeriesSales2(
DateUtil.convertStringToDate(element.machineDate),
element.value != null ? (element.value.toDouble() / 1000) : 0.0,
DateUtil.convertStringToDate(element.machineDate!),
element.value != null ? (element.value!.toDouble() / 1000) : 0.0,
),
);
},
@ -232,8 +232,8 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
(element) {
monthlyTimeSeriesData.add(
TimeSeriesSales2(
DateUtil.convertStringToDate(element.machineDate),
element.value != null ? element.value.toDouble() / 1000 : 0.0,
DateUtil.convertStringToDate(element.machineDate!),
element.value != null ? element.value!.toDouble() / 1000 : 0.0,
),
);
},
@ -248,8 +248,8 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
(element) {
yearlyTimeSeriesData.add(
TimeSeriesSales2(
new DateTime(element.year, element.month, 1),
element.valueSum != null ? element.valueSum.toDouble() / 1000 : 0.0,
new DateTime(element.year!, element.month!, 1),
element.valueSum != null ? element.valueSum!.toDouble() / 1000 : 0.0,
),
);
},
@ -501,11 +501,11 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(step.machineDate),
DateUtil.convertStringToDate(step.machineDate!),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
Utils.tableColumnValue((step.value / 1000).toString() + " " + TranslationBase.of(context).km_, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue((step.value! / 1000).toString() + " " + TranslationBase.of(context).km_, isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
@ -531,11 +531,11 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(step.machineDate),
DateUtil.convertStringToDate(step.machineDate!),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
Utils.tableColumnValue((step.value / 1000).toString() + " " + TranslationBase.of(context).km_, isCapitable: false, mProjectViewModel: projectViewModel),
Utils.tableColumnValue((step.value! / 1000).toString() + " " + TranslationBase.of(context).km_, isCapitable: false, mProjectViewModel: projectViewModel),
],
),
);
@ -561,11 +561,11 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
new DateTime(step.year, step.month, 1),
new DateTime(step.year!, step.month!, 1),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
Utils.tableColumnValue(step.valueSum != null ? (step.valueSum / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_,
Utils.tableColumnValue(step.valueSum != null ? (step.valueSum! / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_,
isCapitable: false, mProjectViewModel: projectViewModel),
],
),

@ -68,7 +68,7 @@ class _HealthDataListState extends State<HealthDataList> {
child: MedicalProfileItem(
title: TranslationBase.of(context).heart,
imagePath: 'assets/images/SmartWatches/heartrate_icon.png',
subTitle: null,
subTitle: "",
isPngImage: true,
),
));
@ -81,7 +81,7 @@ class _HealthDataListState extends State<HealthDataList> {
child: MedicalProfileItem(
title: TranslationBase.of(context).steps,
imagePath: 'assets/images/SmartWatches/steps.png',
subTitle: null,
subTitle: "",
isPngImage: true,
),
));
@ -94,7 +94,7 @@ class _HealthDataListState extends State<HealthDataList> {
child: MedicalProfileItem(
title: TranslationBase.of(context).distance,
imagePath: 'assets/images/SmartWatches/distance.png',
subTitle: null,
subTitle: "",
isPngImage: true,
),
));

@ -19,9 +19,9 @@ class HeartRateTracker extends StatefulWidget {
}
class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
num weeklyStatsAvgValue = 0;
num monthlyStatsAvgValue = 0;
@ -35,9 +35,9 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
int monthlyDataLength = 0;
int yearlyDataLength = 0;
List<WeeklyHeartRateResModel> weekyHearRateList =[];
List<WeeklyHeartRateResModel> monthlyHearRateList =[];
List<YearlyHeartRateResModel> yearlyHearRateList =[];
List<WeeklyHeartRateResModel> weekyHearRateList = [];
List<WeeklyHeartRateResModel> monthlyHearRateList = [];
List<YearlyHeartRateResModel> yearlyHearRateList = [];
List<TimeSeriesSales2> weeklyTimeSeriesData = [];
List<TimeSeriesSales2> monthlyTimeSeriesData = [];
@ -218,8 +218,8 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
(element) {
weeklyTimeSeriesData.add(
TimeSeriesSales2(
DateUtil.convertStringToDate(element.machineDate),
element.valueAvg != null ? element.valueAvg.toDouble() : 0.0,
DateUtil.convertStringToDate(element.machineDate!),
element.valueAvg != null ? element.valueAvg!.toDouble() : 0.0,
),
);
},
@ -234,8 +234,8 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
(element) {
monthlyTimeSeriesData.add(
TimeSeriesSales2(
DateUtil.convertStringToDate(element.machineDate),
element.valueAvg != null ? element.valueAvg.toDouble() : 0.0,
DateUtil.convertStringToDate(element.machineDate!),
element.valueAvg != null ? element.valueAvg!.toDouble() : 0.0,
),
);
},
@ -250,8 +250,8 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
(element) {
yearlyTimeSeriesData.add(
TimeSeriesSales2(
new DateTime(element.year, element.month, 1),
element.valueAvg != null ? element.valueAvg.toDouble() : 0.0,
new DateTime(element.year!, element.month!, 1),
element.valueAvg != null ? element.valueAvg!.toDouble() : 0.0,
),
);
},
@ -503,7 +503,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(step.machineDate),
DateUtil.convertStringToDate(step.machineDate!),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
@ -533,7 +533,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(step.machineDate),
DateUtil.convertStringToDate(step.machineDate!),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
@ -563,7 +563,7 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
new DateTime(step.year, step.month, 1),
new DateTime(step.year!, step.month!, 1),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),

@ -612,7 +612,10 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
pageBuilder: (context, animation1, animation2) {
return SizedBox();
//Chanbged By Aamir
});
}
getLastPatientRecord(BuildContext context) {

@ -23,12 +23,12 @@ class syncHealthDataButton extends StatefulWidget {
class _syncHealthDataButtonState extends State<syncHealthDataButton> {
List<HealthDataPoint> _healthDataList = [];
List<healthData> Med_InsertTransactionsInputsList = new[];
List<healthData> Med_InsertTransactionsInputsList2 = new[];
List<healthData> Med_InsertTransactionsInputsList = [];
List<healthData> Med_InsertTransactionsInputsList2 = [];
List<healthData> sleepDataList = new[];
List<healthData> sleepDataList = [];
List<healthData> healthDataList = new[];
List<healthData> healthDataList = [];
int TransactionsListID = 1;
@ -93,16 +93,28 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
_healthDataList.forEach((x) {
if (x.type == HealthDataType.STEPS) {
Med_InsertTransactionsInputsList.add(
healthData(MedCategoryID: 6, MedSubCategoryID: MedSubCategoryID, MachineDate: DateUtil.convertDateToString(x.dateFrom), Value: x.value, TransactionsListID: TransactionsListID++));
Med_InsertTransactionsInputsList.add(healthData(
MedCategoryID: 6,
MedSubCategoryID: MedSubCategoryID,
MachineDate: DateUtil.convertDateToString(x.dateFrom),
Value: double.tryParse(x.value.toString()),
TransactionsListID: TransactionsListID++));
}
if (x.type == HealthDataType.HEART_RATE) {
Med_InsertTransactionsInputsList.add(
healthData(MedCategoryID: 3, MedSubCategoryID: MedSubCategoryID, MachineDate: DateUtil.convertDateToString(x.dateFrom), Value: x.value, TransactionsListID: TransactionsListID++));
Med_InsertTransactionsInputsList.add(healthData(
MedCategoryID: 3,
MedSubCategoryID: MedSubCategoryID,
MachineDate: DateUtil.convertDateToString(x.dateFrom),
Value: double.tryParse(x.value.toString()),
TransactionsListID: TransactionsListID++));
}
if (x.type == HealthDataType.DISTANCE_DELTA || x.type == HealthDataType.DISTANCE_WALKING_RUNNING) {
Med_InsertTransactionsInputsList.add(
healthData(MedCategoryID: 7, MedSubCategoryID: MedSubCategoryID, MachineDate: DateUtil.convertDateToString(x.dateFrom), Value: x.value, TransactionsListID: TransactionsListID++));
Med_InsertTransactionsInputsList.add(healthData(
MedCategoryID: 7,
MedSubCategoryID: MedSubCategoryID,
MachineDate: DateUtil.convertDateToString(x.dateFrom),
Value: double.tryParse(x.value.toString()),
TransactionsListID: TransactionsListID++));
}
});

@ -76,7 +76,7 @@ class AppScaffold extends StatefulWidget {
final int? dropdownIndexValue;
List<String>? dropDownList;
final void Function(int?)? dropDownIndexChange;
VoidCallbackAction? onTap;
final Function? onTap;
final bool isMainPharmacyPages;
final bool extendBody;
final ValueChanged<int>? changeCurrentTab;
@ -218,7 +218,6 @@ class _AppScaffoldState extends State<AppScaffold> {
bool isUserNotLogin = (!Provider.of<ProjectViewModel>(context, listen: false).isLogin && widget.isShowDecPage);
return Scaffold(
backgroundColor: widget.backgroundColor ?? CustomColors.appBackgroudGrey2Color,
@ -231,27 +230,23 @@ class _AppScaffoldState extends State<AppScaffold> {
appBar: isUserNotLogin!
? null
: widget.isShowPharmacyAppbar!
? PreferredSize(
preferredSize: Size.fromHeight(70),
child: pharmacyAppbar()!)
? PreferredSize(preferredSize: Size.fromHeight(70), child: pharmacyAppbar()!)
: (widget.showNewAppBar!
? PreferredSize(
preferredSize: Size.fromHeight(70),
child: NewAppBarWidget(
title: widget.appBarTitle!,
showTitle: widget.showNewAppBarTitle!,
showDropDown: widget.showDropDown!,
dropdownIndexValue: widget.dropdownIndexValue!,
dropDownList: widget.dropDownList! ?? [],
dropDownIndexChange: widget.dropDownIndexChange,
appBarIcons: widget.appBarIcons!,
onTap: widget.onTap!,
))
preferredSize: Size.fromHeight(70),
child: NewAppBarWidget(
title: widget.appBarTitle!,
showTitle: widget.showNewAppBarTitle!,
showDropDown: widget.showDropDown!,
dropdownIndexValue: widget.dropdownIndexValue!,
dropDownList: widget.dropDownList! ?? [],
dropDownIndexChange: widget.dropDownIndexChange,
appBarIcons: widget.appBarIcons!,
onTap: widget.onTap!,
))
: (widget.isShowAppBar!
? widget.customAppBar != null
? PreferredSize(
preferredSize: Size.fromHeight(70),
child: widget.customAppBar!)
? PreferredSize(preferredSize: Size.fromHeight(70), child: widget.customAppBar!)
: appBar = AppBarWidget(
appBarTitle: widget.appBarTitle!,
appBarIcons: widget.appBarIcons!,
@ -291,12 +286,11 @@ class _AppScaffoldState extends State<AppScaffold> {
: null,
floatingActionButton: widget.floatingActionButton,
);
}
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
void changeCurrentTab(int value) {
if (widget.isMainPharmacyPages) {
widget.changeCurrentTab!(value);

Loading…
Cancel
Save