Merge remote-tracking branch 'origin/dev_v3.13.6' into dev_v3.13.6

dev_v3.13.6_voipcall
devamirsaleemahmad 3 years ago
commit 1c34843bc5

@ -1,10 +1,10 @@
import 'PointsAmountPerMonth.dart'; import 'PointsAmountPerMonth.dart';
class PointsAmountPerYear { class PointsAmountPerYear {
num? amountPerYear; int? amountPerYear;
List<PointsAmountPerMonth>? pointsAmountPerMonth; List<PointsAmountPerMonth>? pointsAmountPerMonth;
num? pointsPerYear; int? pointsPerYear;
num? year; int? year;
PointsAmountPerYear( PointsAmountPerYear(
{this.amountPerYear, {this.amountPerYear,

@ -27,8 +27,9 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'widgets/AppointmentActions.dart'; import 'widgets/AppointmentActions.dart';
@ -37,22 +38,22 @@ class AppointmentDetails extends StatefulWidget {
static bool isLoading = false; static bool isLoading = false;
dynamic doctorSchedule; dynamic doctorSchedule;
static bool showFooterButton = false; static bool showFooterButton = false;
final int parentIndex; final int? parentIndex;
AppointmentDetails({@required this.appo, this.parentIndex, this.doctorSchedule}); AppointmentDetails({required this.appo, this.parentIndex, this.doctorSchedule});
@override @override
_AppointmentDetailsState createState() => _AppointmentDetailsState(); _AppointmentDetailsState createState() => _AppointmentDetailsState();
} }
class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTickerProviderStateMixin { class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTickerProviderStateMixin {
static TabController _tabController; static TabController? _tabController;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
List<DoctorRateDetails> doctorDetailsList =[]; List<DoctorRateDetails> doctorDetailsList =[];
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel? toDoProvider;
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
DoctorList doctorList = new DoctorList(); DoctorList doctorList = new DoctorList();
@ -75,7 +76,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_tabController.dispose(); _tabController!.dispose();
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
} }
@ -86,7 +87,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: widget.appo.doctorNameObj, appBarTitle: widget.appo!.doctorNameObj!,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
@ -99,15 +100,15 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
children: <Widget>[ children: <Widget>[
DoctorHeader( DoctorHeader(
headerModel: HeaderModel( headerModel: HeaderModel(
widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, widget.appo.doctorTitle! + " " + widget.appo.doctorNameObj!,
widget.appo.doctorID, widget.appo.doctorID!,
widget.appo.doctorImageURL, widget.appo.doctorImageURL!,
widget.appo.doctorSpeciality, widget.appo.doctorSpeciality!,
"",
widget.appo.projectName!,
DateUtil.convertStringToDate(widget.appo.appointmentDate!),
widget.appo.isLiveCareAppointment! ? DateUtil.convertStringToDate(widget.appo.appointmentDate!).toString().split(" ")[1].substring(0, 5) : widget.appo.startTime!.substring(0, 5),
"", "",
widget.appo.projectName,
DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.isLiveCareAppointment ? DateUtil.convertStringToDate(widget.appo.appointmentDate).toString().split(" ")[1].substring(0, 5) : widget.appo.startTime.substring(0, 5),
null,
widget.appo.doctorRate, widget.appo.doctorRate,
widget.appo.actualDoctorRate, widget.appo.actualDoctorRate,
widget.appo.noOfPatientsRate, widget.appo.noOfPatientsRate,
@ -119,8 +120,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.clinicID == 47 || widget.appo.clinicID == 47 ||
widget.appo.clinicID == 23 || widget.appo.clinicID == 23 ||
widget.appo.clinicID == 265 || widget.appo.clinicID == 265 ||
widget.appo.isExecludeDoctor || widget.appo.isExecludeDoctor! ||
widget.appo.isLiveCareAppointment) widget.appo.isLiveCareAppointment!)
? false ? false
: true, : true,
buttonTitle: TranslationBase.of(context).schedule, buttonTitle: TranslationBase.of(context).schedule,
@ -135,8 +136,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
), ),
).then((value) { ).then((value) {
setState(() { setState(() {
if (_tabController.index == 0) { if (_tabController!.index == 0) {
_tabController.animateTo((_tabController.index + 1) % 2); _tabController!.animateTo((_tabController!.index + 1) % 2);
this.enableFooterButton(); this.enableFooterButton();
} }
widget.doctorSchedule = value; widget.doctorSchedule = value;
@ -156,9 +157,9 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.clinicID == 23 || widget.appo.clinicID == 23 ||
widget.appo.clinicID == 253 || widget.appo.clinicID == 253 ||
widget.appo.clinicID == 265 || widget.appo.clinicID == 265 ||
widget.appo.isExecludeDoctor || widget.appo.isExecludeDoctor! ||
widget.appo.isLiveCareAppointment) { widget.appo.isLiveCareAppointment!) {
_tabController.index = _tabController.previousIndex; _tabController!.index = _tabController!.previousIndex;
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
} else { } else {
AppointmentDetails.showFooterButton = true; AppointmentDetails.showFooterButton = true;
@ -173,8 +174,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
widget.appo.clinicID == 47 || widget.appo.clinicID == 47 ||
widget.appo.clinicID == 265 || widget.appo.clinicID == 265 ||
widget.appo.clinicID == 253 || widget.appo.clinicID == 253 ||
widget.appo.isExecludeDoctor || widget.appo!.isExecludeDoctor! ||
widget.appo.isLiveCareAppointment widget.appo!.isLiveCareAppointment!
? Tab( ? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
) )
@ -191,8 +192,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
child: TabBarView( child: TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton, projectViewModel: projectViewModel), AppointmentActions(appo: widget.appo, tabController: _tabController!, enableFooterButton: enableFooterButton, projectViewModel: projectViewModel!),
DocAvailableAppointments(doctor: getDoctorObject(), doctorSchedule: widget.doctorSchedule, isLiveCareAppointment: widget.appo.isLiveCareAppointment) DocAvailableAppointments(doctor: getDoctorObject(), doctorSchedule: widget.doctorSchedule, isLiveCareAppointment: widget.appo.isLiveCareAppointment!)
], ],
controller: _tabController, controller: _tabController,
), ),
@ -205,10 +206,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
Widget _bottomButtons() { Widget _bottomButtons() {
if (widget.parentIndex == null) { if (widget.parentIndex == null) {
return null; return SizedBox();
} else { } else {
List<Widget> list = []; List<Widget> list = [];
if (widget.parentIndex == 0 && _tabController.index == 0) { if (widget.parentIndex == 0 && _tabController!.index == 0) {
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
@ -240,7 +241,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
), ),
), ),
); );
} else if (widget.parentIndex == 1 && _tabController.index == 0) { } else if (widget.parentIndex == 1 && _tabController!.index == 0) {
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
@ -260,7 +261,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
), ),
), ),
); );
} else if (_tabController.index == 1) { } else if (_tabController!.index == 1) {
list.add( list.add(
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
@ -274,7 +275,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
); );
} }
if (list.isEmpty) { if (list.isEmpty) {
return null; return SizedBox();
} else } else
return Container( return Container(
color: Colors.white, color: Colors.white,
@ -306,15 +307,15 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
FadePage( FadePage(
page: BookConfirm( page: BookConfirm(
doctor: getDoctorObject(), doctor: getDoctorObject(),
isLiveCareAppointment: widget.appo.isLiveCareAppointment, isLiveCareAppointment: widget.appo.isLiveCareAppointment!,
selectedDate: DocAvailableAppointments.selectedDate, selectedDate: DocAvailableAppointments.selectedDate!,
selectedTime: DocAvailableAppointments.selectedTime))); selectedTime: DocAvailableAppointments.selectedTime!, initialSlotDuration: 0,)));
} }
void getDoctorRatingsDetails() { void getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.appo.doctorID, context).then((res) { service.getDoctorsRatingDetails(widget.appo.doctorID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();
@ -356,20 +357,39 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
margin: EdgeInsets.only(bottom: 5.0), margin: EdgeInsets.only(bottom: 5.0),
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black))), child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.black))),
Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.appo.actualDoctorRate!.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center, alignment: Alignment.center,
child: RatingBar.readOnly( child:
initialRating: this.widget.appo.actualDoctorRate.toDouble(), // RatingBar.readOnly(
size: 35.0, // initialRating: this.widget.appo.actualDoctorRate.toDouble(),
filledColor: Colors.yellow[700], // size: 35.0,
emptyColor: Colors.grey[500], // filledColor: Colors.yellow[700],
isHalfAllowed: true, // emptyColor: Colors.grey[500],
halfFilledIcon: Icons.star_half, // isHalfAllowed: true,
filledIcon: Icons.star, // halfFilledIcon: Icons.star_half,
emptyIcon: Icons.star, // filledIcon: Icons.star,
), // emptyIcon: Icons.star,
// ),
RatingBar(
initialRating: this.widget.appo.actualDoctorRate!.toDouble(),
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 20,
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( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
@ -514,11 +534,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
barrierDismissible: true, barrierDismissible: true,
barrierLabel: '', barrierLabel: '',
context: context, context: context,
pageBuilder: (context, animation1, animation2) {}); pageBuilder: (context, animation1, animation2) {
return SizedBox();
});
} }
double getRatingWidth(int patientNumber) { double getRatingWidth(int patientNumber) {
var width = (patientNumber / this.widget.appo.noOfPatientsRate) * 100; var width = (patientNumber / this.widget.appo.noOfPatientsRate!) * 100;
return width; return width;
} }
@ -569,12 +591,12 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
confirmAppointment() { confirmAppointment() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) { service.confirmAppointment(widget.appo.appointmentNo!, widget.appo.clinicID!, widget.appo.projectID!, widget.appo.isLiveCareAppointment!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop(); Navigator.of(context).pop();
projectViewModel.analytics.appointment.appointment_details_confirm(appointment: widget.appo); projectViewModel!.analytics.appointment.appointment_details_confirm(appointment: widget.appo);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -587,15 +609,15 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
checkIfHasReminder() async { checkIfHasReminder() async {
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();
DateTime startEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate); DateTime startEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate!);
DateTime endEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate); DateTime endEventsDate = DateUtil.convertStringToDate(widget.appo.appointmentDate!);
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); 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; Result<UnmodifiableListView<Event>> events = value;
events.data.forEach((element) { events.data!.forEach((element) {
if (element.title.contains(widget.appo.doctorNameObj)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); if (element.title!.contains(widget.appo.doctorNameObj!)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element);
}); });
}); });
} }
@ -611,11 +633,11 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
getToDoCount(); getToDoCount();
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop(); Navigator.of(context).pop();
projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); projectViewModel!.analytics.appointment.appointment_details_cancel(appointment: widget.appo);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo, appointment_type: widget.appo.isLiveCareAppointment ? "livecare" : "regular"); projectViewModel!.analytics.appointment.appointment_details_cancel(appointment: widget.appo, appointment_type: widget.appo!.isLiveCareAppointment! ? "livecare" : "regular");
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
@ -623,11 +645,11 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider!.setState(0, true, toDoProvider!.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); toDoProvider!.setState(res['AppointmentActiveNumber'], true, toDoProvider!.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -48,7 +48,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
FilterType filterType; FilterType? filterType;
int _currentPage = 0; int _currentPage = 0;
@ -83,7 +83,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
dropdownIndexValue: _currentPage, dropdownIndexValue: _currentPage,
dropDownIndexChange: (index) { dropDownIndexChange: (index) {
setState(() { setState(() {
_currentPage = index; _currentPage = index!;
}); });
}, },
dropDownList: [ dropDownList: [
@ -96,10 +96,10 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
child: Column(children: [ child: Column(children: [
Row( Row(
children: [ children: [
MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, filterType, () { MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, filterType!, () {
setFilterType(FilterType.Clinic); setFilterType(FilterType.Clinic);
}), }),
MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, filterType, () { MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, filterType!, () {
setFilterType(FilterType.Hospital); setFilterType(FilterType.Hospital);
}), }),
], ],
@ -205,7 +205,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
.toList(); .toList();
if (doctorByClinic.length != 0) { if (doctorByClinic.length != 0) {
widget._patientBookedAppointmentListClinic[widget._patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); widget._patientBookedAppointmentListClinic[widget._patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
widget._patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); widget._patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
} }
@ -217,7 +217,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
widget._patientBookedAppointmentListHospital[widget._patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); widget._patientBookedAppointmentListHospital[widget._patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
} }
@ -231,7 +231,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
.toList(); .toList();
if (doctorByClinic.length != 0) { if (doctorByClinic.length != 0) {
widget._patientConfirmedAppointmentListClinic[widget._patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); widget._patientConfirmedAppointmentListClinic[widget._patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
widget._patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); widget._patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
} }
@ -243,7 +243,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
widget._patientConfirmedAppointmentListHospital[widget._patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); widget._patientConfirmedAppointmentListHospital[widget._patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
widget._patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); widget._patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
} }
@ -257,7 +257,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
.toList(); .toList();
if (doctorByClinic.length != 0) { if (doctorByClinic.length != 0) {
widget._patientArrivedAppointmentListClinic[widget._patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); widget._patientArrivedAppointmentListClinic[widget._patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
} }
@ -269,7 +269,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
widget._patientArrivedAppointmentListHospital[widget._patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); widget._patientArrivedAppointmentListHospital[widget._patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
} }
@ -280,7 +280,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
openAppointmentsTab() async { openAppointmentsTab() async {
var flag = await this.sharedPref.getInt(IS_SEARCH_APPO); var flag = await this.sharedPref.getInt(IS_SEARCH_APPO);
int index; int? index;
if (flag == 1) { if (flag == 1) {
index = 0; index = 0;
} else if (flag == 2) { } else if (flag == 2) {
@ -298,7 +298,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} }
} }
_currentPage = index; _currentPage = index!;
} }
Widget getBookedAppointments() { Widget getBookedAppointments() {
@ -346,7 +346,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
); );
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
List<AppoitmentAllHistoryResultList> _appointmentAllHistoryResultList = _patientAppointmentList[index].patientDoctorAppointmentList; List<AppoitmentAllHistoryResultList> _appointmentAllHistoryResultList = _patientAppointmentList[index].patientDoctorAppointmentList!;
return AppExpandableNotifier( return AppExpandableNotifier(
title: _patientAppointmentList[index].filterName, title: _patientAppointmentList[index].filterName,
bodyWidget: ListView.separated( bodyWidget: ListView.separated(
@ -370,15 +370,15 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}), }),
isInOutPatient: _appointmentResult.isInOutPatient, isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!,
// billNo: _appointmentResult.invoiceNo, // billNo: _appointmentResult.invoiceNo,
profileUrl: _appointmentResult.doctorImageURL, profileUrl: _appointmentResult.doctorImageURL,
subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName, subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName,
isLiveCareAppointment: _appointmentResult.isLiveCareAppointment, isLiveCareAppointment: _appointmentResult.isLiveCareAppointment,
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate!),
isSortByClinic: _isSortByClinic, isSortByClinic: _isSortByClinic,
rating: _appointmentResult.actualDoctorRate + 0.0, rating: _appointmentResult.actualDoctorRate! + 0.0,
appointmentTime: _appointmentResult.isLiveCareAppointment ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime.substring(0, 5), appointmentTime: _appointmentResult.isLiveCareAppointment! ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate!).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime!.substring(0, 5),
// appointmentTime: _appointmentResult.startTime.substring(0, 5), // appointmentTime: _appointmentResult.startTime.substring(0, 5),
remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)
? _appointmentResult.remaniningHoursTocanPay ? _appointmentResult.remaniningHoursTocanPay
@ -428,7 +428,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
groupValue: _currentPage, groupValue: _currentPage,
onChanged: (index) { onChanged: (index) {
setState(() { setState(() {
_currentPage = index; _currentPage = index!;
}); });
//_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut); //_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut);
}, },

@ -17,8 +17,8 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class SchedulePage extends StatefulWidget { class SchedulePage extends StatefulWidget {
DoctorList doctorList; DoctorList? doctorList;
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList? appo;
SchedulePage({ SchedulePage({
this.appo, this.appo,
@ -30,14 +30,14 @@ class SchedulePage extends StatefulWidget {
} }
class _SchedulePageState extends State<SchedulePage> { class _SchedulePageState extends State<SchedulePage> {
DoctorsListService service; DoctorsListService? service;
PageController _pageController = PageController(); PageController _pageController = PageController();
double currentPage = 0; double currentPage = 0;
int selectedindex = 0; int selectedindex = 0;
List weeks = []; List weeks = [];
List<DoctorScheduleResponse> doctorScheduleResponse = []; List<DoctorScheduleResponse> doctorScheduleResponse = [];
int weekMS = 604800 * 1000; int weekMS = 604800 * 1000;
DoctorList doctorList; DoctorList? doctorList;
List<String> freeSlots = []; List<String> freeSlots = [];
bool isPageChange = false; bool isPageChange = false;
@ -54,10 +54,10 @@ class _SchedulePageState extends State<SchedulePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getDoctorSchedule(doctorList), onModelReady: (model) => model.getDoctorSchedule(doctorList!),
allowAny: true, allowAny: true,
builder: (_, model, widget) => BaseView<MedicalViewModel>( builder: (_, model, widget) => BaseView<MedicalViewModel>(
onModelReady: (model2) => model2.getFreeSlots(doctorList), onModelReady: (model2) => model2.getFreeSlots(doctorList!),
allowAny: true, allowAny: true,
builder: (_, model2, widget2) { builder: (_, model2, widget2) {
if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) { if (model2.freeSlots.length > 0 && isPageChange == false && model2.state == ViewState.Idle) {
@ -99,7 +99,7 @@ class _SchedulePageState extends State<SchedulePage> {
onTap: () { onTap: () {
final weekDay = weeks[index][index2]['DayName']; final weekDay = weeks[index][index2]['DayName'];
openBookAppointment(weeks[index][index2]); openBookAppointment(weeks[index][index2]);
projectViewModel.analytics.appointment.book_appointment_date_selection(appointment_type: 'regular', day: weekDay, doctor: doctorList); projectViewModel.analytics.appointment.book_appointment_date_selection(appointment_type: 'regular', day: weekDay, doctor: doctorList!);
}, },
child: Row( child: Row(
children: [ children: [
@ -139,7 +139,7 @@ class _SchedulePageState extends State<SchedulePage> {
DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10) DateUtil.convertStringToDate(weeks[index][index2]['Date']).toString().substring(0, 10) == DateTime.now().toString().substring(0, 10)
? BoxShadow(color: Colors.green, offset: Offset(projectViewModel.isArabic ? 5 : -5, 0)) ? BoxShadow(color: Colors.green, offset: Offset(projectViewModel.isArabic ? 5 : -5, 0))
: BoxShadow( : BoxShadow(
color: Colors.grey[100], color: Colors.grey[100]!,
blurRadius: 5, blurRadius: 5,
spreadRadius: 4, spreadRadius: 4,
offset: Offset(0, 10), offset: Offset(0, 10),
@ -206,7 +206,7 @@ class _SchedulePageState extends State<SchedulePage> {
var newWeekSchedule = []; var newWeekSchedule = [];
for (var workDay in this.doctorScheduleResponse) { for (var workDay in this.doctorScheduleResponse) {
Map<String, dynamic> newWorkDay = Map(); Map<String, dynamic> newWorkDay = Map();
newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch + weekMSOffset); newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(DateUtil.convertStringToDate(workDay.date!).millisecondsSinceEpoch + weekMSOffset);
newWorkDay['DayName'] = workDay.dayName; newWorkDay['DayName'] = workDay.dayName;
newWorkDay['WorkingHours'] = workDay.workingHours; newWorkDay['WorkingHours'] = workDay.workingHours;
newWeekSchedule.add(newWorkDay); newWeekSchedule.add(newWorkDay);

@ -1,24 +1,24 @@
class AskDocRequestType { class AskDocRequestType {
String setupID; String? setupID;
int parameterGroup; int? parameterGroup;
int parameterType; int? parameterType;
int parameterCode; int? parameterCode;
String description; String? description;
String descriptionN; String? descriptionN;
String alias; String? alias;
String aliasN; String? aliasN;
String prefix; String? prefix;
String suffix; String? suffix;
String isColorCodingRequired; String? isColorCodingRequired;
String backColor; String? backColor;
String foreColor; String? foreColor;
bool isBuiltIn; bool? isBuiltIn;
bool isActive; bool? isActive;
int createdBy; int? createdBy;
String createdOn; String? createdOn;
String editedBy; String? editedBy;
String editedOn; String? editedOn;
String rowVer; String? rowVer;
AskDocRequestType( AskDocRequestType(
{this.setupID, {this.setupID,

@ -1,9 +1,9 @@
class DoctorScheduleResponse { class DoctorScheduleResponse {
String clinicName; String? clinicName;
String date; String? date;
String dayName; String? dayName;
String projectName; String? projectName;
String workingHours; String? workingHours;
DoctorScheduleResponse( DoctorScheduleResponse(
{this.clinicName, {this.clinicName,

@ -43,10 +43,10 @@ class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
TabController tabController; TabController tabController;
final Function enableFooterButton; final Function enableFooterButton;
MyInAppBrowser browser; MyInAppBrowser? browser;
final ProjectViewModel projectViewModel; final ProjectViewModel? projectViewModel;
AppointmentActions({@required this.appo, @required this.tabController, @required this.enableFooterButton, this.projectViewModel}); AppointmentActions({required this.appo, required this.tabController, required this.enableFooterButton, this.projectViewModel});
@override @override
_AppointmentActionsState createState() => _AppointmentActionsState(); _AppointmentActionsState createState() => _AppointmentActionsState();
@ -73,7 +73,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
// bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule");
bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment! && appoButtonsList[index].caller == "askDoc"));
return InkWell( return InkWell(
onTap: shouldEnable onTap: shouldEnable
? null ? null
@ -81,9 +81,9 @@ class _AppointmentActionsState extends State<AppointmentActions> {
_handleButtonClicks(appoButtonsList[index], model); _handleButtonClicks(appoButtonsList[index], model);
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: appoButtonsList[index].title, title: appoButtonsList[index].title!,
imagePath: appoButtonsList[index].icon, imagePath: appoButtonsList[index].icon!,
subTitle: appoButtonsList[index].subtitle, subTitle: appoButtonsList[index].subtitle!,
hasBadge: true, hasBadge: true,
isEnable: !shouldEnable, isEnable: !shouldEnable,
imgColor: Color(0xff28323A), imgColor: Color(0xff28323A),
@ -104,7 +104,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'reschedule appointment'); locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'reschedule appointment');
break; break;
case "navigateToProject": case "navigateToProject":
openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude)); openMap(double.parse(widget.appo.latitude!), double.parse(widget.appo.longitude!));
locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'hospital location'); locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'hospital location');
break; break;
case "addReminder": case "addReminder":
@ -112,14 +112,14 @@ class _AppointmentActionsState extends State<AppointmentActions> {
showReminderDialog( showReminderDialog(
context, context,
new DateFormat("dd MMM yyyy hh:mm") new DateFormat("dd MMM yyyy hh:mm")
.parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.projectViewModel.isArabic) + " " + widget.appo.startTime), .parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate!), widget.projectViewModel!.isArabic) + " " + widget.appo.startTime!),
//DateUtil.convertStringToDate(widget.appo.appointmentDate), //DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.doctorNameObj, widget.appo.doctorNameObj!,
"", "",
DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.projectViewModel.isArabic), DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate!), widget.projectViewModel!.isArabic),
// DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)), // DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)),
widget.appo.startTime, widget.appo.startTime!,
onSuccess: () { onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
}, },
@ -152,12 +152,12 @@ class _AppointmentActionsState extends State<AppointmentActions> {
locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'survey'); locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'survey');
break; break;
case "Insurance": case "Insurance":
navigateToInsuranceApprovals(widget.appo.appointmentNo); navigateToInsuranceApprovals(widget.appo.appointmentNo!);
locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'insurance'); locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'insurance');
break; break;
case "VitalSigns": case "VitalSigns":
navigateToVitalSigns(widget.appo.appointmentNo, widget.appo.projectID); navigateToVitalSigns(widget.appo.appointmentNo!, widget.appo.projectID!);
locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'vital sign'); locator<GAnalytics>().appointment.appointment_detail_action(appointment: widget.appo, action: 'vital sign');
break; break;
@ -171,7 +171,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
_getAppointmentActionButtons() { _getAppointmentActionButtons() {
if (widget.appo != null) { if (widget.appo != null) {
if (isConfirmed()) { if (isConfirmed()) {
if (widget.appo.isOnlineCheckedIN) { if (widget.appo.isOnlineCheckedIN!) {
_getConfirmedCheckInAppoActionsList(); _getConfirmedCheckInAppoActionsList();
} else { } else {
_getConfirmedAppoActionsList(); _getConfirmedAppoActionsList();
@ -180,7 +180,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
print("isConfirmed Null"); print("isConfirmed Null");
} }
if (isBooked()) { if (isBooked()) {
if (widget.appo.isOnlineCheckedIN) { if (widget.appo.isOnlineCheckedIN!) {
_getBookedCheckInAppoActionsList(); _getBookedCheckInAppoActionsList();
} else { } else {
_getBookedAppoActionsList(); _getBookedAppoActionsList();
@ -211,14 +211,14 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
bool isCheckedIn() { bool isCheckedIn() {
return widget.appo.isOnlineCheckedIN; return widget.appo.isOnlineCheckedIN!;
} }
bool isBooked() { bool isBooked() {
return AppointmentType.isBooked(widget.appo); return AppointmentType.isBooked(widget.appo);
} }
Future<List<AppoDetailsButton>> _getBookedAppoActionsList() async { Future<List<AppoDetailsButton>?>? _getBookedAppoActionsList() async {
print("_getBookedAppoActionsList"); print("_getBookedAppoActionsList");
BookedButtons bookedButtons = new BookedButtons(); BookedButtons bookedButtons = new BookedButtons();
print(bookedButtons.buttons); print(bookedButtons.buttons);
@ -236,7 +236,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
Future<List<AppoDetailsButton>> _getBookedCheckInAppoActionsList() async { Future<List<AppoDetailsButton>?>? _getBookedCheckInAppoActionsList() async {
print("_getBookedCheckInAppoActionsList"); print("_getBookedCheckInAppoActionsList");
BookedButtonsAllowCheckIn bookedButtonsAllowCheckIn = new BookedButtonsAllowCheckIn(); BookedButtonsAllowCheckIn bookedButtonsAllowCheckIn = new BookedButtonsAllowCheckIn();
print(bookedButtonsAllowCheckIn.buttons); print(bookedButtonsAllowCheckIn.buttons);
@ -254,7 +254,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
Future<List<AppoDetailsButton>> _getConfirmedAppoActionsList() async { Future<List<AppoDetailsButton>?> _getConfirmedAppoActionsList() async {
print("_getConfirmedAppoActionsList"); print("_getConfirmedAppoActionsList");
ConfirmedButtons confirmedButtons = new ConfirmedButtons(); ConfirmedButtons confirmedButtons = new ConfirmedButtons();
print(confirmedButtons.buttons); print(confirmedButtons.buttons);
@ -272,7 +272,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
Future<List<AppoDetailsButton>> _getConfirmedCheckInAppoActionsList() async { Future<List<AppoDetailsButton>?> _getConfirmedCheckInAppoActionsList() async {
print("_getConfirmedAllowCheckInAppoActionsList"); print("_getConfirmedAllowCheckInAppoActionsList");
ConfirmedButtonsAllowCheckIn confirmedButtonsAllowCheckIn = new ConfirmedButtonsAllowCheckIn(); ConfirmedButtonsAllowCheckIn confirmedButtonsAllowCheckIn = new ConfirmedButtonsAllowCheckIn();
print(confirmedButtonsAllowCheckIn.buttons); print(confirmedButtonsAllowCheckIn.buttons);
@ -290,7 +290,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
Future<List<AppoDetailsButton>> _getArrivedAppoActionsList() async { Future<List<AppoDetailsButton>?> _getArrivedAppoActionsList() async {
print("_getArrivedAppoActionsList"); print("_getArrivedAppoActionsList");
ArrivedButtons arrivedButtons = new ArrivedButtons(); ArrivedButtons arrivedButtons = new ArrivedButtons();
print(arrivedButtons.buttons); print(arrivedButtons.buttons);
@ -308,7 +308,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}); });
} }
Future<List<AppoDetailsButton>> _getArrivedInvoiceAppoActionsList() async { Future<List<AppoDetailsButton>?> _getArrivedInvoiceAppoActionsList() async {
print("_getArrivedInvoiceAppoActionsList"); print("_getArrivedInvoiceAppoActionsList");
ArrivedButtons arrivedButtons = new ArrivedButtons(); ArrivedButtons arrivedButtons = new ArrivedButtons();
List<AppoDetailsButton> buttonsList = []; List<AppoDetailsButton> buttonsList = [];
@ -375,7 +375,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
patientLabOrders.doctorImageURL = widget.appo.doctorImageURL; patientLabOrders.doctorImageURL = widget.appo.doctorImageURL;
patientLabOrders.speciality = widget.appo.doctorSpeciality; patientLabOrders.speciality = widget.appo.doctorSpeciality;
patientLabOrders.projectName = widget.appo.projectName; patientLabOrders.projectName = widget.appo.projectName;
patientLabOrders.orderDate = DateUtil.convertStringToDate(widget.appo.appointmentDate); patientLabOrders.orderDate = DateUtil.convertStringToDate(widget.appo.appointmentDate!);
patientLabOrders.doctorRate = widget.appo.doctorRate; patientLabOrders.doctorRate = widget.appo.doctorRate;
patientLabOrders.actualDoctorRate = widget.appo.actualDoctorRate; patientLabOrders.actualDoctorRate = widget.appo.actualDoctorRate;
patientLabOrders.noOfPatientsRate = widget.appo.noOfPatientsRate; patientLabOrders.noOfPatientsRate = widget.appo.noOfPatientsRate;
@ -461,7 +461,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) { service.isAllowedToAskDoctor(widget.appo.doctorID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { if (res['PatientDoctorAppointmentResultList'].length != 0) {
@ -481,7 +481,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) { service.getCallRequestType(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
List<AskDocRequestType> requestData = new List<AskDocRequestType>(); List<AskDocRequestType> requestData = [];
res['ListReqTypes'].forEach((element) { res['ListReqTypes'].forEach((element) {
requestData.add(new AskDocRequestType.fromJson(element)); requestData.add(new AskDocRequestType.fromJson(element));
}); });
@ -511,12 +511,12 @@ class _AppointmentActionsState extends State<AppointmentActions> {
barrierDismissible: true, barrierDismissible: true,
barrierLabel: '', barrierLabel: '',
context: context, context: context,
pageBuilder: (context, animation1, animation2) {}) pageBuilder: (context, animation1, animation2) =>SizedBox())
.then((value) { .then((value) {
print("Dialog Closed"); print("Dialog Closed");
print(value); print(value);
if (value != null) { if (value != null) {
sendAskDocRequest(value); sendAskDocRequest(value as int);
} }
}); });
} }
@ -581,7 +581,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) {
if (widget.projectViewModel.isLogin) { if (widget.projectViewModel!.isLogin) {
if (model.count != 0) { if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else { } else {

@ -9,8 +9,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import '../AppointmentDetails.dart'; import '../AppointmentDetails.dart';
@ -19,14 +19,14 @@ class AppointmentCard extends StatefulWidget {
final Function onReloadAppointmentHistory; final Function onReloadAppointmentHistory;
AppointmentCard( AppointmentCard(
{@required this.appo, @required this.onReloadAppointmentHistory}); {required this.appo, required this.onReloadAppointmentHistory});
@override @override
_ApointmentCardState createState() => _ApointmentCardState(); _ApointmentCardState createState() => _ApointmentCardState();
} }
class _ApointmentCardState extends State<AppointmentCard> { class _ApointmentCardState extends State<AppointmentCard> {
CountdownTimerController controller; CountdownTimerController? controller;
@override @override
void initState() { void initState() {
@ -62,9 +62,9 @@ class _ApointmentCardState extends State<AppointmentCard> {
height: projectViewModel.isArabic ? 165 : 140, height: projectViewModel.isArabic ? 165 : 140,
decoration: BoxDecoration( decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545) //Colors.red[900] Color(0xff404545)
color: widget.appo.isLiveCareAppointment color: widget.appo.isLiveCareAppointment!
? Color(0xff404545) ? Color(0xff404545)
: !widget.appo.isInOutPatient : !widget.appo.isInOutPatient!
? Colors.red[900] ? Colors.red[900]
: Theme.of(context).primaryColor, : Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@ -86,9 +86,9 @@ class _ApointmentCardState extends State<AppointmentCard> {
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
widget.appo.isLiveCareAppointment widget.appo.isLiveCareAppointment!
? TranslationBase.of(context).liveCare.toUpperCase() ? TranslationBase.of(context).liveCare.toUpperCase()
: !widget.appo.isInOutPatient : !widget.appo.isInOutPatient!
? TranslationBase.of(context) ? TranslationBase.of(context)
.inPatient .inPatient
.toUpperCase() .toUpperCase()
@ -104,7 +104,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
), ),
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(100.0), borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.appo.doctorImageURL, child: Image.network(widget.appo.doctorImageURL!,
fit: BoxFit.fill, height: 60.0, width: 60.0), fit: BoxFit.fill, height: 60.0, width: 60.0),
), ),
Expanded( Expanded(
@ -115,16 +115,16 @@ class _ApointmentCardState extends State<AppointmentCard> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.appo.doctorTitle + widget.appo.doctorTitle! +
" " + " " +
widget.appo.doctorNameObj, widget.appo.doctorNameObj!,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.grey[700], color: Colors.grey[700],
letterSpacing: 1.0)), letterSpacing: 1.0)),
Container( Container(
margin: EdgeInsets.only(top: 3.0), margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.clinicName, child: Text(widget.appo.clinicName!,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.grey[600], color: Colors.grey[600],
@ -132,7 +132,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
), ),
Container( Container(
margin: EdgeInsets.only(top: 3.0), margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.projectName, child: Text(widget.appo.projectName!,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.grey[600], color: Colors.grey[600],
@ -143,7 +143,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
child: Text( child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted( DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(
widget.appo.appointmentDate), widget.appo.appointmentDate!),
projectViewModel.isArabic ? "ar" : "en") projectViewModel.isArabic ? "ar" : "en")
.trim(), .trim(),
style: TextStyle( style: TextStyle(
@ -155,16 +155,34 @@ class _ApointmentCardState extends State<AppointmentCard> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( // RatingBar.readOnly(
initialRating: // initialRating:
widget.appo.actualDoctorRate.toDouble(), // widget.appo.actualDoctorRate.toDouble(),
size: 20.0, // size: 20.0,
filledColor: Colors.yellow[700], // filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500], // emptyColor: Colors.grey[500],
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: Icons.star,
emptyIcon: Icons.star, // emptyIcon: Icons.star,
// ),
RatingBar(
initialRating: widget.appo.actualDoctorRate!.toDouble(),
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 20,
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( Container(
transform: transform:
@ -190,10 +208,10 @@ class _ApointmentCardState extends State<AppointmentCard> {
controller: new CountdownTimerController( controller: new CountdownTimerController(
endTime: DateTime.now() endTime: DateTime.now()
.millisecondsSinceEpoch + .millisecondsSinceEpoch +
(widget.appo.remaniningHoursTocanPay * (widget.appo.remaniningHoursTocanPay! *
1000) * 1000) *
60), 60),
widgetBuilder: (_, CurrentRemainingTime time) { widgetBuilder: (_, CurrentRemainingTime? time) {
return time != null return time != null
? Text( ? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours : "0"}:${time.min}:${time.sec} ' + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours : "0"}:${time.min}:${time.sec} ' +

@ -17,9 +17,9 @@ class PrescriptionReportPage extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
PrescriptionReportPage( PrescriptionReportPage(
{@required this.prescriptionReportEnhList, {required this.prescriptionReportEnhList,
@required this.listPres, required this.listPres,
@required this.appo}); required this.appo});
@override @override
_PrescriptionReportState createState() => _PrescriptionReportState(); _PrescriptionReportState createState() => _PrescriptionReportState();
@ -53,14 +53,14 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: Colors.grey[200], width: 0.5), border: Border.all(color: Colors.grey[200]!, width: 0.5),
), ),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
ClipRRect( ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)), borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network( child: Image.network(
widget.prescriptionReportEnhList[index].imageSRCUrl, widget.prescriptionReportEnhList[index]!.imageSRCUrl!,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60,
height: 70, height: 70,
@ -117,7 +117,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, .sendPrescriptionEmail(widget.appo.appointmentDate!, widget.appo.setupID!,
widget.listPres, context) widget.listPres, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -12,7 +12,7 @@ class AskDocDialog extends StatefulWidget {
static int selectedParameterCode = 0; static int selectedParameterCode = 0;
AskDocDialog({@required this.requestData}); AskDocDialog({required this.requestData});
@override @override
_AskDocDialogState createState() => _AskDocDialogState(); _AskDocDialogState createState() => _AskDocDialogState();

@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class CustomRadio extends StatefulWidget { class CustomRadio extends StatefulWidget {
List<AskDocRequestType> requestData; List<AskDocRequestType>? requestData;
CustomRadio({this.requestData}); CustomRadio({this.requestData});
@ -17,7 +17,7 @@ class CustomRadio extends StatefulWidget {
} }
class CustomRadioState extends State<CustomRadio> { class CustomRadioState extends State<CustomRadio> {
List<RadioModel> sampleData = new List<RadioModel>(); List<RadioModel>? sampleData = [];
@override @override
void initState() { void initState() {
@ -25,14 +25,14 @@ class CustomRadioState extends State<CustomRadio> {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (widget.requestData != null) { if (widget.requestData != null) {
widget.requestData.forEach((element) { widget.requestData!.forEach((element) {
sampleData.add(new RadioModel(false, element.description, element.parameterCode)); sampleData!.add(new RadioModel(false, element.description!, element.parameterCode!));
}); });
} else { } else {
sampleData.add(new RadioModel(false, TranslationBase.of(context).appoReminder30, 30)); sampleData!.add(new RadioModel(false, TranslationBase.of(context).appoReminder30, 30));
sampleData.add(new RadioModel(false, TranslationBase.of(context).appoReminder60, 60)); sampleData!.add(new RadioModel(false, TranslationBase.of(context).appoReminder60, 60));
sampleData.add(new RadioModel(false, TranslationBase.of(context).appoReminder90, 90)); sampleData!.add(new RadioModel(false, TranslationBase.of(context).appoReminder90, 90));
sampleData.add(new RadioModel(false, TranslationBase.of(context).appoReminder120, 120)); sampleData!.add(new RadioModel(false, TranslationBase.of(context).appoReminder120, 120));
} }
}); });
} }
@ -43,24 +43,24 @@ class CustomRadioState extends State<CustomRadio> {
children: <Widget>[ children: <Widget>[
ListView.builder( ListView.builder(
shrinkWrap: true, shrinkWrap: true,
itemCount: sampleData.length, itemCount: sampleData!.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return new InkWell( return new InkWell(
//highlightColor: Colors.red, //highlightColor: Colors.red,
splashColor: Colors.transparent, splashColor: Colors.transparent,
onTap: () { onTap: () {
setState(() { setState(() {
sampleData.forEach((element) => element.isSelected = false); sampleData!.forEach((element) => element.isSelected = false);
sampleData[index].isSelected = true; sampleData![index].isSelected = true;
if (widget.requestData != null) { if (widget.requestData != null) {
AskDocDialog.selectedParameterCode = sampleData[index].duration; AskDocDialog.selectedParameterCode = sampleData![index].duration;
} else { } else {
ReminderDialog.selectedDuration = sampleData[index].duration * 60000; ReminderDialog.selectedDuration = sampleData![index].duration * 60000;
PrescriptionReminderDialog.selectedDuration = sampleData[index].duration * 60000; PrescriptionReminderDialog.selectedDuration = sampleData![index].duration * 60000;
} }
}); });
}, },
child: new RadioItem(sampleData[index]), child: new RadioItem(sampleData![index]),
); );
}, },
), ),

@ -5,9 +5,9 @@ class PageViewIndicator extends StatelessWidget {
final int length; final int length;
final double currentPage; final double currentPage;
PageViewIndicator({ PageViewIndicator({
@required this.isActive, required this.isActive,
@required this.length, required this.length,
@required this.currentPage, required this.currentPage,
}); });
@override @override

@ -17,7 +17,7 @@ class ReminderDialog extends StatefulWidget {
final String endDate; final String endDate;
final String location; final String location;
ReminderDialog({@required this.eventId, @required this.title, @required this.description, @required this.startDate, @required this.endDate, @required this.location}); ReminderDialog({required this.eventId, required this.title, required this.description, required this.startDate, required this.endDate, required this.location});
@override @override
_ReminderDialogState createState() => _ReminderDialogState(); _ReminderDialogState createState() => _ReminderDialogState();
@ -76,10 +76,10 @@ class _ReminderDialogState extends State<ReminderDialog> {
createCalendarEvent() { createCalendarEvent() {
_myPlugin.hasPermissions().then((value) { _myPlugin.hasPermissions().then((value) {
if (!value) { if (!value!) {
_myPlugin.requestPermissions(); _myPlugin.requestPermissions();
} else { } else {
_myPlugin.getCalendars().then((value) => {print(value.length)}); _myPlugin.getCalendars().then((value) => {print(value!.length)});
} }
}); });
@ -97,7 +97,7 @@ class _ReminderDialogState extends State<ReminderDialog> {
_myPlugin.createEvent(calendarId: "207749556", event: calendarEvent).then((value) { _myPlugin.createEvent(calendarId: "207749556", event: calendarEvent).then((value) {
print("Cal event"); print("Cal event");
print(value); print(value);
if (int.parse(value) == int.parse(widget.eventId)) { if (int.parse(value!) == int.parse(widget.eventId)) {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
} }
Navigator.of(context).pop(); Navigator.of(context).pop();

@ -20,13 +20,13 @@ class PrescriptionReminderDialog extends StatefulWidget {
List<DateTime> _scheduleList =[]; List<DateTime> _scheduleList =[];
PrescriptionReminderDialog({ PrescriptionReminderDialog({
@required this.eventId, required this.eventId,
@required this.title, required this.title,
@required this.description, required this.description,
@required this.startDate, required this.startDate,
@required this.endDate, required this.endDate,
@required this.location, required this.location,
@required this.days, required this.days,
}); });
@override @override

@ -26,27 +26,27 @@ import 'package:syncfusion_flutter_calendar/calendar.dart';
class ObGyneTimeSlots extends StatefulWidget { class ObGyneTimeSlots extends StatefulWidget {
int projectID; int projectID;
static bool areSlotsAvailable = false; static bool areSlotsAvailable = false;
static DateTime selectedAppoDateTime; static late DateTime selectedAppoDateTime;
static String selectedDate; static late String selectedDate;
static String selectedTime; static late String selectedTime;
int selectedClinicID; late int? selectedClinicID;
int selectedDoctorID; late int? selectedDoctorID;
OBGyneProcedureListResponse obGyneProcedureListResponse; late OBGyneProcedureListResponse? obGyneProcedureListResponse;
var language; var language;
ObGyneTimeSlots({@required this.projectID, this.selectedClinicID, this.selectedDoctorID, this.obGyneProcedureListResponse}); ObGyneTimeSlots({required this.projectID, this.selectedClinicID, this.selectedDoctorID, this.obGyneProcedureListResponse});
@override @override
_CovidTimeSlotsState createState() => _CovidTimeSlotsState(); _CovidTimeSlotsState createState() => _CovidTimeSlotsState();
} }
class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderStateMixin { class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderStateMixin {
Map<DateTime, List> _events; Map<DateTime, List>? _events;
AnimationController _animationController; AnimationController? _animationController;
CalendarController _calendarController; CalendarController? _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -61,10 +61,10 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
dynamic freeSlotsResponse; dynamic freeSlotsResponse;
ScrollController _scrollController; ScrollController? _scrollController;
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel? toDoProvider;
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
void initState() { void initState() {
@ -84,14 +84,14 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
duration: const Duration(milliseconds: 50), duration: const Duration(milliseconds: 50),
); );
_animationController.forward(); _animationController!.forward();
super.initState(); super.initState();
} }
@override @override
void dispose() { void dispose() {
_animationController.dispose(); _animationController!.dispose();
_calendarController.dispose(); _calendarController!.dispose();
super.dispose(); super.dispose();
} }
@ -101,7 +101,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en"); this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots); openTimeSlotsPickerForDate(day, docFreeSlots);
ObGyneTimeSlots.selectedDate = formatter.format(day); ObGyneTimeSlots.selectedDate = formatter.format(day);
_calendarController.selectedDate = day; _calendarController!.selectedDate = day;
print(ObGyneTimeSlots.selectedDate); print(ObGyneTimeSlots.selectedDate);
}); });
} }
@ -142,7 +142,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
mHeight(12), mHeight(12),
Container( Container(
decoration: cardRadius(12), decoration: cardRadius(12),
child: _buildTableCalendarWithBuilders(projectViewModel), child: _buildTableCalendarWithBuilders(projectViewModel!),
), ),
mHeight(12), mHeight(12),
Text( Text(
@ -209,8 +209,8 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
disabledForegroundColor: Colors.grey[500].withOpacity(0.38), disabledForegroundColor: Colors.grey[500]!.withOpacity(0.38),
disabledBackgroundColor: Colors.grey[500].withOpacity(0.12), disabledBackgroundColor: Colors.grey[500]!.withOpacity(0.12),
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
bookCovidTestAppointment(); bookCovidTestAppointment();
@ -242,15 +242,15 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
dataSource: MeetingDataSource(_getDataSource()), dataSource: MeetingDataSource(_getDataSource()),
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1), monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) { onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date; _calendarController!.selectedDate = details.date;
_onDaySelected(details.date, projectViewModel); _onDaySelected(details.date!, projectViewModel);
}, },
); );
} }
List<Meeting> _getDataSource() { List<Meeting> _getDataSource() {
final List<Meeting> meetings = <Meeting>[]; final List<Meeting> meetings = <Meeting>[];
_events.forEach((key, value) { _events!.forEach((key, value) {
final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0); final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
final DateTime endTime = startTime.add(const Duration(minutes: 20)); final DateTime endTime = startTime.add(const Duration(minutes: 20));
meetings.add(Meeting("", startTime, endTime, CustomColors.green, false)); meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
@ -270,7 +270,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
if (dayEvents.length != 0) { if (dayEvents.length != 0) {
ObGyneTimeSlots.areSlotsAvailable = true; ObGyneTimeSlots.areSlotsAvailable = true;
selectedButtonIndex = 0; selectedButtonIndex = 0;
ObGyneTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime; ObGyneTimeSlots.selectedTime = dayEvents![selectedButtonIndex]!.isoTime!;
} else } else
ObGyneTimeSlots.areSlotsAvailable = false; ObGyneTimeSlots.areSlotsAvailable = false;
}); });
@ -294,7 +294,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
selectedDateJSON = freeSlotsResponse[0]; selectedDateJSON = freeSlotsResponse[0];
}); });
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON); _calendarController!.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
return _eventsParsed; return _eventsParsed;
} }
@ -305,11 +305,11 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
onPressed: () { onPressed: () {
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
ObGyneTimeSlots.selectedTime = dayEvents[index].isoTime; ObGyneTimeSlots.selectedTime = dayEvents[index].isoTime!;
print(ObGyneTimeSlots.selectedTime); print(ObGyneTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))), child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))),
); );
} }
@ -320,11 +320,11 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
onPressed: () { onPressed: () {
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
ObGyneTimeSlots.selectedTime = dayEvents[index].isoTime; ObGyneTimeSlots.selectedTime = dayEvents[index].isoTime!;
print(ObGyneTimeSlots.selectedTime); print(ObGyneTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Colors.white)), child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Colors.white)),
); );
} }
@ -353,7 +353,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
service service
.insertAppointment( .insertAppointment(
docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse.procedureId) docObject.doctorID!, docObject.clinicID!, docObject.projectID!, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse!.procedureId!)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -393,8 +393,8 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
updateObGyneAppointment(String appoNo) { updateObGyneAppointment(String appoNo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.updateObGyneAppointment(widget.obGyneProcedureListResponse.episodeID, int.parse(appoNo), widget.obGyneProcedureListResponse.orderNo, widget.obGyneProcedureListResponse.procedureId, .updateObGyneAppointment(widget.obGyneProcedureListResponse!.episodeID!, int.parse(appoNo), widget.obGyneProcedureListResponse!.orderNo!, widget.obGyneProcedureListResponse!.procedureId!,
widget.obGyneProcedureListResponse.lineItemNo, widget.obGyneProcedureListResponse.uniqueRowID) widget.obGyneProcedureListResponse!.lineItemNo!, widget.obGyneProcedureListResponse!.uniqueRowID!)
.then((res) {}) .then((res) {})
.catchError((err) { .catchError((err) {
print(err); print(err);
@ -402,13 +402,13 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider!.setState(0, true, toDoProvider!.notificationsCount!);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); toDoProvider!.setState(res['AppointmentActiveNumber'], true, toDoProvider!.notificationsCount);
} else {} } else {}
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
@ -465,7 +465,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
getCovidFreeSlots(BuildContext context, int projectID) { getCovidFreeSlots(BuildContext context, int projectID) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getDoctorFreeSlots(widget.selectedDoctorID, widget.selectedClinicID, widget.projectID, context).then((res) { service.getDoctorFreeSlots(widget.selectedDoctorID!, widget.selectedClinicID!, widget.projectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {
@ -473,7 +473,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
freeSlotsResponse = res['FreeTimeSlots']; freeSlotsResponse = res['FreeTimeSlots'];
_getJSONSlots().then((value) => { _getJSONSlots().then((value) => {
setState(() => { setState(() => {
_events.clear(), _events!.clear(),
_events = value, _events = value,
// if (widget.doctorSchedule != null) // if (widget.doctorSchedule != null)
// {_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])), _calendarController.selectedDate = DateUtil.convertStringToDate(widget.doctorSchedule['Date'])} // {_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])), _calendarController.selectedDate = DateUtil.convertStringToDate(widget.doctorSchedule['Date'])}
@ -499,36 +499,36 @@ class MeetingDataSource extends CalendarDataSource {
@override @override
DateTime getStartTime(int index) { DateTime getStartTime(int index) {
return _getMeetingData(index).from; return _getMeetingData(index)!.from!;
} }
@override @override
DateTime getEndTime(int index) { DateTime getEndTime(int index) {
return _getMeetingData(index).to; return _getMeetingData(index)!.to!;
} }
@override @override
String getSubject(int index) { String getSubject(int index) {
return _getMeetingData(index).eventName; return _getMeetingData(index)!.eventName;
} }
@override @override
Color getColor(int index) { Color getColor(int index) {
return _getMeetingData(index).background; return _getMeetingData(index)!.background;
} }
@override @override
bool isAllDay(int index) { bool isAllDay(int index) {
return _getMeetingData(index).isAllDay; return _getMeetingData(index)!.isAllDay;
} }
Meeting _getMeetingData(int index) { Meeting? _getMeetingData(int index) {
final dynamic meeting = appointments[index]; final dynamic meeting = appointments![index];
Meeting meetingData; Meeting? meetingData;
if (meeting is Meeting) { if (meeting is Meeting) {
meetingData = meeting; meetingData = meeting;
} }
return meetingData; return meetingData!;
} }
} }

@ -41,22 +41,22 @@ import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse; late PatientShareResponse patientShareResponse;
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = []; List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = []; List<OBGyneProcedureListResponse> obGyneAppoList = [];
var languageID; late var languageID;
MyInAppBrowser browser; late MyInAppBrowser browser;
bool isShowAppBar = true; bool isShowAppBar = true;
Function onBackClick; Function? onBackClick;
ToDo({@required this.isShowAppBar, this.onBackClick}); ToDo({required this.isShowAppBar, this.onBackClick});
@override @override
_ToDoState createState() => _ToDoState(); _ToDoState createState() => _ToDoState();
@ -66,16 +66,16 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
CountdownTimerController controller; late CountdownTimerController controller;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
TabController _tabController; late TabController _tabController;
String selectedPaymentMethod = ""; String selectedPaymentMethod = "";
String selectedInstallments = ""; String selectedInstallments = "";
String tamaraPaymentStatus; late String tamaraPaymentStatus;
String tamaraOrderID; late String tamaraOrderID;
bool dataLoaded = false; bool dataLoaded = false;
@ -116,7 +116,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
showNewAppBarTitle: true, showNewAppBarTitle: true,
icon: "assets/images/new/bottom_nav/todo.svg", icon: "assets/images/new/bottom_nav/todo.svg",
description: TranslationBase.of(context).infoTodo, description: TranslationBase.of(context).infoTodo,
onTap: widget.onBackClick, onTap: widget!.onBackClick,
backgroundColor: CustomColors.appBackgroudGrey2Color, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: Column( body: Column(
children: <Widget>[ children: <Widget>[
@ -192,7 +192,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
) )
: widget.appoList[index].isLiveCareAppointment : widget.appoList[index].isLiveCareAppointment!
? SvgPicture.asset("assets/images/new/virtual.svg") ? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"), : SvgPicture.asset("assets/images/new/hospital-visit.svg"),
), ),
@ -204,7 +204,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: Text( child: Text(
widget.appoList[index].clinicID == 265 widget.appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo ? TranslationBase.of(context).covidTestTodo
: widget.appoList[index].isLiveCareAppointment : widget.appoList[index].isLiveCareAppointment!
? TranslationBase.of(context).liveCareAppo ? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo, : TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
@ -213,8 +213,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
padding: const EdgeInsets.only(left: 8.0, right: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer( child: CountdownTimer(
controller: new CountdownTimerController( controller: new CountdownTimerController(
endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay! * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) { widgetBuilder: (_, CurrentRemainingTime? time) {
return time != null return time != null
? Text( ? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' +
@ -256,7 +256,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, widget.appoList[index].doctorTitle! + " " + widget.appoList[index].doctorNameObj!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -264,7 +264,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, name: widget.appoList[index].doctorTitle! + " " + widget.appoList[index].doctorNameObj!,
url: widget.appoList[index].doctorImageURL, url: widget.appoList[index].doctorImageURL,
width: 52, width: 52,
height: 52, height: 52,
@ -275,39 +275,60 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName!, projectViewModel.isArabic),
// MyRichText(TranslationBase.of(context).appointmentDate + ": ", // MyRichText(TranslationBase.of(context).appointmentDate + ": ",
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// Timezone changes // Timezone changes
widget.appoList[index].isLiveCareAppointment widget.appoList[index].isLiveCareAppointment!
? MyRichText( ? MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!)) +
" " + " " +
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!).toString().split(" ")[1].substring(0, 5),
projectViewModel.isArabic) projectViewModel.isArabic)
: MyRichText( : MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!)) +
" " + " " +
widget.appoList[index].startTime.substring(0, 5), widget.appoList[index].startTime!.substring(0, 5),
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName!, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( // RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(), // initialRating: widget.appoList[index].actualDoctorRate!.toDouble(),
size: 16.0, // size: 16.0,
filledColor: Color(0XFFD02127), // filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), // emptyColor: Color(0XFFD02127),
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: Icons.star,
emptyIcon: Icons.star_border, // emptyIcon: Icons.star_border,
// ),
RatingBar(
initialRating: widget.appoList[index].actualDoctorRate!.toDouble(),
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,
), ),
], ],
), ),
@ -354,7 +375,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier( child: AppExpandableNotifier(
isExpand: true, isExpand: true,
hasCounter: true, hasCounter: true,
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0", counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList!.length.toString() : "0",
title: TranslationBase.of(context).anicllaryOrders, title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: widget.ancillaryLists.length != 0 bodyWidget: widget.ancillaryLists.length != 0
? Container( ? Container(
@ -365,18 +386,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
reverse: true, reverse: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList![index], widget.ancillaryLists[0].projectID),
isInOutPatient: true, isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), billNo: widget.ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName, subName: widget.ancillaryLists[0].projectName,
isLiveCareAppointment: false, isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate), date: DateUtil.convertStringToDate(widget.ancillaryLists[0]!.ancillaryOrderList![index].orderDate!),
isSortByClinic: true, isSortByClinic: true,
); );
}, },
itemCount: widget.ancillaryLists[0].ancillaryOrderList.length, itemCount: widget.ancillaryLists[0].ancillaryOrderList!.length,
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
), ),
) )
@ -430,7 +451,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Container( Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]); getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID!, widget.obGyneAppoList[index].setupID!, widget.obGyneAppoList[index]);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -451,7 +472,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -459,7 +480,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName!,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52, width: 52,
height: 52, height: 52,
@ -470,12 +491,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
MyRichText( MyRichText(
TranslationBase.of(context).orderDate + ": ", TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0], DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate!)).split(" ")[0],
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
], ],
), ),
), ),
@ -781,7 +802,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
@ -848,7 +869,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) { checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.checkPatientNphiesEligibility(appo.projectID).then((res) { service.checkPatientNphiesEligibility(appo.projectID!).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res["isNphiesMatchedWithVida"]) { if (res["isNphiesMatchedWithVida"]) {
getPatientShare(context, appo); getPatientShare(context, appo);
@ -878,7 +899,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
void continueAsCash(AppoitmentAllHistoryResultList appo) { void continueAsCash(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.convertPatientToCash(appo.projectID).then((res) { service.convertPatientToCash(appo.projectID!).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) { if (res["MessageStatus"] == 1) {
getPatientShare(context, appo); getPatientShare(context, appo);
@ -895,11 +916,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
String errorMsg = ""; String errorMsg = "";
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) { if (appo.isLiveCareAppointment!) {
getLiveCareAppointmentPatientShare(context, service, appo); getLiveCareAppointmentPatientShare(context, service, appo);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID!, appo.projectID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
isInsured = res["IsInsured"]; isInsured = res["IsInsured"];
@ -938,7 +959,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) { getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID!, appo.projectID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
@ -1002,7 +1023,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( child: Opacity(
opacity: a1.value, opacity: a1.value,
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse), child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, onPaymentMethodSelected: (){},),
), ),
); );
}, },
@ -1010,10 +1031,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
barrierDismissible: false, barrierDismissible: false,
barrierLabel: '', barrierLabel: '',
context: context, context: context,
pageBuilder: (context, animation1, animation2) {}) pageBuilder: (context, animation1, animation2) { return SizedBox();})
.then((value) { .then((value) {
if (value != null) { if (value != null) {
navigateToPaymentMethod(context, value, appo); navigateToPaymentMethod(context, value as PatientShareResponse, appo);
projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo); projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo);
} else { } else {
projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo); projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo);
@ -1029,18 +1050,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!),
appo.projectID.toString(), appo.projectID.toString(),
authenticatedUser.emailAddress, authenticatedUser.emailAddress!,
paymentMethod[0], paymentMethod[0],
authenticatedUser.patientType, authenticatedUser.patientType,
authenticatedUser.firstName, authenticatedUser.firstName!,
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
appo.isLiveCareAppointment, appo.isLiveCareAppointment!,
"2", "2",
appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", appo.isLiveCareAppointment! ? widget.patientShareResponse.clinicID.toString() : "",
context, context,
appo.appointmentDate, appo.appointmentDate,
appo.appointmentNo, appo.appointmentNo,
@ -1056,12 +1077,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url); Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status']; tamaraPaymentStatus = uri.queryParameters['status']!;
tamaraOrderID = uri.queryParameters['AuthorizePaymentId']; tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
} else { } else {
Uri uri = new Uri.dataFromString(url); Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus']; tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
tamaraOrderID = uri.queryParameters['orderId']; tamaraOrderID = uri.queryParameters['orderId']!;
} }
} }
@ -1089,7 +1110,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// } else { // } else {
@ -1106,10 +1127,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
service.getTamaraPaymentStatus(orderID).then((res) { service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") { if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo); updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], int.parse(selectedInstallments!), appo);
} else { } else {
updateTamaraRequestStatus( updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); "Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "", int.parse(selectedInstallments!), appo);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -1158,9 +1179,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
"AppointmentDate": appo.appointmentDate.toString(), "AppointmentDate": appo.appointmentDate.toString(),
}; };
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.markAppointmentForTamara(appo.projectID, appo.appointmentNo.toString()).then((res) { service.markAppointmentForTamara(appo.projectID!, appo.appointmentNo.toString()).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment) if (appo.isLiveCareAppointment!)
addVIDARequestInsert("0", tamaraOrderID, appo); addVIDARequestInsert("0", tamaraOrderID, appo);
else else
getAppoQR(context, appo); getAppoQR(context, appo);
@ -1173,12 +1194,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
String txn_ref; String txn_ref;
num amount; num? amount;
String payment_method; String? payment_method;
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
@ -1192,10 +1213,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.appointment.payment_fail( projectViewModel.analytics.appointment.payment_fail(
appointment_type: 'regular', appointment_type: 'regular',
payment_method: payment_method, payment_method: payment_method!,
clinic: appo.clinicName, clinic: appo.clinicName,
hospital: appo.projectName, hospital: appo.projectName,
txn_amount: "$amount", txn_amount: "$amount!",
txn_currency: currency, txn_currency: currency,
error_type: res['Response_Message']); error_type: res['Response_Message']);
} }
@ -1212,7 +1233,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
addAdvancedNumberRequest( addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID) Utils.isVidaPlusProject(projectViewModel, appo.projectID!)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference, paymentReference,
@ -1230,7 +1251,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) { service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (appo.isLiveCareAppointment) if (appo.isLiveCareAppointment!)
addVIDARequestInsert(advanceNumber, paymentReference, appo); addVIDARequestInsert(advanceNumber, paymentReference, appo);
else else
getAppoQR(context, appo); getAppoQR(context, appo);
@ -1244,8 +1265,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, .insertVIDARequest(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.serviceID!, appo.doctorID!, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
@ -1260,7 +1281,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
context, context,
FadePage( FadePage(
page: PaymentMethod( page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {}); setState(() {});
}, },
patientShare: widget.patientShareResponse.patientShareWithTax))) patientShare: widget.patientShareResponse.patientShareWithTax)))
@ -1271,8 +1292,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
if (value != null) { if (value != null) {
final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular'; final appType = appo.isLiveCareAppointment! ? 'livecare' : 'regular';
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); openPayment(value, projectViewModel.user!, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment'); projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment');
} }
}); });
@ -1281,11 +1302,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) { service.confirmAppointment(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.isLiveCareAppointment!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
if (appo.isLiveCareAppointment) { if (appo.isLiveCareAppointment!) {
insertLiveCareVIDARequest(appo); insertLiveCareVIDARequest(appo);
} else { } else {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
@ -1304,8 +1325,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, .insertVIDARequest(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.serviceID!, appo.doctorID!, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/core/model/my_balance/tamara_installment_details.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/tamara_installment_details.dart';
@ -14,10 +15,10 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod; Function? onSelectedMethod;
bool isShowInstallments; bool? isShowInstallments;
num patientShare; num? patientShare;
bool isFromAdvancePayment; bool? isFromAdvancePayment;
PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false, this.patientShare, this.isFromAdvancePayment = false}); PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false, this.patientShare, this.isFromAdvancePayment = false});
@ -27,13 +28,13 @@ class PaymentMethod extends StatefulWidget {
class _PaymentMethodState extends State<PaymentMethod> { class _PaymentMethodState extends State<PaymentMethod> {
String selectedPaymentMethod = "MADA"; String selectedPaymentMethod = "MADA";
TamaraInstallmentDetails tamaraInstallmentDetails; TamaraInstallmentDetails? tamaraInstallmentDetails;
String selectedInstallmentPlan; String? selectedInstallmentPlan;
num minTamaraLimit = 0; num minTamaraLimit = 0;
num maxTamaraLimit = 0; num maxTamaraLimit = 0;
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
void initState() { void initState() {
@ -64,7 +65,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
margin: EdgeInsets.fromLTRB(4, 15.0, 4, 0.0), margin: EdgeInsets.fromLTRB(4, 15.0, 4, 0.0),
child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)), child: Text(TranslationBase.of(context).selectPaymentOption, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold)),
), ),
if (projectViewModel.havePrivilege(86)) if (projectViewModel!.havePrivilege(86))
Container( Container(
width: double.infinity, width: double.infinity,
child: InkWell( child: InkWell(
@ -114,7 +115,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
if (projectViewModel.havePrivilege(87)) if (projectViewModel!.havePrivilege(87))
Container( Container(
width: double.infinity, width: double.infinity,
child: InkWell( child: InkWell(
@ -164,7 +165,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
if (projectViewModel.havePrivilege(88)) if (projectViewModel!.havePrivilege(88))
Container( Container(
width: double.infinity, width: double.infinity,
child: InkWell( child: InkWell(
@ -214,7 +215,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
if (projectViewModel.havePrivilege(90) && !widget.isFromAdvancePayment && widget.patientShare >= minTamaraLimit && widget.patientShare <= maxTamaraLimit) if (projectViewModel!.havePrivilege(90) && !widget.isFromAdvancePayment! && widget.patientShare! >= minTamaraLimit && widget.patientShare! <= maxTamaraLimit)
Container( Container(
width: double.infinity, width: double.infinity,
child: InkWell( child: InkWell(
@ -243,7 +244,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
height: 60.0, height: 60.0,
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
width: 60, width: 60,
child: projectViewModel.isArabic ? Image.asset("assets/images/new/payment/tamara_ar.png") : Image.asset("assets/images/new/payment/tamara_en.png"), child: projectViewModel!.isArabic ? Image.asset("assets/images/new/payment/tamara_ar.png") : Image.asset("assets/images/new/payment/tamara_en.png"),
), ),
mFlex(1), mFlex(1),
if (selectedPaymentMethod == "TAMARA") if (selectedPaymentMethod == "TAMARA")
@ -264,7 +265,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
if (widget.isShowInstallments && projectViewModel.havePrivilege(91)) if (widget.isShowInstallments! && projectViewModel!.havePrivilege(91))
Container( Container(
width: double.infinity, width: double.infinity,
child: InkWell( child: InkWell(
@ -315,7 +316,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
(Platform.isIOS && projectViewModel.havePrivilege(89)) (Platform.isIOS && projectViewModel!.havePrivilege(89))
? Container( ? Container(
width: double.infinity, width: double.infinity,
child: InkWell( child: InkWell(
@ -402,7 +403,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
Column( Column(
children: [ children: [
...List.generate( ...List.generate(
tamaraInstallmentDetails.supportedInstalments.length, tamaraInstallmentDetails!.supportedInstalments!.length,
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -416,14 +417,14 @@ class _PaymentMethodState extends State<PaymentMethod> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
selectedInstallmentPlan = tamaraInstallmentDetails.supportedInstalments[index].instalments.toString(); selectedInstallmentPlan = tamaraInstallmentDetails!.supportedInstalments![index].instalments.toString();
// getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); // getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
}); });
}, },
child: Row( child: Row(
children: [ children: [
Radio( Radio(
value: tamaraInstallmentDetails.supportedInstalments[index].instalments.toString(), value: tamaraInstallmentDetails!.supportedInstalments![index].instalments.toString(),
groupValue: selectedInstallmentPlan, groupValue: selectedInstallmentPlan,
activeColor: Colors.red[800], activeColor: Colors.red[800],
toggleable: true, toggleable: true,
@ -435,7 +436,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
}, },
), ),
Text( Text(
tamaraInstallmentDetails.supportedInstalments[index].instalments.toString() + " " + TranslationBase.of(context).installments, tamaraInstallmentDetails!.supportedInstalments![index].instalments.toString() + " " + TranslationBase.of(context).installments,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -467,7 +468,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12),
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
widget.onSelectedMethod(selectedPaymentMethod, selectedInstallmentPlan); widget.onSelectedMethod!(selectedPaymentMethod, selectedInstallmentPlan);
Navigator.pop(context, [selectedPaymentMethod, selectedInstallmentPlan]); Navigator.pop(context, [selectedPaymentMethod, selectedInstallmentPlan]);
}, },
child: Text(TranslationBase.of(context).confirm.toUpperCase(), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, color: Colors.white)), child: Text(TranslationBase.of(context).confirm.toUpperCase(), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, color: Colors.white)),
@ -494,7 +495,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12),
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
widget.onSelectedMethod(selectedPaymentMethod, selectedInstallmentPlan); widget.onSelectedMethod!(selectedPaymentMethod, selectedInstallmentPlan);
Navigator.pop(context, [selectedPaymentMethod, selectedInstallmentPlan]); Navigator.pop(context, [selectedPaymentMethod, selectedInstallmentPlan]);
}, },
child: Text(TranslationBase.of(context).confirm.toUpperCase(), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, color: Colors.white)), child: Text(TranslationBase.of(context).confirm.toUpperCase(), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, color: Colors.white)),
@ -517,15 +518,15 @@ class _PaymentMethodState extends State<PaymentMethod> {
getTamaraPaymentDetails() { getTamaraPaymentDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentDetails(context).then((res) { service.getTamaraPaymentDetails(context).then((Map<String, dynamic> res) {
tamaraInstallmentDetails = TamaraInstallmentDetails.fromJson(res); tamaraInstallmentDetails = TamaraInstallmentDetails.fromJson(res);
print(tamaraInstallmentDetails.name); print(tamaraInstallmentDetails!.name!);
minTamaraLimit = tamaraInstallmentDetails.supportedInstalments[0].minLimit.amount; minTamaraLimit = tamaraInstallmentDetails!.supportedInstalments![0].minLimit!.amount!;
maxTamaraLimit = tamaraInstallmentDetails.supportedInstalments[0].maxLimit.amount; maxTamaraLimit = tamaraInstallmentDetails!.supportedInstalments![0].maxLimit!.amount!;
selectedInstallmentPlan = tamaraInstallmentDetails.supportedInstalments[0].instalments.toString(); selectedInstallmentPlan = tamaraInstallmentDetails!.supportedInstalments![0].instalments.toString();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() {}); setState(() {});
}).catchError((err) { } as FutureOr Function(Map value)).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}); });

@ -11,12 +11,12 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class PaymentDialog extends StatefulWidget { class PaymentDialog extends StatefulWidget {
AppoitmentAllHistoryResultList appo; late AppoitmentAllHistoryResultList appo;
PatientShareResponse patientShareResponse; late PatientShareResponse? patientShareResponse;
final Function onPaymentMethodSelected; late final Function onPaymentMethodSelected;
PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse}); PaymentDialog({required this.appo, required this.onPaymentMethodSelected, this.patientShareResponse});
@override @override
_PaymentDialogState createState() => _PaymentDialogState(); _PaymentDialogState createState() => _PaymentDialogState();
@ -41,9 +41,9 @@ class _PaymentDialogState extends State<PaymentDialog> {
color: Color(0xff2B353E), color: Color(0xff2B353E),
), ),
), ),
Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600,letterSpacing: -0.64)), Text(widget.appo.doctorTitle! + " " + widget.appo.doctorNameObj!, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600,letterSpacing: -0.64)),
Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), Text(getDate(widget.appo.appointmentDate!), style: getTextStyle()),
Text(widget.appo.projectName, style: getTextStyle()), Text(widget.appo.projectName!, style: getTextStyle()),
Divider( Divider(
color: Colors.grey, color: Colors.grey,
), ),
@ -51,15 +51,15 @@ class _PaymentDialogState extends State<PaymentDialog> {
children: [ children: [
TableRow(decoration: BoxDecoration(), children: [ TableRow(decoration: BoxDecoration(), children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())), TableCell(child: _getNormalText(widget.patientShareResponse!.patientShare!.toString())),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)), TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())), TableCell(child: _getNormalText(widget.patientShareResponse!.patientTaxAmount!.toString())),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)), TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())), TableCell(child: _getNormalText(widget.patientShareResponse!.patientShareWithTax!.toString())),
]), ]),
], ],
), ),

@ -6,9 +6,9 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class TodoListCard extends StatefulWidget { class TodoListCard extends StatefulWidget {
TodoListCard(); TodoListCard();
@ -111,16 +111,34 @@ class _TodoListCardState extends State<TodoListCard> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( RatingBar(
initialRating: 4.5, initialRating: 4.6,
size: 16.0, direction: Axis.horizontal,
filledColor: Color(0XFFD02127), allowHalfRating: true,
emptyColor: Color(0XFFD02127), itemCount: 5,
isHalfAllowed: true, itemSize: 20,
halfFilledIcon: Icons.star_half, ignoreGestures: true,
filledIcon: Icons.star, ratingWidget: RatingWidget(
emptyIcon: Icons.star_border, 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);
},
)
// RatingBar.readOnly(
// initialRating: 4.5,
// size: 16.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star_border,
// ),
], ],
), ),
], ],

@ -48,7 +48,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
}); });
} }
changeCurrentTab(int tab) { void changeCurrentTab(int tab) {
if (pageController.hasClients) { if (pageController.hasClients) {
setState(() { setState(() {
currentTab = tab; currentTab = tab;

@ -47,7 +47,7 @@ class AllergiesPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).remarks+" :"), Texts(TranslationBase.of(context).remarks+" :"),
Texts(TranslationBase.of(context).description + ": " + model.allergies[index].description ?? ''), Texts(TranslationBase.of(context).description + ": " + model.allergies[index].description! ?? ''),
], ],
), ),
) )

@ -13,8 +13,8 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class MedicalProfilePageNew extends StatefulWidget { class MedicalProfilePageNew extends StatefulWidget {
Function onTap; Function? onTap;
String a; String? a;
MedicalProfilePageNew({this.onTap}); MedicalProfilePageNew({this.onTap});
@override @override
_MedicalProfilePageState createState() => _MedicalProfilePageState(); _MedicalProfilePageState createState() => _MedicalProfilePageState();
@ -23,13 +23,13 @@ class MedicalProfilePageNew extends StatefulWidget {
class _MedicalProfilePageState extends State<MedicalProfilePageNew> { class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
var authProvider = new AuthProvider(); var authProvider = new AuthProvider();
List<Medical> medical =[]; List<Medical> medical =[];
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget1) => AppScaffold( builder: (_, model, widget1) => AppScaffold(
@ -46,7 +46,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList), TimeLineView(model.isLogin, projectViewModel!.isArabic, model.appoitmentAllHistoryResultList),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
@ -55,17 +55,17 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
projectViewModel.isLogin projectViewModel!.isLogin
? Text( ? Text(
projectViewModel?.user?.firstName ?? "", projectViewModel?.user?.firstName ?? "",
style: TextStyle(color: Colors.black, fontSize: SizeConfig.textMultiplier * 1.8), style: TextStyle(color: Colors.black, fontSize: SizeConfig.textMultiplier! * 1.8),
) )
: Container(), : Container(),
Text( Text(
TranslationBase.of(context).medicalFileTitle, TranslationBase.of(context).medicalFileTitle,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
@ -102,10 +102,10 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
} }
class Medical { class Medical {
final String title; final String? title;
final String imagePath; final String? imagePath;
final String subTitle; final String? subTitle;
final Widget page; final Widget? page;
Medical({this.title, this.imagePath, this.subTitle, this.page}); Medical({this.title, this.imagePath, this.subTitle, this.page});
} }

@ -59,12 +59,12 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
name: model.sickLeaveList[index].doctorName, name: model.sickLeaveList[index].doctorName,
date: model.sickLeaveList[index].appointmentDate, date: model.sickLeaveList[index].appointmentDate,
profileUrl: model.sickLeaveList[index].doctorImageURL, profileUrl: model.sickLeaveList[index].doctorImageURL,
rating: model.sickLeaveList[index].actualDoctorRate.toDouble(), rating: model.sickLeaveList[index].actualDoctorRate!.toDouble(),
subName: model.sickLeaveList[index].clinicName, subName: model.sickLeaveList[index].clinicName,
isSortByClinic: false, isSortByClinic: false,
isInOutPatient: model.sickLeaveList[index].isInOutPatient, isInOutPatient: model.sickLeaveList[index].isInOutPatient,
isSickLeave: true, isSickLeave: true,
sickLeaveStatus: model.sickLeaveList[index].status, sickLeaveStatus: model.sickLeaveList[index].status!,
onEmailTap: () { onEmailTap: () {
showConfirmMessage(model, index); showConfirmMessage(model, index);
}, },
@ -76,7 +76,7 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
void showConfirmMessage(PatientSickLeaveViewMode model, int index) { void showConfirmMessage(PatientSickLeaveViewMode model, int index) {
if (model.sickLeaveList[index].status == 1) { if (model.sickLeaveList[index].status == 1) {
openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo!, model.sickLeaveList[index]!.setupID!, model, index, model.sickLeaveList[index]!.projectID!);
} else if (model.sickLeaveList[index].status == 2) { } else if (model.sickLeaveList[index].status == 2) {
showEmailDialog(model, index); showEmailDialog(model, index);
} else { } else {
@ -101,15 +101,15 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model.user.emailAddress, email: model.user!.emailAddress!,
onTapSendEmail: () { onTapSendEmail: () {
model.sendSickLeaveEmail( model.sendSickLeaveEmail(
message: TranslationBase.of(context).emailSentSuccessfully, message: TranslationBase.of(context).emailSentSuccessfully,
requestNo: model.sickLeaveList[index].requestNo, requestNo: model.sickLeaveList[index].requestNo!,
doctorName: model.sickLeaveList[index].doctorName, doctorName: model.sickLeaveList[index].doctorName!,
projectName: model.sickLeaveList[index].projectName, projectName: model.sickLeaveList[index].projectName!,
setupID: model.sickLeaveList[index].setupID, setupID: model.sickLeaveList[index].setupID!,
projectID: model.sickLeaveList[index].projectID); projectID: model.sickLeaveList[index].projectID!);
model.getSickLeave(); model.getSickLeave();
}, },
), ),
@ -130,7 +130,7 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
LabsService service = new LabsService(); LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getSickLeaveStatusByAdmissionNo(model.sickLeaveList[index].projectID, model.sickLeaveList[index].admissionNo).then((res) { service.getSickLeaveStatusByAdmissionNo(model.sickLeaveList[index]!.projectID!, model.sickLeaveList[index].admissionNo!).then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res != null && res["List_GetSickLeaveStatusByAdmissionNo"] != null) { if (res != null && res["List_GetSickLeaveStatusByAdmissionNo"] != null) {

@ -28,9 +28,9 @@ import 'package:provider/provider.dart';
class PrescriptionDetailsPage extends StatefulWidget { class PrescriptionDetailsPage extends StatefulWidget {
final PrescriptionReport? prescriptionReport; final PrescriptionReport? prescriptionReport;
final Prescriptions prescriptions; final Prescriptions? prescriptions;
PrescriptionDetailsPage({Key? key, this.prescriptionReport, required this.prescriptions}); PrescriptionDetailsPage({Key? key, this.prescriptionReport, this.prescriptions});
@override @override
_PrescriptionDetailsPageState createState() => _PrescriptionDetailsPageState(); _PrescriptionDetailsPageState createState() => _PrescriptionDetailsPageState();
@ -61,18 +61,18 @@ class _PrescriptionDetailsPageState extends State<PrescriptionDetailsPage> {
children: <Widget>[ children: <Widget>[
DoctorHeader( DoctorHeader(
headerModel: HeaderModel( headerModel: HeaderModel(
widget.prescriptions.doctorName!, widget.prescriptions!.doctorName!,
widget.prescriptions.doctorID!, widget.prescriptions!.doctorID!,
widget.prescriptions.doctorImageURL!, widget.prescriptions!.doctorImageURL!,
widget.prescriptions.speciality!, widget.prescriptions!.speciality!,
"", "",
widget.prescriptions.name!, widget.prescriptions!.name!,
DateUtil.convertStringToDate(widget.prescriptions.appointmentDate!), DateUtil.convertStringToDate(widget.prescriptions!.appointmentDate!),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.prescriptions.appointmentDate!)), DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.prescriptions!.appointmentDate!)),
widget.prescriptions.nationalityFlagURL!, widget.prescriptions!.nationalityFlagURL!,
widget.prescriptions.doctorRate, widget.prescriptions!.doctorRate,
widget.prescriptions.actualDoctorRate, widget.prescriptions!.actualDoctorRate,
widget.prescriptions.noOfPatientsRate, widget.prescriptions!.noOfPatientsRate,
"", "",
), ),
isNeedToShowButton: false, isNeedToShowButton: false,

@ -17,7 +17,7 @@ class WorkplaceUpdatePage extends StatefulWidget {
final String setupID; final String setupID;
final int projectID; final int projectID;
WorkplaceUpdatePage({@required this.requestNumber, @required this.setupID, @required this.projectID}); WorkplaceUpdatePage({required this.requestNumber, required this.setupID, required this.projectID});
@override @override
_WorkplaceUpdatePageState createState() => _WorkplaceUpdatePageState(); _WorkplaceUpdatePageState createState() => _WorkplaceUpdatePageState();
@ -25,8 +25,8 @@ class WorkplaceUpdatePage extends StatefulWidget {
class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> { class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
TextEditingController workplaceName = new TextEditingController(); TextEditingController workplaceName = new TextEditingController();
bool _isButtonDisabled; bool? _isButtonDisabled;
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
void initState() { void initState() {
@ -83,7 +83,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
height: 50, height: 50,
elevation: 0, elevation: 0,
color: CustomColors.accentColor, color: CustomColors.accentColor,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), disabledColor:Colors.grey.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text( child: Text(
TranslationBase.of(context).submit, TranslationBase.of(context).submit,
@ -109,7 +109,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
); );
} }
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( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -145,7 +145,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
keyboardType: TextInputType.name, keyboardType: TextInputType.name,
controller: _controller, controller: _controller,
inputFormatters: [ inputFormatters: [
projectViewModel.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")), projectViewModel!.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")),
], ],
onChanged: (value) => {_onPassportTextChanged(value)}, onChanged: (value) => {_onPassportTextChanged(value)},
style: TextStyle( style: TextStyle(
@ -211,7 +211,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
var messageAr = "اسم مكان العمل الذي أدخلته هو: " + workplaceName.text + ". يرجى تأكيد!"; var messageAr = "اسم مكان العمل الذي أدخلته هو: " + workplaceName.text + ". يرجى تأكيد!";
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: projectViewModel.isArabic ? messageAr : messageEn, confirmMessage: projectViewModel!.isArabic ? messageAr : messageEn,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () { okFunction: () {
@ -227,7 +227,7 @@ class _WorkplaceUpdatePageState extends State<WorkplaceUpdatePage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.updateWorkplaceName(projectViewModel.isArabic ? "-" : workplaceName.text, projectViewModel.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID) .updateWorkplaceName(projectViewModel!.isArabic ? "-" : workplaceName.text, projectViewModel!.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(true); Navigator.of(context).pop(true);

@ -11,7 +11,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart' as grid_view;
import 'CreateCustomerDailogPage.dart'; import 'CreateCustomerDailogPage.dart';
@ -20,24 +20,24 @@ dynamic languageID;
class ClinicPackagesPage extends StatefulWidget { class ClinicPackagesPage extends StatefulWidget {
List<PackagesResponseModel> products; List<PackagesResponseModel> products;
ClinicPackagesPage({@required this.products}); ClinicPackagesPage({required this.products});
@override @override
_ClinicPackagesPageState createState() => _ClinicPackagesPageState(); _ClinicPackagesPageState createState() => _ClinicPackagesPageState();
} }
class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage> { class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage> {
AppScaffold appScaffold; AppScaffold? appScaffold;
List<PackagesResponseModel> get _products => widget.products; List<PackagesResponseModel> get _products => widget.products;
PackagesViewModel viewModel; PackagesViewModel? viewModel;
onProductCartClick(PackagesResponseModel product) async { onProductCartClick(PackagesResponseModel product) async {
if (viewModel.service.customer == null) viewModel.service.customer = await CreateCustomerDialogPage(context: context).show(); if (viewModel!.service.customer == null) viewModel!.service.customer = await CreateCustomerDialogPage(context: context).show();
if (viewModel.service.customer != null) { if (viewModel!.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id); var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel!.service!.customer!.id);
await viewModel.service.addProductToCart(request, context: context).then((response) { await viewModel!.service.addProductToCart(request, context: context).then((response) {
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
}); });
@ -74,7 +74,7 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayou
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: Padding( body: Padding(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
child: StaggeredGridView.countBuilder( child:grid_view.AlignedGridView.count(
crossAxisCount: 4, crossAxisCount: 4,
itemCount: _products.length, itemCount: _products.length,
itemBuilder: (BuildContext context, int index) => new Container( itemBuilder: (BuildContext context, int index) => new Container(
@ -82,9 +82,9 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayou
child: PackagesItemCard( child: PackagesItemCard(
itemContentPadding: 10, itemContentPadding: 10,
itemModel: _products[index], itemModel: _products[index],
onCartClick: OFFERS_VIEW_ONLY ? onProductCartClick : null, onCartClick: OFFERS_VIEW_ONLY ? onProductCartClick : (PackagesResponseModel){},
)), )),
staggeredTileBuilder: (int index) => StaggeredTile.fit(2), // staggeredTileBuilder: (int index) => StaggeredTile.fit(2),
mainAxisSpacing: 20, mainAxisSpacing: 20,
crossAxisSpacing: 10, crossAxisSpacing: 10,
)), )),

@ -16,17 +16,17 @@ dynamic languageID;
var emailRegex = RegExp(r'^[^\s@]+@[^\s@]+\.[^\s@]+$'); var emailRegex = RegExp(r'^[^\s@]+@[^\s@]+\.[^\s@]+$');
class CreateCustomerDialogPage extends StatefulWidget { class CreateCustomerDialogPage extends StatefulWidget {
final BuildContext context; final BuildContext? context;
CreateCustomerDialogPage({this.context}); CreateCustomerDialogPage({this.context});
PackagesViewModel viewModel; PackagesViewModel? viewModel;
Future<PackagesCustomerResponseModel> show() async{ Future<PackagesCustomerResponseModel?> show() async{
await showDialog(context: context, builder: (context ){ await showDialog(context: context!, builder: (context ){
return AlertDialog(content: this, shape: RoundedRectangleBorder( return AlertDialog(content: this, shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20) borderRadius: BorderRadius.circular(20)
), elevation: 5, ); ), elevation: 5, );
}); });
return viewModel.service.customer; return viewModel!.service!.customer;
} }
@override @override
@ -35,8 +35,8 @@ class CreateCustomerDialogPage extends StatefulWidget {
} }
class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> with AfterLayoutMixin<CreateCustomerDialogPage>, TickerProviderStateMixin{ class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> with AfterLayoutMixin<CreateCustomerDialogPage>, TickerProviderStateMixin{
AnimationController _loadingController; AnimationController? _loadingController;
AnimationController _submitController; AnimationController? _submitController;
bool _enableInput = true; bool _enableInput = true;
Interval _nameTextFieldLoadingAnimationInterval = const Interval(0, .85); Interval _nameTextFieldLoadingAnimationInterval = const Interval(0, .85);
@ -61,7 +61,7 @@ class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> wit
bool verifyPin = false; bool verifyPin = false;
PackagesViewModel viewModel() => widget.viewModel; PackagesViewModel viewModel() => widget.viewModel!;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -74,14 +74,14 @@ class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> wit
} }
Widget verifyPinWidget(){ Widget verifyPinWidget(){
return SizedBox();
} }
Widget userDetailWidget(){ Widget userDetailWidget(){
return return
Container( Container(
width: SizeConfig.realScreenWidth * 0.8, width: SizeConfig.realScreenWidth! * 0.8,
height: 270, height: 270,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -105,7 +105,7 @@ class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> wit
FocusScope.of(context).requestFocus(_phoneFocusNode); FocusScope.of(context).requestFocus(_phoneFocusNode);
}, },
validator: (value){ validator: (value){
return (value.isEmpty || !emailRegex.hasMatch(value)) return (value!.isEmpty || !emailRegex.hasMatch(value))
? 'Invalid email!' ? 'Invalid email!'
: null; : null;
}, },
@ -126,7 +126,7 @@ class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> wit
FocusScope.of(context).requestFocus(_phoneFocusNode); FocusScope.of(context).requestFocus(_phoneFocusNode);
}, },
validator: (value){ validator: (value){
return (value.isEmpty || !emailRegex.hasMatch(value)) return (value!.isEmpty || !emailRegex.hasMatch(value))
? 'Invalid email!' ? 'Invalid email!'
: null; : null;
}, },
@ -136,7 +136,7 @@ class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> wit
AnimatedButton( AnimatedButton(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
loadingColor: Theme.of(context).primaryColor, loadingColor: Theme.of(context).primaryColor,
controller: _submitController, controller: _submitController!,
text: TranslationBase.of(context).done, text: TranslationBase.of(context).done,
onPressed: (){ onPressed: (){
createCustomer(); createCustomer();
@ -173,7 +173,7 @@ class _CreateCustomerDialogPageState extends State<CreateCustomerDialogPage> wit
} }
loading(bool can){ loading(bool can){
can ? _submitController.forward() : _submitController.reverse(); can ? _submitController!.forward() : _submitController!.reverse();
} }
} }

@ -9,22 +9,23 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:expandable/expandable.dart'; import 'package:expandable/expandable.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:html/parser.dart'; import 'package:html/parser.dart';
import 'package:rating_bar/rating_bar.dart';
class OfferAndPackagesDetail extends StatefulWidget { class OfferAndPackagesDetail extends StatefulWidget {
final PackagesResponseModel itemModel; final PackagesResponseModel itemModel;
final Function(PackagesResponseModel product) onCartClick; final Function(PackagesResponseModel product) onCartClick;
bool showAddToCartFooter = true; bool showAddToCartFooter = true;
OfferAndPackagesDetail({@required this.itemModel, @required this.onCartClick, Key key}) : super(key: key); OfferAndPackagesDetail({required this.itemModel, required this.onCartClick, Key? key}) : super(key: key);
@override @override
State<StatefulWidget> createState() => OfferAndPackagesDetailState(); State<StatefulWidget> createState() => OfferAndPackagesDetailState();
} }
class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> { class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
PackagesViewModel viewModel; PackagesViewModel? viewModel;
bool expandFlag = false; bool expandFlag = false;
var controller = new ExpandableController(); var controller = new ExpandableController();
@ -34,7 +35,7 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
final images = widget.itemModel.images ?? []; final images = widget.itemModel.images ?? [];
String image = ""; String image = "";
if(images.isNotEmpty) if(images.isNotEmpty)
image = widget.itemModel.images.first.src ?? ""; image = widget.itemModel.images!.first.src ?? "";
return BaseView<PackagesViewModel>( return BaseView<PackagesViewModel>(
onModelReady: (model) { onModelReady: (model) {
@ -79,28 +80,46 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
widget.itemModel.name, widget.itemModel.name!,
maxLines: 1, maxLines: 1,
style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.bold, color: Color(0xff2E303A), letterSpacing: -1.14), style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.bold, color: Color(0xff2E303A), letterSpacing: -1.14),
), ),
Text( Text(
widget.itemModel.shortDescription, widget.itemModel.shortDescription!,
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -.56), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -.56),
), ),
SizedBox(height: 9), SizedBox(height: 9),
Row( Row(
children: [ children: [
RatingBar.readOnly( // RatingBar.readOnly(
// initialRating: 4.5,
// // todo ask haroon about rating value
// size: 18.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star_border,
// ),
RatingBar(
initialRating: 4.5, initialRating: 4.5,
// todo ask haroon about rating value direction: Axis.horizontal,
size: 18.0, allowHalfRating: true,
filledColor: Color(0XFFD02127), itemCount: 5,
emptyColor: Color(0XFFD02127), itemSize: 20,
isHalfAllowed: true, ignoreGestures: true,
halfFilledIcon: Icons.star_half, ratingWidget: RatingWidget(
filledIcon: Icons.star, full: Icon(Icons.star),
emptyIcon: Icons.star_border, half: Icon(Icons.star_half),
), empty: Icon(Icons.star),
),
tapOnlyMode: true,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
},
)
], ],
), ),
SizedBox(height: 16), SizedBox(height: 16),
@ -110,12 +129,12 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: widget.itemModel.storeNames.length, itemCount: widget.itemModel.storeNames!.length,
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return mWidth(5.0); return mWidth(5.0);
}, },
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return contactButton(widget.itemModel.storeNames[index].toString()); return contactButton(widget.itemModel.storeNames![index].toString());
}, },
), ),
), ),
@ -133,7 +152,7 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
scrollOnExpand: true, scrollOnExpand: true,
scrollOnCollapse: false, scrollOnCollapse: false,
child: ExpandablePanel( child: ExpandablePanel(
hasIcon: false,
theme: const ExpandableThemeData( theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center, headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true, tapBodyToCollapse: true,
@ -170,7 +189,7 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
collapsed: collapsed, collapsed: collapsed,
expanded: Padding( expanded: Padding(
padding: const EdgeInsets.only(bottom: 21, left: 21, right: 21), padding: const EdgeInsets.only(bottom: 21, left: 21, right: 21),
child: Text(parseHtmlString(widget.itemModel.fullDescription), child: Text(parseHtmlString(widget.itemModel.fullDescription!),
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -181,7 +200,7 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
), ),
theme: const ExpandableThemeData(crossFadePoint: 0), theme: const ExpandableThemeData(crossFadePoint: 0),
); );
}, }, collapsed: SizedBox(), expanded: SizedBox(),
), ),
), ),
], ],
@ -199,7 +218,7 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (widget.itemModel.hasDiscountsApplied) if (widget.itemModel.hasDiscountsApplied!)
Text(widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar, Text(widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar,
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.w600, letterSpacing: -0.6, decoration: TextDecoration.lineThrough, color: CustomColors.grey2)), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.w600, letterSpacing: -0.6, decoration: TextDecoration.lineThrough, color: CustomColors.grey2)),
Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar, Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar,
@ -228,7 +247,7 @@ class OfferAndPackagesDetailState extends State<OfferAndPackagesDetail> {
String parseHtmlString(String htmlString) { String parseHtmlString(String htmlString) {
var document = parse(htmlString); var document = parse(htmlString);
String parsedString = parse(document.body.text).documentElement.text; String parsedString = parse(document.body!.text!).documentElement!.text!;
return parsedString; return parsedString;
} }

@ -24,13 +24,15 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import '../../core/model/packages_offers/responses/PackagesCartItemsResponseModel.dart';
dynamic languageID; dynamic languageID;
const _columnCount = 1; const _columnCount = 1;
bool _agreeTerms = false; bool _agreeTerms = false;
String _selectedPaymentMethod; String? _selectedPaymentMethod;
Map<dynamic, dynamic> _selectedPaymentParams; Map<dynamic, dynamic>? _selectedPaymentParams;
AnimationController _animationController; AnimationController? _animationController;
class PackagesCartPage extends StatefulWidget { class PackagesCartPage extends StatefulWidget {
PackagesCartPage(); PackagesCartPage();
@ -44,9 +46,9 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
languageID = await sharedPref.getString(APP_LANGUAGE); languageID = await sharedPref.getString(APP_LANGUAGE);
} }
double subtotal, tax, total; double? subtotal, tax, total;
int _selectedHospitalIndex = -1; int _selectedHospitalIndex = -1;
HospitalsModel _selectedHospital; HospitalsModel? _selectedHospital;
@override @override
void initState() { void initState() {
@ -58,12 +60,12 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
@override @override
void dispose() { void dispose() {
_animationController.dispose(); _animationController!.dispose();
viewModel.cartItemList.clear(); viewModel!.cartItemList.clear();
super.dispose(); super.dispose();
} }
PackagesViewModel viewModel; PackagesViewModel? viewModel;
bool loadWidgets = false; bool loadWidgets = false;
@ -76,10 +78,10 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
} }
onPayNowClick() async { onPayNowClick() async {
await viewModel.service.placeOrder(context: context, projectID: _selectedHospital.iD, paymentParams: _selectedPaymentParams).then((orderId) { await viewModel!.service.placeOrder(context: context, projectID: _selectedHospital!.iD, paymentParams: _selectedPaymentParams!).then((orderId) {
if (orderId.runtimeType == int) { if (orderId.runtimeType == int) {
var browser = MyInAppBrowser(context: context, onExitCallback: (data, isDone) => paymentClosed(orderId: orderId, withStatus: isDone, data: data)); var browser = MyInAppBrowser(context: context, onExitCallback: (data, isDone) => paymentClosed(orderId: orderId, withStatus: isDone, data: data));
browser.openPackagesPaymentBrowser(customer_id: viewModel.service.customer.id, order_id: orderId); browser.openPackagesPaymentBrowser(customer_id: viewModel!.service.customer!.id, order_id: orderId);
} else { } else {
utils.Utils.showErrorToast('Failed to place order, please try again later'); utils.Utils.showErrorToast('Failed to place order, please try again later');
} }
@ -91,7 +93,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
@override @override
void afterFirstLayout(BuildContext context) { void afterFirstLayout(BuildContext context) {
fetchData(); fetchData();
viewModel.service.getHospitals(); viewModel!.service.getHospitals();
} }
@override @override
@ -111,7 +113,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: viewModel.cartItemList.length > 0 body: viewModel!.cartItemList.length > 0
? Column( ? Column(
children: [ children: [
Expanded( Expanded(
@ -119,17 +121,17 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (cxt, index) { itemBuilder: (cxt, index) {
var item = viewModel.cartItemList[index]; var item = viewModel!.cartItemList[index];
return PackagesCartItemCard( return PackagesCartItemCard(
itemModel: item, itemModel: item,
viewModel: viewModel, viewModel: viewModel!,
getCartItems: fetchData, getCartItems: fetchData,
shouldStepperChangeApply: (apply, total) async { shouldStepperChangeApply: (apply, total) async {
var request = AddProductToCartRequestModel(product_id: item.productId, quantity: apply); var request = AddProductToCartRequestModel(product_id: item.productId, quantity: apply);
ResponseModel response = await viewModel.service.addProductToCart(request, context: context, showLoading: false).catchError((error) { ResponseModel<PackagesCartItemsResponseModel>? response = await viewModel!.service!.addProductToCart!(request, context: context, showLoading: false)!.catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
}); });
if (response.status) { if (response!.status!) {
fetchData(); fetchData();
} }
return response.status ?? false; return response.status ?? false;
@ -137,13 +139,13 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
); );
}, },
separatorBuilder: (cxt, index) => SizedBox(height: 12), separatorBuilder: (cxt, index) => SizedBox(height: 12),
itemCount: viewModel.cartItemList.length), itemCount: viewModel!.cartItemList.length),
), ),
Container( Container(
height: 1, height: 1,
color: Color(0xffEFEFEF), color: Color(0xffEFEFEF),
), ),
if (viewModel.cartItemList.length > 0) if (viewModel!.cartItemList.length > 0)
Container( Container(
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15), padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
width: double.infinity, width: double.infinity,
@ -182,7 +184,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
child: Checkbox( child: Checkbox(
value: _agreeTerms, value: _agreeTerms,
onChanged: (v) { onChanged: (v) {
setState(() => _agreeTerms = v); setState(() => _agreeTerms = v!);
}), }),
), ),
SizedBox(width: 10), SizedBox(width: 10),
@ -238,7 +240,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) { void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i), for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name! + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
]; ];
showDialog( showDialog(
context: context, context: context,
@ -257,31 +259,31 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
String getHospitalName() { String getHospitalName() {
if (_selectedHospital != null) if (_selectedHospital != null)
return _selectedHospital.name; return _selectedHospital!.name!;
else else
return TranslationBase.of(context).selectHospital; return TranslationBase.of(context).selectHospital;
} }
fetchData() async { fetchData() async {
final cartResponse = await viewModel.service.cartItems(context: context).catchError((error) {}); final cartResponse = await viewModel!.service.cartItems(context: context).catchError((error) {});
if(cartResponse != null){ if(cartResponse != null){
subtotal = cartResponse['subtotal'] ?? 0.0; subtotal = cartResponse['subtotal'] ?? 0.0;
tax = cartResponse['tax'] ?? 0.0; tax = cartResponse['tax'] ?? 0.0;
total = cartResponse['total'] ?? 0.0; total = cartResponse['total'] ?? 0.0;
viewModel.service.getTamaraOptions(context: context, showLoading: true).then((tamara_options){ viewModel!.service!.getTamaraOptions(context: context, showLoading: true).then((tamara_options){
if(tamara_options != null || tamara_options.isNotEmpty) { if(tamara_options != null || tamara_options.isNotEmpty) {
viewModel.setTamaraIllegablity(total); viewModel!.setTamaraIllegablity(total!);
setState(() {}); setState(() {});
} }
}); });
} }
} }
paymentClosed({@required int orderId, @required bool withStatus, dynamic data}) async { paymentClosed({required int orderId, required bool withStatus, dynamic data}) async {
viewModel.service.getOrderById(orderId, context: context).then((value) { viewModel!.service.getOrderById(orderId, context: context).then((value) {
var heading = withStatus ? "Success" : "Failed"; var heading = withStatus ? "Success" : "Failed";
var title = withStatus ? "Your order has been placed successfully" : "Failed to place your order"; var title = withStatus ? "Your order has been placed successfully" : "Failed to place your order";
var subTitle = "Order# ${value.data.customOrderNumber}"; var subTitle = "Order# ${value!.data!.customOrderNumber}";
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle))); Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle)));
}).catchError((error) { }).catchError((error) {
print(error); print(error);
@ -371,10 +373,10 @@ _getNormalText(text, {bool isBold = false, bool isTotal = false}) {
} }
Widget _cartItemDeleteContainer() { Widget _cartItemDeleteContainer() {
_animationController.duration = Duration(milliseconds: 500); _animationController!.duration = Duration(milliseconds: 500);
_animationController.repeat(reverse: true); _animationController!.repeat(reverse: true);
return FadeTransition( return FadeTransition(
opacity: _animationController, opacity: _animationController!,
child: Padding( child: Padding(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(5),
child: Container( child: Container(
@ -382,7 +384,7 @@ Widget _cartItemDeleteContainer() {
color: Colors.red, color: Colors.red,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey[500], color: Colors.grey[500]!,
blurRadius: 2, blurRadius: 2,
spreadRadius: 1, spreadRadius: 1,
), ),

@ -43,14 +43,14 @@ class PackagesHomePage extends StatefulWidget {
} }
class _PackagesHomePageState extends State<PackagesHomePage> { class _PackagesHomePageState extends State<PackagesHomePage> {
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
viewModel.service.patientUser = widget.user; viewModel!.service.patientUser = widget.user;
viewModel.service.loadOffersPackagesDataForMainPage( viewModel!.service.loadOffersPackagesDataForMainPage(
context: context, context: context,
completion: () { completion: () {
setState(() {}); setState(() {});
@ -61,13 +61,13 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
// Controllers // Controllers
var _searchTextController = TextEditingController(); var _searchTextController = TextEditingController();
ListView _listViewLatestOffers; ListView? _listViewLatestOffers;
ListView _listViewBestSeller; ListView? _listViewBestSeller;
PackagesViewModel viewModel; PackagesViewModel? viewModel;
onCartClick() { onCartClick() {
if (viewModel.service.customer == null) { if (viewModel!.service.customer == null) {
utils.Utils.showErrorToast("Cart is empty for your current session"); utils.Utils.showErrorToast("Cart is empty for your current session");
return; return;
} }
@ -75,21 +75,21 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
} }
onProductCartClick(PackagesResponseModel product) async { onProductCartClick(PackagesResponseModel product) async {
if (viewModel.service.customer == null) { if (viewModel!.service.customer == null) {
// viewModel.service.customer = await CreateCustomerDialogPage(context: context).show(); // viewModel.service.customer = await CreateCustomerDialogPage(context: context).show();
loginCheck(context); loginCheck(context);
} }
if (viewModel.service.customer != null) { if (viewModel!.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id); var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel!.service.customer!.id);
await viewModel.service.addProductToCart(request, context: context).then((response) {}).catchError((error) { await viewModel!.service.addProductToCart(request, context: context).then((response) {}).catchError((error) {
utils.Utils.showErrorToast(error.toString()); utils.Utils.showErrorToast(error.toString());
}); });
} }
} }
PackagesCategoriesResponseModel selectedClinic; PackagesCategoriesResponseModel? selectedClinic;
OfferProject selectedProject; OfferProject? selectedProject;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -128,14 +128,14 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(left: 21, right: 21), padding: EdgeInsets.only(left: 21, right: 21),
itemCount: viewModel.bestSellerList.length, itemCount: viewModel!.bestSellerList.length,
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return mWidth(9.0); return mWidth(9.0);
}, },
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return PackagesItemCard( return PackagesItemCard(
itemModel: viewModel.bestSellerList[index], itemModel: viewModel!.bestSellerList[index],
onCartClick: OFFERS_VIEW_ONLY ? onProductCartClick : null, onCartClick: OFFERS_VIEW_ONLY! ? onProductCartClick : (PackagesResponseModel){}, itemContentPadding: null,
); );
}, },
), ),
@ -149,14 +149,14 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(left: 21, right: 21), padding: EdgeInsets.only(left: 21, right: 21),
itemCount: viewModel.latestOffersList.length, itemCount: viewModel!.latestOffersList.length,
separatorBuilder: (context, index) { separatorBuilder: (context, index) {
return mWidth(9.0); return mWidth(9.0);
}, },
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return PackagesItemCard( return PackagesItemCard(
itemModel: viewModel.latestOffersList[index], itemModel: viewModel!.latestOffersList[index],
onCartClick: OFFERS_VIEW_ONLY ? onProductCartClick : null, onCartClick: OFFERS_VIEW_ONLY ? onProductCartClick : (PackagesResponseModel){}, itemContentPadding: null,
); );
}, },
), ),
@ -182,9 +182,9 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
int _selectedClinic = -1; int _selectedClinic = -1;
showClinicSelectionList() async { showClinicSelectionList() async {
var clinics = await viewModel.service.getAllCategories(OffersCategoriesRequestModel()); var clinics = await viewModel!.service.getAllCategories(OffersCategoriesRequestModel());
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < clinics.length; i++) RadioSelectionDialogModel(clinics[i].name, i), for (int i = 0; i < clinics.length; i++) RadioSelectionDialogModel(clinics![i].name!, i),
]; ];
showDialog( showDialog(
context: context, context: context,
@ -195,7 +195,7 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
onValueSelected: (index) async { onValueSelected: (index) async {
_selectedClinic = index; _selectedClinic = index;
selectedClinic = clinics[index]; selectedClinic = clinics[index];
var clinicProducts = await viewModel.service.getAllProducts(request: OffersProductsRequestModel(categoryId: selectedClinic.id), context: context, showLoading: true); var clinicProducts = await viewModel!.service.getAllProducts(request: OffersProductsRequestModel(categoryId: selectedClinic!.id), context: context, showLoading: true);
if (clinicProducts.isNotEmpty) if (clinicProducts.isNotEmpty)
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => ClinicPackagesPage(products: clinicProducts))); Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => ClinicPackagesPage(products: clinicProducts)));
else else
@ -210,11 +210,11 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
showHospitalSelectionList() async { showHospitalSelectionList() async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
var hospitals = await viewModel.service.getAllStores(); var hospitals = await viewModel!.service.getAllStores();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name, i), for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name!, i),
]; ];
showDialog( showDialog(
context: context, context: context,
@ -225,9 +225,9 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
onValueSelected: (index) async { onValueSelected: (index) async {
_selectedHospital = index; _selectedHospital = index;
selectedProject = hospitals[index]; selectedProject = hospitals[index];
var request = OffersProductsRequestModel(storeId: selectedProject.id); var request = OffersProductsRequestModel(storeId: selectedProject!.id);
request.sinceId = 0; request.sinceId = 0;
var products = await viewModel.service.getAllProducts(request: request, context: context, showLoading: true); var products = await viewModel!.service.getAllProducts(request: request, context: context, showLoading: true);
if (products.isNotEmpty) if (products.isNotEmpty)
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => ClinicPackagesPage(products: products))); Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => ClinicPackagesPage(products: products)));
else else
@ -242,16 +242,16 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
// Main Widgets of Page // Main Widgets of Page
//---------------------------------- //----------------------------------
Widget latestOfferListView({@required double itemWidth, @required double itemContentPadding}) { Widget latestOfferListView({required double itemWidth, required double itemContentPadding}) {
return _listViewLatestOffers = ListView.separated( return _listViewLatestOffers = ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
itemCount: viewModel.bestSellerList.length, itemCount: viewModel!.bestSellerList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return PackagesItemCard( return PackagesItemCard(
itemWidth: itemWidth, itemWidth: itemWidth,
itemContentPadding: itemContentPadding, itemContentPadding: itemContentPadding,
itemModel: viewModel.bestSellerList[index], itemModel: viewModel!.bestSellerList[index],
onCartClick: onProductCartClick, onCartClick: onProductCartClick,
); );
}, },
@ -259,15 +259,15 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
); );
} }
Widget bestSellerListView({@required double itemWidth, @required double itemContentPadding}) { Widget bestSellerListView({required double itemWidth, required double itemContentPadding}) {
return _listViewLatestOffers = ListView.separated( return _listViewLatestOffers = ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: viewModel.bestSellerList.length, itemCount: viewModel!.bestSellerList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return PackagesItemCard( return PackagesItemCard(
itemWidth: itemWidth, itemWidth: itemWidth,
itemContentPadding: itemContentPadding, itemContentPadding: itemContentPadding,
itemModel: viewModel.bestSellerList[index], itemModel: viewModel!.bestSellerList[index],
onCartClick: onProductCartClick, onCartClick: onProductCartClick,
); );
}, },
@ -280,7 +280,7 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
width: 1, width: 1,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: gradient:
LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 4.0), colors: [Colors.grey, Colors.grey[100], Colors.grey[200], Colors.grey[300], Colors.grey[400], Colors.grey[500]])), LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 4.0), colors: [Colors.grey, Colors.grey[100]!, Colors.grey[200]!, Colors.grey[300]!, Colors.grey[400]!, Colors.grey[500]!])),
); );
} }
@ -312,7 +312,7 @@ class _PackagesHomePageState extends State<PackagesHomePage> {
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { {VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines, bool isInputTypeNum = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
margin: const EdgeInsets.only(left: 21, right: 21), margin: const EdgeInsets.only(left: 21, right: 21),

@ -11,15 +11,15 @@ import 'package:flutter_svg/svg.dart';
dynamic languageID; dynamic languageID;
class PackageOrderCompletedPage extends StatelessWidget { class PackageOrderCompletedPage extends StatelessWidget {
double buttonHeight; double? buttonHeight;
double buttonWidth; double? buttonWidth;
Widget icon; Widget? icon;
String heading; String? heading;
String title; String? title;
String subTitle; String? subTitle;
String actionTitle; String? actionTitle;
PackageOrderCompletedPage({this.buttonWidth, this.buttonHeight, @required this.heading, @required this.title, @required this.subTitle, this.actionTitle}); PackageOrderCompletedPage({this.buttonWidth, this.buttonHeight, required this.heading, required this.title, required this.subTitle, this.actionTitle});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -110,7 +110,7 @@ class PackageOrderCompletedPage extends StatelessWidget {
width: buttonWidth, width: buttonWidth,
child: CustomTextButton( child: CustomTextButton(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(buttonHeight / 2), borderRadius: new BorderRadius.circular(buttonHeight! / 2),
), ),
child: Texts( child: Texts(
actionTitle, actionTitle,

@ -21,8 +21,8 @@ class PackagesOfferTabPage extends StatefulWidget{
} }
class PackagesOfferTabPageState extends State<PackagesOfferTabPage> with SingleTickerProviderStateMixin{ class PackagesOfferTabPageState extends State<PackagesOfferTabPage> with SingleTickerProviderStateMixin{
TabController _tabController; TabController? _tabController;
ProjectViewModel _projectViewModel; ProjectViewModel? _projectViewModel;
@override @override
void initState() { void initState() {
@ -58,13 +58,13 @@ class PackagesOfferTabPageState extends State<PackagesOfferTabPage> with SingleT
unselectedLabelColor: Color(0xff575757), unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle( labelStyle: TextStyle(
fontFamily: _projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontFamily: _projectViewModel!.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
unselectedLabelStyle: TextStyle( unselectedLabelStyle: TextStyle(
fontFamily: _projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontFamily: _projectViewModel!.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,

@ -21,15 +21,15 @@ class PackagesOrdersHistory extends StatefulWidget{
} }
class PackagesOrdersHistorySatate extends State<PackagesOrdersHistory>{ class PackagesOrdersHistorySatate extends State<PackagesOrdersHistory>{
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
PackagesViewModel packagesViewModel; PackagesViewModel? packagesViewModel;
List<PackagesResponseModel> orders; List<PackagesResponseModel>? orders;
@override @override
void initState() { void initState() {
Future.delayed(Duration(milliseconds: 200)).then((value) async{ Future.delayed(Duration(milliseconds: 200)).then((value) async{
final orders_ = await packagesViewModel.service.orderHistory(context: context); final orders_ = await packagesViewModel!.service.orderHistory(context: context);
setState(() => orders = orders_ ?? []); setState(() => orders = orders_ ?? []);
}); });
} }
@ -49,29 +49,29 @@ class PackagesOrdersHistorySatate extends State<PackagesOrdersHistory>{
Widget content(BuildContext context){ Widget content(BuildContext context){
if(orders == null){ if(orders == null){
return SizedBox(); return SizedBox();
}else if(orders.isEmpty){ }else if(orders!.isEmpty){
return getNoDataWidget(context); return getNoDataWidget(context);
}else { }else {
return ListView.separated( return ListView.separated(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
itemCount: orders.length, itemCount: orders!.length,
itemBuilder: (ctx, idx) => item(ctx, order: orders[idx]), itemBuilder: (ctx, idx) => item(ctx, order: orders![idx]),
separatorBuilder: (ctx, idx) => SizedBox(height: 10), separatorBuilder: (ctx, idx) => SizedBox(height: 10),
); );
} }
} }
Widget item(BuildContext context, {@required PackagesResponseModel order}){ Widget item(BuildContext context, {required PackagesResponseModel order}){
return InkWell( return InkWell(
child: PackagesOrderHistoryItemCard(itemModel: order, viewModel: packagesViewModel), child: PackagesOrderHistoryItemCard(itemModel: order, viewModel: packagesViewModel!),
onTap: (){ onTap: (){
final detailPage = OfferAndPackagesDetail(itemModel: order, onCartClick: null)..showAddToCartFooter = false; final detailPage = OfferAndPackagesDetail(itemModel: order, onCartClick: (PackagesResponseModel){})..showAddToCartFooter = false;
Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => detailPage)); Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => detailPage));
}, },
); );
} }
void showConfirmMessage(BuildContext context, {@required PackagesResponseModel order}){ void showConfirmMessage(BuildContext context, {required PackagesResponseModel order}){
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => ConfirmWithMessageDialog( builder: (cxt) => ConfirmWithMessageDialog(

@ -15,8 +15,8 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PaymentService extends StatelessWidget { class PaymentService extends StatelessWidget {
ToDoCountProviderModel model; ToDoCountProviderModel? model;
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,7 +62,7 @@ class PaymentService extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: AdvancePaymentPage())); Navigator.push(context, FadePage(page: AdvancePaymentPage()));
projectViewModel.analytics.advancePayments.payment_services(service_type: 'payment service'); projectViewModel!.analytics.advancePayments.payment_services(service_type: 'payment service');
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).payment, title: TranslationBase.of(context).payment,
@ -79,7 +79,7 @@ class PaymentService extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
navigateToToDoPage(context); navigateToToDoPage(context);
projectViewModel.analytics.advancePayments.payment_services(service_type: 'online check-in appointment'); projectViewModel!.analytics.advancePayments.payment_services(service_type: 'online check-in appointment');
}, },
child: Stack( child: Stack(
children: [ children: [
@ -91,20 +91,20 @@ class PaymentService extends StatelessWidget {
width: 45.0, width: 45.0,
height: 45.0, height: 45.0,
), ),
projectViewModel.isArabic projectViewModel!.isArabic
? Positioned( ? Positioned(
left: 8, left: 8,
top: 4, top: 4,
child: badge_import.Badge( child: badge_import.Badge(
toAnimate: false, // toAnimate: false,
elevation: 0, // elevation: 0,
position: badge_import.BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle, // shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), // badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), // borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(model!.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
), ),
), ),
) )
@ -112,15 +112,15 @@ class PaymentService extends StatelessWidget {
right: 8, right: 8,
top: 4, top: 4,
child: badge_import.Badge( child: badge_import.Badge(
toAnimate: false, // toAnimate: false,
elevation: 0, // elevation: 0,
position: badge_import.BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle, // shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), // badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), // borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(model!.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
), ),
), ),
) )
@ -133,7 +133,7 @@ class PaymentService extends StatelessWidget {
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: MyBalancePage())); Navigator.push(context, FadePage(page: MyBalancePage()));
projectViewModel.analytics.advancePayments.payment_services(service_type: 'alhabib wallet'); projectViewModel!.analytics.advancePayments.payment_services(service_type: 'alhabib wallet');
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).hmg, title: TranslationBase.of(context).hmg,
@ -149,7 +149,7 @@ class PaymentService extends StatelessWidget {
} }
navigateToToDoPage(BuildContext context) { navigateToToDoPage(BuildContext context) {
if (projectViewModel.isLogin) { if (projectViewModel!.isLogin) {
// if (model.count != 0) { // if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
// } else { // } else {

@ -7,7 +7,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ProductCheckTypeWidget extends StatefulWidget { class ProductCheckTypeWidget extends StatefulWidget {
final WishListViewModel model; final WishListViewModel? model;
ProductCheckTypeWidget({this.model}); ProductCheckTypeWidget({this.model});
@ -21,23 +21,23 @@ class _ProductCheckTypeWidgetState extends State<ProductCheckTypeWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return ListView.builder( return ListView.builder(
itemCount: widget.model.wishListList.length, itemCount: widget.model!.wishListList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Column( return Column(
children: [ children: [
Container( Container(
child: productTile( child: productTile(
productName: projectViewModel.isArabic productName: projectViewModel.isArabic
? widget.model.wishListList[index].product.namen ? widget.model!.wishListList[index].product.namen
: widget.model.wishListList[index].product.name, : widget.model!.wishListList[index].product.name,
productPrice: widget.model.wishListList[index].subtotal, productPrice: widget.model!.wishListList[index].subtotal,
// productRate: double.parse(widget.model.wishListList[index].subtotalVatRate), // productRate: double.parse(widget.model.wishListList[index].subtotalVatRate),
productRate: widget.model.wishListList[index].product.approvedRatingSum.toDouble(), productRate: widget.model!.wishListList[index].product.approvedRatingSum.toDouble(),
approvedTotalReviews:widget.model.wishListList[index].product.approvedTotalReviews, approvedTotalReviews:widget.model!.wishListList[index].product.approvedTotalReviews,
productImage: widget.model.wishListList[index].product.images[0].src, productImage: widget.model!.wishListList[index].product.images[0].src,
productID: widget.model.wishListList[index].product.id, productID: widget.model!.wishListList[index].product.id,
onDelete: deleteWishListItem, onDelete: deleteWishListItem,
isRx:widget.model.wishListList[index].product.isRx, isRx:widget.model!.wishListList[index].product.isRx,
), ),
), ),
@ -51,7 +51,7 @@ class _ProductCheckTypeWidgetState extends State<ProductCheckTypeWidget> {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await x.deleteWishlistData(itemID, context); await x.deleteWishlistData(itemID, context);
await widget.model.getWishlistData(isLocalLoader: true); await widget.model!.getWishlistData(isLocalLoader: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }

@ -141,7 +141,7 @@ class _slideDetailState extends State<slideDetail> {
height: 20, height: 20,
), ),
Image.network( Image.network(
widget.data[index].images[0].src.trim(), widget.data[index].images![0].src!.trim(),
fit: BoxFit.cover, fit: BoxFit.cover,
width: 100, width: 100,
height: 60, height: 60,
@ -208,7 +208,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[0].nameN : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![0].nameN : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
) )
@ -216,7 +216,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[0].name : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![0].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
)), )),
@ -227,7 +227,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[0].defaultValuen : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![0].defaultValuen : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
) )
@ -235,7 +235,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[0].defaultValue : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![0].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
)), )),
@ -254,7 +254,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].nameN : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![1].nameN : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
) )
@ -262,7 +262,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].name : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![1].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
)), )),
@ -273,7 +273,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].defaultValuen : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![1].defaultValuen : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
) )
@ -281,7 +281,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].defaultValue : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![1].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
)), )),
@ -300,7 +300,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].nameN : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![2].nameN : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
) )
@ -308,7 +308,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].name : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![2].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
)), )),
@ -319,7 +319,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].defaultValuen : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![2].defaultValuen : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
) )
@ -327,7 +327,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].defaultValue : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![2].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
)), )),
@ -346,7 +346,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].nameN : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![3].nameN : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
) )
@ -354,7 +354,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].name : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![3].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
)), )),
@ -365,7 +365,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].defaultValuen : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![3].defaultValuen : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
) )
@ -373,7 +373,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].defaultValue : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![3].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
)), )),
@ -392,7 +392,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].nameN : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![4].nameN : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
) )
@ -400,7 +400,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].name : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![4].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
)), )),
@ -411,7 +411,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].defaultValuen : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![4].defaultValuen : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
) )
@ -419,7 +419,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].defaultValue : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![4].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
)), )),
@ -438,7 +438,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].nameN : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![5].nameN : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
) )
@ -446,7 +446,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].name : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![5].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)), )),
)), )),
@ -457,7 +457,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].defaultValuen : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![5].defaultValuen : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
) )
@ -465,7 +465,7 @@ class _slideDetailState extends State<slideDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].defaultValue : "", text: widget.data[index].specifications != null ? widget.data[index].specifications![5].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold), style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)), )),
)), )),

@ -23,7 +23,7 @@ class MedicineSearch extends StatelessWidget {
return BaseView<PharmacyViewModel>( return BaseView<PharmacyViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model) => model.clearMedicineSearch(), onModelReady: (model) => model.clearMedicineSearch(),
builder: (BuildContext context, PharmacyViewModel model, Widget child) => builder: (BuildContext context, PharmacyViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).searchMedicine, appBarTitle: TranslationBase.of(context).searchMedicine,
@ -35,10 +35,10 @@ class MedicineSearch extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
bottom: SizeConfig.heightMultiplier * 1, bottom: SizeConfig.heightMultiplier! * 1,
right: SizeConfig.heightMultiplier * 2.5, right: SizeConfig.heightMultiplier! * 2.5,
top: SizeConfig.heightMultiplier * 4, top: SizeConfig.heightMultiplier! * 4,
left: SizeConfig.heightMultiplier * 2.5, left: SizeConfig.heightMultiplier! * 2.5,
), ),
child: Form( child: Form(
key: _formKey, key: _formKey,
@ -64,10 +64,10 @@ class MedicineSearch extends StatelessWidget {
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
bottom: SizeConfig.heightMultiplier * 0.0, bottom: SizeConfig.heightMultiplier! * 0.0,
right: SizeConfig.heightMultiplier * 5, right: SizeConfig.heightMultiplier! * 5,
top: SizeConfig.heightMultiplier * 1, top: SizeConfig.heightMultiplier! * 1,
left: SizeConfig.heightMultiplier * 5, left: SizeConfig.heightMultiplier! * 5,
), ),
child: Wrap( child: Wrap(
children: <Widget>[ children: <Widget>[
@ -86,7 +86,7 @@ class MedicineSearch extends StatelessWidget {
if(model.pharmacy.isNotEmpty) if(model.pharmacy.isNotEmpty)
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: SizeConfig.heightMultiplier * 2), left: SizeConfig.heightMultiplier! * 2),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -104,7 +104,7 @@ class MedicineSearch extends StatelessWidget {
), ),
Expanded( Expanded(
child: Container( child: Container(
width: SizeConfig.screenWidth * 0.85, width: SizeConfig.screenWidth! * 0.85,
//child: _getHospitals(model.pharmacy), //child: _getHospitals(model.pharmacy),
child: ListView.builder( child: ListView.builder(
//physics: NeverScrollableScrollPhysics(), //physics: NeverScrollableScrollPhysics(),
@ -116,7 +116,7 @@ class MedicineSearch extends StatelessWidget {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: model.pharmacy[index].itemDes, label: model.pharmacy[index].itemDes!,
url: model.pharmacy[index].productImage), url: model.pharmacy[index].productImage),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -144,7 +144,7 @@ class MedicineSearch extends StatelessWidget {
searchMedicine(PharmacyViewModel model, BuildContext context) { searchMedicine(PharmacyViewModel model, BuildContext context) {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
if (_formKey.currentState.validate()) if (_formKey.currentState!.validate())
model.getMedicine(name: textController.text); model.getMedicine(name: textController.text);
} }
} }

@ -4,7 +4,8 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
class MyReviewsPage extends StatefulWidget { class MyReviewsPage extends StatefulWidget {
@override @override
@ -66,7 +67,7 @@ class _MyReviewsPageState extends State<MyReviewsPage> {
Container( Container(
child: reviewDetails( child: reviewDetails(
model.reviewListList[index], model.reviewListList[index],
double.parse(model.reviewListList[index].product.approvedTotalReviews.toString()), double.parse(model.reviewListList[index].product!.approvedTotalReviews!.toString()),
double.parse(model.reviewListList[index].rating.toString()), double.parse(model.reviewListList[index].rating.toString()),
), ),
), ),
@ -139,16 +140,37 @@ reviewDetails(data, rate, myRate) {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: Align(
alignment: languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, alignment: languageID == 'ar' ? Alignment.topRight : Alignment.topLeft,
child: RatingBar.readOnly( child:
RatingBar(
initialRating: rate, initialRating: rate,
size: 15.0, direction: Axis.horizontal,
filledColor: Colors.yellow[700], allowHalfRating: true,
emptyColor: Colors.grey[500], itemCount: 5,
isHalfAllowed: true, itemSize: 20,
halfFilledIcon: Icons.star_half, ignoreGestures: true,
filledIcon: Icons.star, ratingWidget: RatingWidget(
emptyIcon: Icons.star, 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);
},
)
// RatingBar.readOnly(
// initialRating: rate,
// size: 15.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
), ),
), ),
], ],
@ -177,16 +199,35 @@ reviewDetails(data, rate, myRate) {
children: [ children: [
Container( Container(
padding: languageID == 'ar' ? EdgeInsets.only(right: 60) : EdgeInsets.only(left: 60), padding: languageID == 'ar' ? EdgeInsets.only(right: 60) : EdgeInsets.only(left: 60),
child: RatingBar.readOnly( child:
RatingBar(
initialRating: myRate, initialRating: myRate,
size: 15.0, direction: Axis.horizontal,
filledColor: Colors.yellow[700], allowHalfRating: true,
emptyColor: Colors.grey[500], itemCount: 5,
isHalfAllowed: true, itemSize: 20,
halfFilledIcon: Icons.star_half, ignoreGestures: true,
filledIcon: Icons.star, ratingWidget: RatingWidget(
emptyIcon: Icons.star, 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);
},
)
// RatingBar.readOnly(
// initialRating: myRate,
// size: 15.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
), ),
], ],
), ),

@ -15,9 +15,9 @@ import 'package:url_launcher/url_launcher.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class PharmaciesList extends StatelessWidget { class PharmaciesList extends StatelessWidget {
final int medicineID; final int? medicineID;
final String imageURL; final String? imageURL;
final String medicineDescription; final String? medicineDescription;
PharmaciesList({this.medicineID, this.imageURL, this.medicineDescription}); PharmaciesList({this.medicineID, this.imageURL, this.medicineDescription});
@ -26,7 +26,7 @@ class PharmaciesList extends StatelessWidget {
return BaseView<PharmacyViewModel>( return BaseView<PharmacyViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model) => model.getPharmacies(id: medicineID), onModelReady: (model) => model.getPharmacies(id: medicineID),
builder: (BuildContext context, PharmacyViewModel model, Widget child) => builder: (BuildContext context, PharmacyViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
appBarTitle: TranslationBase.of(context).pharmaciesList, appBarTitle: TranslationBase.of(context).pharmaciesList,
baseViewModel: model, baseViewModel: model,
@ -49,9 +49,9 @@ class PharmaciesList extends StatelessWidget {
Radius.circular(7), Radius.circular(7),
), ),
child: Image.memory( child: Image.memory(
dataFromBase64String(imageURL), dataFromBase64String(imageURL!),
height: SizeConfig.imageSizeMultiplier * 19, height: SizeConfig.imageSizeMultiplier! * 19,
width: SizeConfig.imageSizeMultiplier * 18, width: SizeConfig.imageSizeMultiplier! * 18,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -90,10 +90,10 @@ class PharmaciesList extends StatelessWidget {
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: SizeConfig.widthMultiplier * 2.0, top: SizeConfig.widthMultiplier! * 2.0,
bottom: SizeConfig.widthMultiplier * 3.0, bottom: SizeConfig.widthMultiplier! * 3.0,
right: SizeConfig.widthMultiplier * 4.0, right: SizeConfig.widthMultiplier! * 4.0,
left: SizeConfig.widthMultiplier * 2.5, left: SizeConfig.widthMultiplier! * 2.5,
), ),
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
@ -104,7 +104,7 @@ class PharmaciesList extends StatelessWidget {
alignment: Alignment.topRight, alignment: Alignment.topRight,
), ),
Container( Container(
width: SizeConfig.screenWidth * 1.0, width: SizeConfig.screenWidth! * 1.0,
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -120,9 +120,9 @@ class PharmaciesList extends StatelessWidget {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(7)), BorderRadius.all(Radius.circular(7)),
child: Image.network( child: Image.network(
model.pharmacyList[index].imageLocation, model.pharmacyList[index].imageLocation!,
height: SizeConfig.imageSizeMultiplier * 13.0, height: SizeConfig.imageSizeMultiplier! * 13.0,
width: SizeConfig.imageSizeMultiplier * 11.0, width: SizeConfig.imageSizeMultiplier! * 11.0,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -151,7 +151,7 @@ class PharmaciesList extends StatelessWidget {
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
), ),
onTap: () => launch("tel://" + onTap: () => launch("tel://" +
model.pharmacyList[index].phoneNumber), model.pharmacyList[index].phoneNumber!),
), ),
), ),
Padding( Padding(
@ -164,9 +164,9 @@ class PharmaciesList extends StatelessWidget {
onTap: () { onTap: () {
MapsLauncher.launchCoordinates( MapsLauncher.launchCoordinates(
double.parse( double.parse(
model.pharmacyList[index].latitude), model.pharmacyList[index].latitude!),
double.parse(model double.parse(model
.pharmacyList[index].longitude), .pharmacyList[index].longitude!),
); );
}, },
), ),

@ -126,8 +126,8 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
languageID == 'ar' languageID == 'ar'
? Text(model.brandsListList[index].namen) ? Text(model.brandsListList[index].namen!)
: Text(model.brandsListList[index].name), : Text(model.brandsListList[index].name!),
SizedBox( SizedBox(
height: 3, height: 3,
), ),
@ -191,12 +191,12 @@ topBrand(BuildContext context) {
), ),
child: model.topBrandsListList[index].image != null child: model.topBrandsListList[index].image != null
? Image.network( ? Image.network(
model.topBrandsListList[index].image.src, model.topBrandsListList[index].image!.src!,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60,
height: 40, height: 40,
) )
: Text(model.topBrandsListList[index].name)), : Text(model.topBrandsListList[index].name!)),
), ),
), ),
), ),
@ -243,7 +243,7 @@ class SearchBar extends SearchDelegate<String> {
progress: transitionAnimation, progress: transitionAnimation,
), ),
onPressed: () { onPressed: () {
close(context, null); close(context, "");
}, },
); );
} }

@ -22,9 +22,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class CartOrderPage extends StatefulWidget { class CartOrderPage extends StatefulWidget {
final Function(int) changeTab; final VoidCallbackAction? changeTab;
const CartOrderPage({Key key, this.changeTab}) : super(key: key); const CartOrderPage({Key? key, this.changeTab}) : super(key: key);
@override @override
_CartOrderPageState createState() => _CartOrderPageState(); _CartOrderPageState createState() => _CartOrderPageState();
@ -32,8 +32,8 @@ class CartOrderPage extends StatefulWidget {
class _CartOrderPageState extends State<CartOrderPage> { class _CartOrderPageState extends State<CartOrderPage> {
bool isLoading = true; bool isLoading = true;
String customerId; late String customerId;
String customerGUID; late String customerGUID;
@override @override
void initState() { void initState() {
@ -57,14 +57,14 @@ class _CartOrderPageState extends State<CartOrderPage> {
isMainPharmacyPages: true, isMainPharmacyPages: true,
showPharmacyCart: false, showPharmacyCart: false,
baseViewModel: model, baseViewModel: model,
backButtonTab: () { backButtonTab:
widget.changeTab(0); widget.changeTab!,
},
backgroundColor: Colors.white, backgroundColor: Colors.white,
body: NetworkBaseView( body: NetworkBaseView(
isLoading: isLoading, isLoading: isLoading,
isLocalLoader: true, isLocalLoader: true,
child: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts.length == 0) child: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts!.length == 0)
? Container( ? Container(
height: height * 0.85, height: height * 0.85,
width: double.infinity, width: double.infinity,
@ -91,17 +91,17 @@ class _CartOrderPageState extends State<CartOrderPage> {
), ),
Container( Container(
child: ListView.builder( child: ListView.builder(
itemCount: model.cartResponse.shoppingCarts.length, itemCount: model.cartResponse.shoppingCarts!.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: const AlwaysScrollableScrollPhysics(), // physics: const AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ProductOrderItem( return ProductOrderItem(
item: model.cartResponse.shoppingCarts[index], item: model.cartResponse.shoppingCarts![index],
changeCartItems: () async { changeCartItems: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.changeProductQuantity(model.cartResponse.shoppingCarts[index]); await model.changeProductQuantity(model.cartResponse.shoppingCarts![index]);
if (model.state != ViewState.Error) {} if (model.state != ViewState.Error) {}
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
@ -110,7 +110,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
}, },
deleteCartItems: () async { deleteCartItems: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.deleteProduct(model.cartResponse.shoppingCarts[index]).then((value) { await model.deleteProduct(model.cartResponse.shoppingCarts![index]).then((value) {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} }
@ -138,7 +138,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotal)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -162,7 +162,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalVatAmount)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -186,7 +186,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalWithVat).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(model.cartResponse.subtotalWithVat)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -249,7 +249,7 @@ class _CartOrderPageState extends State<CartOrderPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts.length == 0) ? height * 0.15 : 0, height: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts!.length == 0) ? height * 0.15 : 0,
color: Colors.white, color: Colors.white,
child: OrderBottomWidget(model.addresses, height, model, isLoading), child: OrderBottomWidget(model.addresses, height, model, isLoading),
), ),
@ -297,7 +297,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return !widget.isLoading && !(widget.model.cartResponse.shoppingCarts == null || widget.model.cartResponse.shoppingCarts.length == 0) return !widget.isLoading && !(widget.model.cartResponse.shoppingCarts == null || widget.model.cartResponse.shoppingCarts!.length == 0)
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -382,7 +382,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
child: Row( child: Row(
children: [ children: [
Texts( Texts(
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotalWithVat).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotalWithVat)!.toStringAsFixed(2)}",
fontSize: projectProvider.isArabic ? 12 : 14, fontSize: projectProvider.isArabic ? 12 : 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -416,7 +416,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
if (widget.model.isCartItemsOutOfStock()) if (widget.model.isCartItemsOutOfStock())
{AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)} {AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)}
else else
{_navigateToAddressPage(projectProvider.user.patientIdentificationNo)} {_navigateToAddressPage(projectProvider.user!.patientIdentificationNo!)}
} }
: null, : null,
child: new Text( child: new Text(

@ -16,8 +16,8 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class OrderPreviewPage extends StatefulWidget { class OrderPreviewPage extends StatefulWidget {
final List<Addresses> addresses; final List<Addresses>? addresses;
final OrderPreviewViewModel model; final OrderPreviewViewModel? model;
OrderPreviewPage({this.addresses, this.model}); OrderPreviewPage({this.addresses, this.model});
@ -26,7 +26,7 @@ class OrderPreviewPage extends StatefulWidget {
} }
class _OrderPreviewPageState extends State<OrderPreviewPage> { class _OrderPreviewPageState extends State<OrderPreviewPage> {
MyInAppBrowser browser; MyInAppBrowser? browser;
bool isLoading = true; bool isLoading = true;
bool isChecked = false; bool isChecked = false;
@ -66,8 +66,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
child: Column( child: Column(
children: [ children: [
SelectAddressWidget( SelectAddressWidget(
widget.model, widget.model!,
widget.addresses, widget.addresses!,
changeMainState, changeMainState,
isUpdating: true, isUpdating: true,
), ),
@ -75,14 +75,14 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
height: 10, height: 10,
), ),
SelectPaymentOptionWidget( SelectPaymentOptionWidget(
widget.model, widget.model!,
changeMainState, changeMainState,
isUpdating: true, isUpdating: true,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
widget.model.paymentCheckoutData.lacumInformation != null widget.model!.paymentCheckoutData.lacumInformation != null
? Stack( ? Stack(
children: [ children: [
Container( Container(
@ -101,10 +101,10 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
child: Checkbox( child: Checkbox(
activeColor: CustomColors.green, activeColor: CustomColors.green,
value: isChecked, value: isChecked,
onChanged: (bool value) { onChanged: (bool? value) {
setState(() { setState(() {
isChecked = value; isChecked = value!;
if (value) { if (value!) {
PaymentBottomWidget.isChecked = true; PaymentBottomWidget.isChecked = true;
} else { } else {
PaymentBottomWidget.isChecked = false; PaymentBottomWidget.isChecked = false;
@ -118,7 +118,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
padding: const EdgeInsets.only(left: 8.0, right: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text( child: Text(
TranslationBase.of(context).useLakumPoints + TranslationBase.of(context).useLakumPoints +
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", " (${widget.model!.paymentCheckoutData.lacumInformation!.lakumInquiryInformationObjVersion!.pointsBalance.toString() + " " + TranslationBase.of(context).points})",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
), ),
], ],
@ -141,7 +141,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Text( Text(
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", "${TranslationBase.of(context).sar + " " + widget.model!.paymentCheckoutData.lacumInformation!.lakumInquiryInformationObjVersion!.pointsBalanceAmount.toString()}",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
], ],
), ),
@ -182,8 +182,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Colors.black, color: Colors.black,
), ),
...List.generate( ...List.generate(
widget.model.cartResponse.shoppingCarts != null ? widget.model.cartResponse.shoppingCarts.length : 0, widget.model!.cartResponse.shoppingCarts != null ? widget.model!.cartResponse.shoppingCarts!.length : 0,
(index) => ProductOrderPreviewItem(widget.model.cartResponse.shoppingCarts[index]), (index) => ProductOrderPreviewItem(widget.model!.cartResponse.shoppingCarts![index]),
), ),
], ],
), ),
@ -191,7 +191,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: widget.model.cartResponse.subtotal != null child: widget.model!.cartResponse.subtotal != null
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -214,7 +214,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotal).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model!.cartResponse.subtotal)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -238,7 +238,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(widget.model.totalAdditionalShippingCharge).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model!.totalAdditionalShippingCharge).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -262,7 +262,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.subtotalVatAmount).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(widget.model!.cartResponse.subtotalVatAmount)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -287,7 +287,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", "- ${TranslationBase.of(context).sar} ${(widget.model!.paymentCheckoutData.lacumInformation!.lakumInquiryInformationObjVersion!.pointsBalanceAmount)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -316,7 +316,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
), ),
Texts( Texts(
" ${TranslationBase.of(context).sar}" " ${TranslationBase.of(context).sar}"
"${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", "${(widget.model!.cartResponse.totalAmount! - widget.model!.paymentCheckoutData!.lacumInformation!.lakumInquiryInformationObjVersion!.pointsBalanceAmount!)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -333,7 +333,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Texts( Texts(
" ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", " ${TranslationBase.of(context).sar} ${(widget.model!.cartResponse.totalAmount)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -348,7 +348,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
: Container(), : Container(),
), ),
SizedBox( SizedBox(
height: widget.model.cartResponse.shoppingCarts != null ? height * 0.10 : 0, height: widget.model!.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
) )
], ],
), ),
@ -356,7 +356,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: widget.model.cartResponse.shoppingCarts != null ? height * 0.10 : 0, height: widget.model!.cartResponse.shoppingCarts != null ? height * 0.10 : 0,
color: Colors.white, color: Colors.white,
child: PaymentBottomWidget(widget.model), child: PaymentBottomWidget(widget.model),
), ),

@ -26,7 +26,7 @@ class _LakumWidgetState extends State<LakumWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
_pointsController.text = widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString(); _pointsController.text = widget.model.paymentCheckoutData.lacumInformation!.lakumInquiryInformationObjVersion!.pointsBalanceAmount.toString();
return Container( return Container(
color: Colors.white, color: Colors.white,
@ -41,9 +41,9 @@ class _LakumWidgetState extends State<LakumWidget> {
child: Checkbox( child: Checkbox(
activeColor: CustomColors.green, activeColor: CustomColors.green,
value: useLakumWidgets, value: useLakumWidgets,
onChanged: (bool value) { onChanged: (bool? value) {
setState(() { setState(() {
useLakumWidgets = value; useLakumWidgets = value!;
print(useLakumWidgets); print(useLakumWidgets);
// if (value){ // if (value){
// // isChecked; // // isChecked;
@ -62,7 +62,7 @@ class _LakumWidgetState extends State<LakumWidget> {
padding: const EdgeInsets.only(left: 8.0, right: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text( child: Text(
TranslationBase.of(context).useLakumPoints + TranslationBase.of(context).useLakumPoints +
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", " (${widget.model.paymentCheckoutData.lacumInformation!.lakumInquiryInformationObjVersion!.pointsBalance.toString() + " " + TranslationBase.of(context).points})",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
), ),
], ],
@ -85,7 +85,7 @@ class _LakumWidgetState extends State<LakumWidget> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Text( Text(
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation!.lakumInquiryInformationObjVersion!.pointsBalanceAmount.toString()}",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)
), ),
], ],

@ -17,11 +17,11 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PaymentBottomWidget extends StatelessWidget { class PaymentBottomWidget extends StatelessWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel? model;
static bool isChecked = true; static bool isChecked = true;
BuildContext context; BuildContext? context;
MyInAppBrowser browser; MyInAppBrowser? browser;
PaymentBottomWidget(this.model); PaymentBottomWidget(this.model);
@ -32,7 +32,7 @@ class PaymentBottomWidget extends StatelessWidget {
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context); OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0),
child: orderPreviewViewModel.paymentCheckoutData.cartDataVisible child: orderPreviewViewModel!.paymentCheckoutData!.cartDataVisible!
? Container( ? Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -47,13 +47,13 @@ class PaymentBottomWidget extends StatelessWidget {
children: [ children: [
isChecked isChecked
? Texts( ? Texts(
"${TranslationBase.of(context).sar} ${model.cartResponse.totalAmount}", "${TranslationBase.of(context).sar} ${model!.cartResponse.totalAmount}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xff929295), color: Color(0xff929295),
) )
: Texts( : Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(model!.cartResponse.totalAmount)!.toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xff929295), color: Color(0xff929295),
@ -71,7 +71,7 @@ class PaymentBottomWidget extends StatelessWidget {
), ),
), ),
Texts( Texts(
"${model.cartResponse.quantityCount} ${TranslationBase.of(context).items}", "${model!.cartResponse.quantityCount} ${TranslationBase.of(context).items}",
fontSize: 10, fontSize: 10,
color: Colors.grey, color: Colors.grey,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -99,13 +99,13 @@ class PaymentBottomWidget extends StatelessWidget {
onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null) onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
? () async { ? () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.makeOrder(projectViewModel.havePrivilege(83)); await model!.makeOrder(projectViewModel.havePrivilege(83));
if (model.state == ViewState.Idle) { if (model!.state == ViewState.Idle) {
AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg); AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
openPayment(model.orderListModel[0], model.authenticatedUserObject.user); openPayment(model!.orderListModel[0], model!.authenticatedUserObject.user!);
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model!.error);
} }
navigateToCartPage(); navigateToCartPage();
// Navigator.pop(context); // Navigator.pop(context);
@ -140,8 +140,8 @@ class PaymentBottomWidget extends StatelessWidget {
) { ) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart);
browser.openPharmacyPaymentBrowser(order, order.orderTotal, 'ePharmacy Order', order.id, order.billingAddress.email, order.customValuesXml, browser!.openPharmacyPaymentBrowser!(order, order.orderTotal, 'ePharmacy Order', order.id!, order!.billingAddress!.email!, order.customValuesXml!,
"${authenticatedUser.firstName} ${authenticatedUser.middleName} ${authenticatedUser.lastName}", authenticatedUser.patientID, authenticatedUser, browser); "${authenticatedUser.firstName} ${authenticatedUser.middleName} ${authenticatedUser.lastName}", authenticatedUser.patientID, authenticatedUser, browser!);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -150,7 +150,7 @@ class PaymentBottomWidget extends StatelessWidget {
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser.isOpened()) browser.close(); if (browser!.isOpened()) browser!.close();
MyInAppBrowser.isPaymentDone = true; MyInAppBrowser.isPaymentDone = true;
return; return;
} }
@ -158,7 +158,7 @@ class PaymentBottomWidget extends StatelessWidget {
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser.isOpened()) browser.close(); if (browser!.isOpened()) browser!.close();
MyInAppBrowser.isPaymentDone = false; MyInAppBrowser.isPaymentDone = false;
return; return;
} }
@ -166,7 +166,7 @@ class PaymentBottomWidget extends StatelessWidget {
} }
navigateToCartPage() { navigateToCartPage() {
Navigator.pushAndRemoveUntil(locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 0)), (Route<dynamic> r) => false); Navigator.pushAndRemoveUntil(locator<NavigationService>().navigatorKey.currentContext!, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 0)), (Route<dynamic> r) => false);
} }
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {

@ -23,14 +23,14 @@ class SelectAddressWidget extends StatefulWidget {
} }
class _SelectAddressWidgetState extends State<SelectAddressWidget> { class _SelectAddressWidgetState extends State<SelectAddressWidget> {
AddressInfo address; AddressInfo? address;
_navigateToAddressPage(String identificationNo) { _navigateToAddressPage(String identificationNo) {
Navigator.push(context, FadePage(page: PharmacyAddressesPage(orderPreviewViewModel: widget.model,isUpdate: widget.isUpdating,changeMainState: widget.changeMainState,))).then((result) async { Navigator.push(context, FadePage(page: PharmacyAddressesPage(orderPreviewViewModel: widget.model,isUpdate: widget.isUpdating,changeMainState: widget.changeMainState,))).then((result) async {
if (result != null) { if (result != null) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
address = result; address = result;
widget.model.paymentCheckoutData.address = Addresses.fromJson(address.toJson()); widget.model.paymentCheckoutData.address = Addresses.fromJson(address!.toJson());
await widget.model.getInformationsByAddress(identificationNo); await widget.model.getInformationsByAddress(identificationNo);
await widget.model.getShoppingCart(); await widget.model.getShoppingCart();
widget.changeMainState(); widget.changeMainState();
@ -48,13 +48,13 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
OrderPreviewViewModel model = Provider.of(context); OrderPreviewViewModel model = Provider.of(context);
if (widget.model.paymentCheckoutData.address != null) { if (widget.model.paymentCheckoutData.address != null) {
address = AddressInfo.fromJson(widget.model.paymentCheckoutData.address.toJson()); address = AddressInfo.fromJson(widget.model.paymentCheckoutData.address!.toJson());
} }
return Container( return Container(
color: Colors.white, color: Colors.white,
child: address == null child: address == null
? InkWell( ? InkWell(
onTap: () => {_navigateToAddressPage(model.user.patientIdentificationNo)}, onTap: () => {_navigateToAddressPage(model.user!.patientIdentificationNo!)},
child: Container( child: Container(
margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12), margin: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Row( child: Row(
@ -111,7 +111,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
), ),
), ),
InkWell( InkWell(
onTap: () => {_navigateToAddressPage(model.authenticatedUserObject.user.patientIdentificationNo)}, onTap: () => {_navigateToAddressPage(model.authenticatedUserObject.user!.patientIdentificationNo!)},
child: Texts( child: Texts(
TranslationBase.of(context).changeAddress, TranslationBase.of(context).changeAddress,
fontSize: 12, fontSize: 12,
@ -124,7 +124,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Texts( child: Texts(
"${address.firstName} ${address.lastName}", "${address!.firstName} ${address!.lastName!}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -133,7 +133,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Texts( child: Texts(
"${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}", "${address!.address1} ${address!.address2} ${address!.address2},, ${address!.city}, ${address!.country} ${address!.zipPostalCode}",
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.grey.shade500, color: Colors.grey.shade500,
@ -150,7 +150,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
), ),
), ),
Texts( Texts(
"${address.phoneNumber}", "${address!.phoneNumber}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
@ -188,7 +188,7 @@ class _SelectAddressWidgetState extends State<SelectAddressWidget> {
child: Image.asset( child: Image.asset(
model.paymentCheckoutData.shippingOption == null model.paymentCheckoutData.shippingOption == null
? "" ? ""
: model.paymentCheckoutData.shippingOption.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight" : model.paymentCheckoutData.shippingOption!.shippingRateComputationMethodSystemName == "Shipping.FixedOrByWeight"
? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain, fit: BoxFit.contain,

@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
class SelectPaymentOptionWidget extends StatefulWidget { class SelectPaymentOptionWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
final Function changeMainState; final VoidCallback? changeMainState;
final bool isUpdating; final bool isUpdating;
@ -19,7 +19,7 @@ class SelectPaymentOptionWidget extends StatefulWidget {
} }
class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> { class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
PaymentOption paymentOption; PaymentOption? paymentOption;
_navigateToPaymentOption() { _navigateToPaymentOption() {
Navigator.push(context, FadePage(page: PaymentMethodSelectPage(model: widget.model,changeMainState:widget.changeMainState,isUpdating: widget.isUpdating,))) Navigator.push(context, FadePage(page: PaymentMethodSelectPage(model: widget.model,changeMainState:widget.changeMainState,isUpdating: widget.isUpdating,)))
@ -30,7 +30,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
widget.model.paymentCheckoutData.paymentOption = widget.model.paymentCheckoutData.paymentOption =
paymentOption; paymentOption;
} }
widget.changeMainState(); widget.changeMainState!();
}) })
}); });
} }
@ -98,7 +98,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
), ),
child: Image.asset( child: Image.asset(
widget.model.getPaymentOptionImage(paymentOption), widget.model.getPaymentOptionImage(paymentOption!),
width: 30.0, width: 30.0,
height: 30.0, height: 30.0,
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,
@ -108,7 +108,7 @@ class _SelectPaymentOptionWidgetState extends State<SelectPaymentOptionWidget> {
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6), padding: EdgeInsets.symmetric(vertical: 0, horizontal: 6),
child: Texts( child: Texts(
widget.model.getPaymentOptionName(paymentOption), widget.model.getPaymentOptionName(paymentOption!),
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,

@ -12,7 +12,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LakumActivationVidaPage extends StatelessWidget { class LakumActivationVidaPage extends StatelessWidget {
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
TextEditingController _identificationNumberController = new TextEditingController(); TextEditingController _identificationNumberController = new TextEditingController();
@override @override
@ -73,14 +73,14 @@ class LakumActivationVidaPage extends StatelessWidget {
? () { ? () {
model.checkLacumAccountActivation(_identificationNumberController.text).then((_) { model.checkLacumAccountActivation(_identificationNumberController.text).then((_) {
if (model.state == ViewState.Idle) { if (model.state == ViewState.Idle) {
if (model.lacumInformation.status != "Hold") { if (model.lacumInformation!.status != "Hold") {
AppToast.showErrorToast(message: TranslationBase.of(context).lakumUnhold); AppToast.showErrorToast(message: TranslationBase.of(context).lakumUnhold);
if (model.lacumInformation.status != "Discontinue") { if (model.lacumInformation!.status != "Discontinue") {
AppToast.showErrorToast(message: TranslationBase.of(context).lakumDiscontinue); AppToast.showErrorToast(message: TranslationBase.of(context).lakumDiscontinue);
} }
} else { } else {
if (model.lacumInformation.status == "Hold") { if (model.lacumInformation!.status == "Hold") {
model.makeAccountActivate(projectViewModel.user.patientIdentificationNo).then((value) { model.makeAccountActivate(projectViewModel!.user!.patientIdentificationNo!).then((value) {
AppToast.showSuccessToast(message: TranslationBase.of(context).lakumSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).lakumSuccess);
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });

@ -29,7 +29,7 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
List<IdNamePair> languages =[]; List<IdNamePair> languages =[];
IdNamePair selectedLanguage; IdNamePair? selectedLanguage;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -162,7 +162,7 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
enabled: false, enabled: false,
decoration: InputDecoration( decoration: InputDecoration(
suffixIcon: Icon(Icons.arrow_drop_down), suffixIcon: Icon(Icons.arrow_drop_down),
hintText: selectedLanguage == null ? "${TranslationBase.of(context).prefferedLanguage}" : "${selectedLanguage.name}", hintText: selectedLanguage == null ? "${TranslationBase.of(context).prefferedLanguage}" : "${selectedLanguage!.name!}",
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 16, fontSize: 16,
color: Colors.black, color: Colors.black,
@ -194,7 +194,7 @@ class _LakumRegistrationPageState extends State<LakumRegistrationPage> {
context, context,
FadePage( FadePage(
page: LakumTermsConditions( page: LakumTermsConditions(
widget.patientIdentificationNo, _firstNameController.text, _lastNameController.text, _mobileNumberController.text, selectedLanguage.id))) widget.patientIdentificationNo, _firstNameController.text, _lastNameController.text, _mobileNumberController.text, selectedLanguage!.id)))
.then( .then(
(status) => { (status) => {
if (status == 200) {Navigator.pop(context, "")} if (status == 200) {Navigator.pop(context, "")}

@ -28,16 +28,16 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
TextEditingController _nameController = new TextEditingController(); TextEditingController _nameController = new TextEditingController();
TextEditingController _phoneController = new TextEditingController(); TextEditingController _phoneController = new TextEditingController();
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
void initState() { void initState() {
_lakumAccountActivated = widget.lacumGroupInformation _lakumAccountActivated = widget.lacumGroupInformation
.lakumInquiryInformationObjVersion.accountStatus == .lakumInquiryInformationObjVersion!.accountStatus ==
"Active"; "Active";
super.initState(); super.initState();
_nameController.text = widget.lacumGroupInformation.lakumInquiryInformationObjVersion.memberName; _nameController.text = widget.lacumGroupInformation!.lakumInquiryInformationObjVersion!.memberName!;
_phoneController.text = widget.lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber; _phoneController.text = widget.lacumGroupInformation!.lakumInquiryInformationObjVersion!.mobileNumber!;
} }
@override @override
@ -73,8 +73,8 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
_buildSettingScreen(MediaQueryData mediaQuery, LacumViewModel model) { _buildSettingScreen(MediaQueryData mediaQuery, LacumViewModel model) {
bool canUpdate = (_nameController.text != "" && bool canUpdate = (_nameController.text != "" &&
_phoneController.text != "" && _phoneController.text != "" &&
(_nameController.text != widget.lacumGroupInformation.lakumInquiryInformationObjVersion.memberName || (_nameController.text != widget.lacumGroupInformation.lakumInquiryInformationObjVersion!.memberName ||
_phoneController.text != widget.lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber)); _phoneController.text != widget.lacumGroupInformation.lakumInquiryInformationObjVersion!.mobileNumber));
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
@ -131,9 +131,9 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
value: _lakumAccountActivated, value: _lakumAccountActivated,
onChanged: (val) { onChanged: (val) {
if (_lakumAccountActivated) { if (_lakumAccountActivated) {
model.makeAccountDeactivate(projectViewModel.user.patientIdentificationNo); model.makeAccountDeactivate(projectViewModel!.user!.patientIdentificationNo!);
} else { } else {
model.makeAccountActivate(projectViewModel.user.patientIdentificationNo); model.makeAccountActivate(projectViewModel!.user!.patientIdentificationNo!);
} }
setState(() { setState(() {
_lakumAccountActivated = val; _lakumAccountActivated = val;

@ -99,7 +99,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}", "${model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.pointsBalance}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
@ -153,7 +153,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}", "${model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.pointsBalanceAmount}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
@ -196,7 +196,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
: () {}, : () {},
), ),
), ),
(model.lacumReceiverInformation != null && model.lacumReceiverInformation.lakumInquiryInformationObjVersion != null) (model.lacumReceiverInformation != null && model.lacumReceiverInformation!.lakumInquiryInformationObjVersion != null)
? Container( ? Container(
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
child: Column( child: Column(
@ -211,7 +211,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
child: TextField( child: TextField(
enabled: false, enabled: false,
decoration: new InputDecoration( decoration: new InputDecoration(
hintText: "${model.lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName}", hintText: "${model.lacumReceiverInformation!.lakumInquiryInformationObjVersion!.memberName}",
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 16, fontSize: 16,
color: Colors.grey.shade600, color: Colors.grey.shade600,
@ -252,7 +252,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
: Container() : Container()
], ],
), ),
if (model.lacumReceiverInformation != null && model.lacumReceiverInformation.lakumInquiryInformationObjVersion != null) if (model.lacumReceiverInformation != null && model.lacumReceiverInformation!.lakumInquiryInformationObjVersion != null)
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
child: BorderedButton( child: BorderedButton(

@ -18,7 +18,7 @@ import 'package:provider/provider.dart';
import 'lacum-activitaion-vida-page.dart'; import 'lacum-activitaion-vida-page.dart';
class LakumMainPage extends StatelessWidget { class LakumMainPage extends StatelessWidget {
ProjectViewModel projectViewModel; ProjectViewModel? projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -27,11 +27,11 @@ class LakumMainPage extends StatelessWidget {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getLacumData(projectViewModel.user.patientIdentificationNo); await model.getLacumData(projectViewModel!.user!.patientIdentificationNo!);
if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) { if (model.lacumInformation!.yahalaAccountNo == 0 || model.lacumInformation!.yahalaAccountNo == null) {
navigateToLakumRegister(context); navigateToLakumRegister(context);
} else { } else {
if (model.lacumInformation.status == "Hold") { if (model.lacumInformation!.status == "Hold") {
Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage())); Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage()));
} }
} }
@ -51,7 +51,7 @@ class LakumMainPage extends StatelessWidget {
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: (model.lacumGroupInformation != null && model.lacumGroupInformation.lakumInquiryInformationObjVersion != null) child: (model.lacumGroupInformation != null && model.lacumGroupInformation!.lakumInquiryInformationObjVersion != null)
? Column( ? Column(
children: [ children: [
Stack( Stack(
@ -73,7 +73,7 @@ class LakumMainPage extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
LakumHomeButtons(mediaQuery, model, projectViewModel), LakumHomeButtons(mediaQuery, model, projectViewModel!),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -83,13 +83,13 @@ class LakumMainPage extends StatelessWidget {
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
LacumPointsWidget(mediaQuery, 1, TranslationBase.of(context).balance, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount, LacumPointsWidget(mediaQuery, 1, TranslationBase.of(context).balance, model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.pointsBalanceAmount!,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance, null), model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.pointsBalance!, []),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmount, LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.gainedPointsAmount!,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear), model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.gainedPoints!, model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.gainedPointsAmountPerYear!),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
@ -97,16 +97,16 @@ class LakumMainPage extends StatelessWidget {
mediaQuery, mediaQuery,
3, 3,
TranslationBase.of(context).consumed, TranslationBase.of(context).consumed,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.consumedPointsAmount! != null
? num.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount) ? num.parse(model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.consumedPointsAmount!)
: 0, : 0,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints, model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.consumedPoints!,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear), model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.consumedPointsAmountPerYear!),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget(mediaQuery, 4, TranslationBase.of(context).transferred, 0, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPoints, LacumPointsWidget(mediaQuery, 4, TranslationBase.of(context).transferred, 0, model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.transferPoints!,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPointsAmountPerYear), model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.transferPointsAmountPerYear!),
], ],
), ),
), ),
@ -153,7 +153,7 @@ class LakumMainPage extends StatelessWidget {
], ],
), ),
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.expiredPoints} ${TranslationBase.of(context).lakumPoint} ", "${model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.expiredPoints} ${TranslationBase.of(context).lakumPoint} ",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
@ -187,7 +187,7 @@ class LakumMainPage extends StatelessWidget {
], ],
), ),
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}", "${model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
@ -221,7 +221,7 @@ class LakumMainPage extends StatelessWidget {
], ],
), ),
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsWillBeExpired} ${TranslationBase.of(context).lakumPoint}", "${model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.pointsWillBeExpired} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
@ -251,7 +251,7 @@ class LakumMainPage extends StatelessWidget {
} }
navigateToLakumRegister(BuildContext context) { navigateToLakumRegister(BuildContext context) {
Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo))); Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel!.user!.patientIdentificationNo!)));
} }
List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) { List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) {
@ -260,7 +260,7 @@ class LakumMainPage extends StatelessWidget {
icon: Icon(Icons.settings), icon: Icon(Icons.settings),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData(projectViewModel.user.patientIdentificationNo)}); Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation!, model.lacumGroupInformation!))).then((result) => {model.getLacumGroupData(projectViewModel!.user!.patientIdentificationNo!)});
}, },
), ),
]; ];
@ -328,8 +328,8 @@ class LakumHomeButtons extends StatelessWidget {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) { Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation!, model.lacumGroupInformation!))).then((result) {
model.getLacumGroupData(projectViewModel.user.patientIdentificationNo); model.getLacumGroupData(projectViewModel.user!.patientIdentificationNo!);
}); });
}, },
child: Container( child: Container(
@ -379,7 +379,7 @@ class LacumPointsWidget extends StatelessWidget {
final String title; final String title;
final num riyal; final num riyal;
final num point; final num point;
Color titleColor; Color? titleColor;
final List<PointsAmountPerYear> pointsAmountPerYear; final List<PointsAmountPerYear> pointsAmountPerYear;
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, this.point, this.pointsAmountPerYear) { LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, this.point, this.pointsAmountPerYear) {

@ -140,14 +140,14 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
LakumPointTableRowWidget(true, "DATE", 0, 0, null, 0), LakumPointTableRowWidget(true, "DATE", 0, 0, (){}, 0),
...List.generate( ...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday.length, widget.pointsAmountPerMonth.pointsAmountPerday!.length,
(index) => LakumPointTableRowWidget( (index) => LakumPointTableRowWidget(
false, false,
DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.pointsAmountPerMonth.pointsAmountPerday[index].transationDate), "en"), DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.pointsAmountPerMonth!.pointsAmountPerday![index].transationDate!), "en"),
widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsPerDay, widget.pointsAmountPerMonth.pointsAmountPerday![index].pointsPerDay!,
widget.pointsAmountPerMonth.pointsAmountPerday[index].amountPerDay, widget.pointsAmountPerMonth.pointsAmountPerday![index].amountPerDay!,
() { () {
setState(() { setState(() {
if (widget.expandedItemIndex == index) { if (widget.expandedItemIndex == index) {
@ -162,11 +162,11 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
collapsed: Column( collapsed: Column(
children: [ children: [
...List.generate( ...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails.length, widget.pointsAmountPerMonth.pointsAmountPerday![index].pointsDetails!.length,
(index) => DayPointsDetailWidget( (index) => DayPointsDetailWidget(
widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].subTransactionTypeDescription, widget.pointsAmountPerMonth!.pointsAmountPerday![index].pointsDetails![index].subTransactionTypeDescription!,
widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].purchasePoints, widget.pointsAmountPerMonth.pointsAmountPerday![index].pointsDetails![index].purchasePoints!,
widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].amount), widget.pointsAmountPerMonth.pointsAmountPerday![index]!.pointsDetails![index].amount!),
), ),
], ],
), ),

@ -63,22 +63,22 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
SizedBox( SizedBox(
height: 0, height: 0,
), ),
LakumPointTableRowWidget(true, "MONTH", 0, 0, null, 0), LakumPointTableRowWidget(true, "MONTH", 0, 0, (){}, 0),
...List.generate( ...List.generate(
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth.length, .pointsAmountPerMonth!.length,
(index) => LakumPointTableRowWidget( (index) => LakumPointTableRowWidget(
false, false,
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].month.toString(), .pointsAmountPerMonth![index].month.toString(),
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear![widget.selectedIndexYear]!
.pointsAmountPerMonth[index].pointsPerMonth, .pointsAmountPerMonth![index].pointsPerMonth!,
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]!
.pointsAmountPerMonth[index].amountPerMonth, .pointsAmountPerMonth![index].amountPerMonth!,
(){ (){
Navigator.push(context, Navigator.push(context,
FadePage(page: LakumPointMonthPage(widget.pointsAmountPerYear[widget.selectedIndexYear] FadePage(page: LakumPointMonthPage(widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index], widget.pointsAmountPerYear[widget.selectedIndexYear].year))); .pointsAmountPerMonth![index], widget.pointsAmountPerYear![widget.selectedIndexYear!].year!)));
}, },
index), index),
), ),
@ -95,7 +95,7 @@ class LacumPointsYearWidget extends StatelessWidget {
final MediaQueryData mediaQuery; final MediaQueryData mediaQuery;
final bool isSelected; final bool isSelected;
final PointsAmountPerYear yearPoints; final PointsAmountPerYear yearPoints;
final Function yearOnTap; final VoidCallback yearOnTap;
LacumPointsYearWidget( LacumPointsYearWidget(
this.mediaQuery, this.isSelected, this.yearPoints, this.yearOnTap); this.mediaQuery, this.isSelected, this.yearPoints, this.yearOnTap);

@ -12,18 +12,18 @@ import 'package:flutter/material.dart';
import 'cart-page/cart-order-preview.dart'; import 'cart-page/cart-order-preview.dart';
class PaymentMethodSelectPage extends StatefulWidget { class PaymentMethodSelectPage extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel? model;
final bool isUpdating; final bool isUpdating;
final Function changeMainState; final VoidCallback? changeMainState;
const PaymentMethodSelectPage({Key key, this.model, this.isUpdating = false, this.changeMainState}) : super(key: key); const PaymentMethodSelectPage({Key? key, this.model, this.isUpdating = false, this.changeMainState}) : super(key: key);
@override @override
_PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState(); _PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState();
} }
class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> { class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
PaymentOption selectedPaymentOption; PaymentOption? selectedPaymentOption;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -57,7 +57,7 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
children: [ children: [
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption!,
PaymentOption.meda, PaymentOption.meda,
() => { () => {
setState(() { setState(() {
@ -66,7 +66,7 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
}), }),
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption!,
PaymentOption.visa, PaymentOption.visa,
() => { () => {
setState(() { setState(() {
@ -75,17 +75,17 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
}), }),
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption!,
PaymentOption.mastercard, PaymentOption.mastercard,
() => { () => {
setState(() { setState(() {
selectedPaymentOption = PaymentOption.mastercard; selectedPaymentOption = PaymentOption.mastercard;
}) })
}), }),
widget.model.cartResponse.totalAmount > 1000 widget.model!.cartResponse.totalAmount! > 1000
? PaymentMethodCard( ? PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption!,
PaymentOption.installments, PaymentOption.installments,
() => { () => {
setState(() { setState(() {
@ -96,7 +96,7 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
if (Platform.isIOS) if (Platform.isIOS)
PaymentMethodCard( PaymentMethodCard(
cardWidth, cardWidth,
selectedPaymentOption, selectedPaymentOption!,
PaymentOption.applepay, PaymentOption.applepay,
() => { () => {
setState(() { setState(() {
@ -116,9 +116,9 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
TranslationBase.of(context).next, TranslationBase.of(context).next,
selectedPaymentOption != null selectedPaymentOption != null
? () { ? () {
widget.model.paymentCheckoutData.paymentOption = selectedPaymentOption; widget.model!.paymentCheckoutData!.paymentOption = selectedPaymentOption;
if (widget.isUpdating) { if (widget.isUpdating) {
widget.changeMainState(); widget.changeMainState!();
Navigator.pop(context); Navigator.pop(context);
return; return;
} else { } else {
@ -126,7 +126,7 @@ class _PaymentMethodSelectPageState extends State<PaymentMethodSelectPage> {
context, context,
FadePage( FadePage(
page: OrderPreviewPage( page: OrderPreviewPage(
model: widget.model, model: widget.model!,
), ),
), ),
); );
@ -145,7 +145,7 @@ class PaymentMethodCard extends StatelessWidget {
final double cardWidth; final double cardWidth;
final PaymentOption selectedPaymentOption; final PaymentOption selectedPaymentOption;
final PaymentOption paymentOption; final PaymentOption paymentOption;
final Function selectMethod; final VoidCallback selectMethod;
PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod); PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod);

@ -19,7 +19,7 @@ var product;
var customerId; var customerId;
var item; var item;
dynamic languageID; dynamic languageID;
List wishlistData; List? wishlistData;
class PharmacyPage extends StatefulWidget { class PharmacyPage extends StatefulWidget {
@override @override

@ -6,15 +6,15 @@ import 'package:map_launcher/map_launcher.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class AvailabilityInfo extends StatelessWidget { class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel; final ProductDetailViewModel? previousModel;
final InAppBrowser browser = new InAppBrowser(); final InAppBrowser browser = new InAppBrowser();
AvailabilityInfo({Key key, this.previousModel}) : super(key: key); AvailabilityInfo({Key? key, this.previousModel}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return previousModel.productLocationService.length == 0 return previousModel!.productLocationService.length == 0
? Container( ? Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
alignment: Alignment.center, alignment: Alignment.center,
@ -28,7 +28,7 @@ class AvailabilityInfo extends StatelessWidget {
physics: ScrollPhysics(), physics: ScrollPhysics(),
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: previousModel.productLocationService.length, itemCount: previousModel!.productLocationService.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
@ -39,7 +39,7 @@ class AvailabilityInfo extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Image.network(previousModel.productLocationService[index].projectImageUrl), child: Image.network(previousModel!.productLocationService![index].projectImageUrl!),
), ),
SizedBox( SizedBox(
width: 10, width: 10,
@ -47,7 +47,7 @@ class AvailabilityInfo extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Text( child: Text(
previousModel.productLocationService[index].locationDescription + "\n" + previousModel.productLocationService[index].cityName.toString(), previousModel!.productLocationService![index].locationDescription! + "\n" + previousModel!.productLocationService[index].cityName.toString(),
style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
), ),
), ),
@ -59,8 +59,8 @@ class AvailabilityInfo extends StatelessWidget {
onPressed: () async { onPressed: () async {
await MapLauncher.showMarker( await MapLauncher.showMarker(
mapType: MapType.google, mapType: MapType.google,
coords: Coords(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude)), coords: Coords(double.parse(previousModel!.productLocationService[index].latitude!), double.parse(previousModel!.productLocationService[index]!.longitude!)),
title: previousModel.productLocationService[index].locationDescription, title: previousModel!.productLocationService![index].locationDescription!,
); );
}, },
), ),
@ -71,7 +71,7 @@ class AvailabilityInfo extends StatelessWidget {
icon: Icon(Icons.phone), icon: Icon(Icons.phone),
color: Colors.red, color: Colors.red,
onPressed: () { onPressed: () {
launch("tel://" + previousModel.productLocationService[index].phoneNumber); launch("tel://" + previousModel!.productLocationService[index]!.phoneNumber!);
}, },
), ),
), ),

@ -7,9 +7,9 @@ import 'package:provider/provider.dart';
class DetailsInfo extends StatelessWidget { class DetailsInfo extends StatelessWidget {
final PharmacyProduct product; final PharmacyProduct? product;
const DetailsInfo({Key key, this.product}) : super(key: key); const DetailsInfo({Key? key, this.product}) : super(key: key);
@override @override
@ -41,9 +41,9 @@ class DetailsInfo extends StatelessWidget {
margin: EdgeInsets.only(left: 10, right: 10), margin: EdgeInsets.only(left: 10, right: 10),
child: Text( child: Text(
projectViewModel.isArabic projectViewModel.isArabic
? product.fullDescriptionn ? product!.fullDescriptionn!
: product : product!
.fullDescription ?? .fullDescription! ??
"", "",
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.56), style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.56),
), ),

@ -2,9 +2,9 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DiscountDescription extends StatelessWidget { class DiscountDescription extends StatelessWidget {
final PharmacyProduct product; final PharmacyProduct? product;
const DiscountDescription({Key key, this.product}) : super(key: key); const DiscountDescription({Key? key, this.product}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -20,8 +20,8 @@ class DiscountDescription extends StatelessWidget {
child: Container( child: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Text( child: Text(
product product!
.discountDescription, .discountDescription!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 17), fontSize: 17),

@ -23,12 +23,12 @@ class FooterWidget extends StatefulWidget {
final int minQuantity; final int minQuantity;
final int quantityLimit; final int quantityLimit;
final PharmacyProduct item; final PharmacyProduct item;
final Function addToCartFunction; final Function? addToCartFunction;
final Function addToShoppingCartFunction; final Function? addToShoppingCartFunction;
final ProductDetailViewModel model; final ProductDetailViewModel? model;
int quantity; int? quantity;
bool isOverQuantity; bool? isOverQuantity;
FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity, FooterWidget(this.isAvailable, this.maxQuantity, this.minQuantity,
this.quantityLimit, this.item, this.quantityLimit, this.item,
@ -136,7 +136,7 @@ class _FooterWidgetState extends State<FooterWidget> {
Container( Container(
width: 100, width: 100,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey[300]), border: Border.all(color: Colors.grey[300]!),
color: Colors.white, color: Colors.white,
), ),
child: TextField( child: TextField(
@ -151,7 +151,7 @@ class _FooterWidgetState extends State<FooterWidget> {
} else { } else {
setState(() { setState(() {
widget.quantity = int.parse(text); widget.quantity = int.parse(text);
if (widget.quantity >= if (widget.quantity! >=
widget.quantityLimit) { widget.quantityLimit) {
widget.isOverQuantity = true; widget.isOverQuantity = true;
} else { } else {
@ -220,7 +220,7 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
], ],
), ),
onPressed: widget.isAvailable && !widget.item.isRx onPressed: widget.isAvailable && !widget.item.isRx!
? () { ? () {
setState(() { setState(() {
if (showUI) { if (showUI) {
@ -249,7 +249,7 @@ class _FooterWidgetState extends State<FooterWidget> {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
} else } else
await widget.addToCartFunction( await widget.addToCartFunction!(
quantity: widget.quantity, quantity: widget.quantity,
itemID: widget.item.id, itemID: widget.item.id,
model: widget.model); model: widget.model);
@ -276,7 +276,7 @@ class _FooterWidgetState extends State<FooterWidget> {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
} else { } else {
await widget.addToShoppingCartFunction( await widget.addToShoppingCartFunction!(
quantity: widget.quantity, quantity: widget.quantity,
itemID: widget.item.id, itemID: widget.item.id,
model: widget.model); model: widget.model);
@ -299,15 +299,15 @@ class _FooterWidgetState extends State<FooterWidget> {
} }
bool isBuyNowDisable() { bool isBuyNowDisable() {
return (!widget.isAvailable && widget.quantity > 0) || return (!widget.isAvailable && widget.quantity! > 0) ||
(widget.quantity > widget.quantityLimit) || (widget.quantity! > widget.quantityLimit) ||
widget.item.isRx; widget.item.isRx!;
} }
bool isAddToCartDisable() { bool isAddToCartDisable() {
return (!widget.isAvailable && widget.quantity > 0) || return (!widget.isAvailable && widget.quantity! > 0) ||
widget.quantity > widget.quantityLimit || widget.quantity! > widget.quantityLimit ||
widget.item.isRx; widget.item.isRx!;
} }
void setUserValues(value) async { void setUserValues(value) async {
@ -343,15 +343,16 @@ class _FooterWidgetState extends State<FooterWidget> {
} }
} }
onChangeValue(int i) { onChangeValue(int i) {
setState(() { setState(() {
widget.quantity = i; widget.quantity = i;
if (widget.quantity >= widget.quantityLimit) { if (widget.quantity! >= widget.quantityLimit) {
widget.isOverQuantity = true; widget.isOverQuantity = true;
} else { } else {
widget.isOverQuantity = false; widget.isOverQuantity = false;
return widget.quantity; //return widget.quantity!;
} }
}); });
} }
} }

@ -1,12 +1,12 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class QuantityBox extends StatelessWidget { class QuantityBox extends StatelessWidget {
final int label; final int? label;
final bool isSelected; final bool? isSelected;
final Function(int) onTapFunc; final Function(int)? onTapFunc;
QuantityBox({ QuantityBox({
Key key, Key? key,
this.label, this.label,
this.onTapFunc, this.isSelected = false, this.onTapFunc, this.isSelected = false,
}) : super(key: key); }) : super(key: key);
@ -18,7 +18,7 @@ class QuantityBox extends StatelessWidget {
InkWell( InkWell(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color:isSelected?Colors.green: Colors.grey[300]), border: Border.all(color:isSelected!?Colors.green: Colors.grey[300]!),
color: Colors.white, color: Colors.white,
), ),
alignment: Alignment.center, alignment: Alignment.center,
@ -30,7 +30,7 @@ class QuantityBox extends StatelessWidget {
), ),
), ),
onTap:(){ onTap:(){
onTapFunc(label); onTapFunc!(label!)!;
} }
), ),
SizedBox( SizedBox(

@ -22,8 +22,8 @@ import 'discount_description.dart';
import 'footor/footer-widget.dart'; import 'footor/footer-widget.dart';
import 'shared/product_details_app_bar.dart'; import 'shared/product_details_app_bar.dart';
String itemID; late String itemID;
PharmacyProduct specificationData; late PharmacyProduct specificationData;
class ProductDetailPage extends StatefulWidget { class ProductDetailPage extends StatefulWidget {
final PharmacyProduct product; final PharmacyProduct product;
@ -41,7 +41,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
bool isDetails = true; bool isDetails = true;
bool isReviews = false; bool isReviews = false;
bool isAvailability = false; bool isAvailability = false;
String customerId; String? customerId;
bool isSelected = true; bool isSelected = true;
bool isOverQuantity = false; bool isOverQuantity = false;
bool isInWishList = false; bool isInWishList = false;
@ -120,14 +120,14 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
color: Colors.white, color: Colors.white,
child: Column( child: Column(
children: [ children: [
if (widget.product.images.isNotEmpty) if (widget.product.images!.isNotEmpty)
Stack( Stack(
children: [ children: [
Container( Container(
height: MediaQuery.of(context).size.height * .40, height: MediaQuery.of(context).size.height * .40,
child: Center( child: Center(
child: Image.network( child: Image.network(
widget.product.images[0].src.trim(), widget.product.images![0].src!.trim(),
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
@ -364,9 +364,9 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
bottomSheet: model.state == ViewState.Idle || model.state == ViewState.ErrorLocal bottomSheet: model.state == ViewState.Idle || model.state == ViewState.ErrorLocal
? FooterWidget( ? FooterWidget(
model.isStockAvailable, model.isStockAvailable,
widget.product.orderMaximumQuantity, widget.product.orderMaximumQuantity!,
widget.product.orderMinimumQuantity, widget.product.orderMinimumQuantity!,
model.stockQuantity, model.stockQuantity!.toInt(),
widget.product, widget.product,
quantity: quantity, quantity: quantity,
isOverQuantity: isOverQuantity, isOverQuantity: isOverQuantity,
@ -378,36 +378,36 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
)); ));
} }
addToShoppingCartFunction({quantity, itemID, ProductDetailViewModel model}) async { addToShoppingCartFunction({quantity, itemID, ProductDetailViewModel? model}) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID, context); await model?.addToCartData(quantity, itemID, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal) Utils.navigateToCartPage(); if (model?.state != ViewState.ErrorLocal) Utils.navigateToCartPage();
} }
addToWishlistFunction({itemID, ProductDetailViewModel model}) async { addToWishlistFunction({itemID, ProductDetailViewModel? model}) async {
isInWishList = true; isInWishList = true;
await model.addToWishlistData(itemID, context); await model?.addToWishlistData!(itemID, context);
setState(() {}); setState(() {});
} }
deleteFromWishlistFunction({itemID, ProductDetailViewModel model}) async { deleteFromWishlistFunction({itemID, ProductDetailViewModel? model}) async {
isInWishList = false; isInWishList = false;
await model.deleteWishlistData(itemID, context); await model?.deleteWishlistData!(itemID, context);
setState(() {}); setState(() {});
} }
addToCartFunction({ addToCartFunction({
quantity, quantity,
itemID, itemID,
ProductDetailViewModel model, ProductDetailViewModel? model,
}) async { }) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.addToCartData(quantity, itemID, context); await model?.addToCartData!(quantity, itemID, context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model}) async { notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel? model}) async {
await model.notifyMe(customerId, itemId); await model?.notifyMe!(customerId, itemId);
} }
} }

@ -5,9 +5,9 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import '../../../../locator.dart'; import '../../../../locator.dart';
import 'shared/icon_with_bg.dart'; import 'shared/icon_with_bg.dart';
@ -16,12 +16,12 @@ class ProductNameAndPrice extends StatefulWidget {
BuildContext context; BuildContext context;
PharmacyProduct item; PharmacyProduct item;
final customerId; final customerId;
final bool isInWishList; final bool? isInWishList;
final Function notifyMeWhenAvailable; final Function? notifyMeWhenAvailable;
final Function addToWishlistFunction; final Function? addToWishlistFunction;
final Function deleteFromWishlistFunction; final Function? deleteFromWishlistFunction;
final bool isStockAvailable; final bool isStockAvailable;
final String stockAvailability; final String? stockAvailability;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -116,7 +116,7 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
// color: getStatusBackgroundColor(), // color: getStatusBackgroundColor(),
// borderRadius: BorderRadius.circular(30.0)), // borderRadius: BorderRadius.circular(30.0)),
child: Text( child: Text(
widget.stockAvailability, widget.stockAvailability!,
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),letterSpacing:-0.44)), style: TextStyle(fontWeight: FontWeight.w600, fontSize: 11, color: Color(0xffFFFFFF),letterSpacing:-0.44)),
//color: widget.isStockAvailable ? Colors.white : Colors.red, //color: widget.isStockAvailable ? Colors.white : Colors.red,
), ),
@ -134,25 +134,25 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
icon: Icon(Icons.notifications_active), icon: Icon(Icons.notifications_active),
color: new Color(0xff2E303A), color: new Color(0xff2E303A),
onPressed: () { onPressed: () {
widget.notifyMeWhenAvailable( widget!.notifyMeWhenAvailable!(
context, widget.item.id); context, widget.item.id);
}, },
), ),
IconButton( IconButton(
icon: Icon(!widget.isInWishList icon: Icon(!widget.isInWishList!
? Icons.favorite_border ? Icons.favorite_border
: Icons.favorite), : Icons.favorite),
color: !widget.isInWishList color: !widget.isInWishList!
? Color(0xff2E303A) ? Color(0xff2E303A)
: Color(0xffD02127), : Color(0xffD02127),
onPressed: () async { onPressed: () async {
{ {
if (widget.customerId != null) { if (widget.customerId != null) {
if (!widget.isInWishList) { if (!widget.isInWishList!) {
await widget await widget
.addToWishlistFunction(widget.item.id); .addToWishlistFunction!(widget.item.id);
} else { } else {
await widget.deleteFromWishlistFunction( await widget.deleteFromWishlistFunction!(
widget.item.id); widget.item.id);
} }
} else { } else {
@ -166,20 +166,20 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
), ),
) )
: IconButton( : IconButton(
icon: Icon(!widget.isInWishList icon: Icon(!widget.isInWishList!
? Icons.favorite_border ? Icons.favorite_border
: Icons.favorite), : Icons.favorite),
color: !widget.isInWishList color: !widget.isInWishList!
? Color(0xff2E303A) ? Color(0xff2E303A)
: Color(0xffD02127), : Color(0xffD02127),
onPressed: () async { onPressed: () async {
{ {
if (widget.customerId != null) { if (widget.customerId != null) {
if (!widget.isInWishList) { if (!widget.isInWishList!) {
await widget await widget
.addToWishlistFunction(widget.item.id); .addToWishlistFunction!(widget.item.id);
} else { } else {
await widget.deleteFromWishlistFunction( await widget.deleteFromWishlistFunction!(
widget.item.id); widget.item.id);
} }
} else { } else {
@ -287,16 +287,35 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,
child: Row( child: Row(
children: [ children: [
RatingBar.readOnly( // RatingBar.readOnly(
// initialRating: double.parse(
// widget.item.approvedRatingSum.toString()),
// size: 18.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star_border,
// ),
RatingBar(
initialRating: double.parse( initialRating: double.parse(
widget.item.approvedRatingSum.toString()), widget.item.approvedRatingSum.toString()),
size: 18.0, direction: Axis.horizontal,
filledColor: Color(0XFFD02127), allowHalfRating: true,
emptyColor: Color(0XFFD02127), itemCount: 5,
isHalfAllowed: true, itemSize: 20,
halfFilledIcon: Icons.star_half, ignoreGestures: true,
filledIcon: Icons.star, ratingWidget: RatingWidget(
emptyIcon: Icons.star_border, 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);
},
), ),
SizedBox( SizedBox(
width: 5, width: 5,

@ -14,23 +14,23 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class RecommendedProducts extends StatefulWidget { class RecommendedProducts extends StatefulWidget {
final PharmacyProduct product; final PharmacyProduct? product;
final String customerId; final String? customerId;
final ProductDetailViewModel productDetailViewModel; final ProductDetailViewModel? productDetailViewModel;
final bool isOverQuantity; final bool isOverQuantity;
final bool isInWishList; final bool isInWishList;
final Function addToWishlistFunction; final VoidCallback? addToWishlistFunction;
final Function deleteFromWishlistFunction; final VoidCallback? deleteFromWishlistFunction;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
RecommendedProducts( RecommendedProducts(
{Key key, {Key? key,
this.product, this.product,
this.productDetailViewModel, this.productDetailViewModel,
this.customerId, this.customerId,
@ -72,7 +72,7 @@ class _RecommendedProductsState extends State<RecommendedProducts> {
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4), // margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>( child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => onModelReady: (model) =>
model.getRecommendedProducts(widget.product.id), model.getRecommendedProducts(widget.product!.id!),
builder: (_, model, wi) => NetworkBaseView( builder: (_, model, wi) => NetworkBaseView(
isLocalLoader: true, isLocalLoader: true,
baseViewModel: model, baseViewModel: model,
@ -83,7 +83,7 @@ class _RecommendedProductsState extends State<RecommendedProducts> {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500], Colors.grey[500]!,
), ),
), ),
), ),
@ -115,7 +115,7 @@ class _RecommendedProductsState extends State<RecommendedProducts> {
elevation: 2, elevation: 2,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
color: Colors.grey[300], width: 2), color: Colors.grey[300]!, width: 2),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
@ -148,14 +148,14 @@ class _RecommendedProductsState extends State<RecommendedProducts> {
) { ) {
if (!widget.isInWishList && model.recommendedProductList[index].isinwishlist != true) { if (!widget.isInWishList && model.recommendedProductList[index].isinwishlist != true) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.addToWishlistFunction(model.recommendedProductList[index].id, widget.addToWishlistFunction!(
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
model.recommendedProductList[index].isinwishlist = true;}); model.recommendedProductList[index].isinwishlist = true;});
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.deleteFromWishlistFunction(model.recommendedProductList[index].id, widget.deleteFromWishlistFunction!(
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
@ -184,14 +184,14 @@ class _RecommendedProductsState extends State<RecommendedProducts> {
model model
.recommendedProductList[ .recommendedProductList[
index] index]
.images .images!
.length > .length >
0) 0)
? Image.network( ? Image.network(
model model
.recommendedProductList[ .recommendedProductList[
index] index]
.images[0] .images![0]
.src .src
.toString(), .toString(),
fit: BoxFit.cover, fit: BoxFit.cover,
@ -291,22 +291,45 @@ class _RecommendedProductsState extends State<RecommendedProducts> {
EdgeInsets.only(right: 10), EdgeInsets.only(right: 10),
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RatingBar.readOnly( child: RatingBar(
initialRating: model initialRating:model
.recommendedProductList[ .recommendedProductList[
index] index]
.approvedRatingSum .approvedRatingSum
.toDouble(), .toDouble(),
size: 13.0, direction: Axis.horizontal,
filledColor: allowHalfRating: true,
Colors.yellow[700], itemCount: 5,
emptyColor: Colors.grey[500], itemSize: 20,
isHalfAllowed: true, ignoreGestures: true,
halfFilledIcon: ratingWidget: RatingWidget(
Icons.star_half, full: Icon(Icons.star),
filledIcon: Icons.star, half: Icon(Icons.star_half),
emptyIcon: Icons.star, empty: Icon(Icons.star),
), ),
tapOnlyMode: true,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
},
)
// RatingBar.readOnly(
// initialRating: model
// .recommendedProductList[
// index]
// .approvedRatingSum
// .toDouble(),
// size: 13.0,
// filledColor:
// Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon:
// Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
), ),
), ),
Texts( Texts(

@ -3,24 +3,24 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class ReviewsInfo extends StatelessWidget { class ReviewsInfo extends StatelessWidget {
final PharmacyProduct product; final PharmacyProduct? product;
final ProductDetailViewModel previousModel; final ProductDetailViewModel? previousModel;
const ReviewsInfo({Key key, this.product, this.previousModel}) const ReviewsInfo({Key? key, this.product, this.previousModel})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return previousModel.productDetailService.length != 0 && return previousModel?.productDetailService.length != 0 &&
previousModel.productDetailService[0].reviews.length != 0 previousModel?.productDetailService[0].reviews!.length != 0
? ListView.builder( ? ListView.builder(
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount: previousModel.productDetailService[0].reviews.length, itemCount: previousModel?.productDetailService[0].reviews!.length,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
@ -35,10 +35,10 @@ class ReviewsInfo extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
child: Text(previousModel.productDetailService[0].reviews[index].customer.firstName != null child: Text(previousModel!.productDetailService[0].reviews![index].customer!.firstName != null
&& previousModel.productDetailService[0].reviews[index].customer.firstName != null && previousModel!.productDetailService[0].reviews![index].customer!.firstName != null
? previousModel.productDetailService[0].reviews[index].customer.firstName.toString() + " " ? previousModel!.productDetailService[0].reviews![index].customer!.firstName.toString() + " "
+ previousModel.productDetailService[0].reviews[index].customer.lastName.toString() + previousModel!.productDetailService[0].reviews![index].customer!.lastName.toString()
:"", :"",
// previousModel.productDetailService[0] // previousModel.productDetailService[0]
// .reviews[index].customerId // .reviews[index].customerId
@ -55,46 +55,70 @@ class ReviewsInfo extends StatelessWidget {
child: projectViewModel.isArabic? child: projectViewModel.isArabic?
Align( Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RatingBar.readOnly( child:
initialRating: previousModel
.productDetailService[0].reviews[index].rating // RatingBar.readOnly(
.toDouble(), // initialRating: previousModel
size: 15.0, // .productDetailService[0].reviews[index].rating
filledColor: Colors.yellow[700], // .toDouble(),
emptyColor: Colors.grey[500], // size: 15.0,
isHalfAllowed: true, // filledColor: Colors.yellow[700],
halfFilledIcon: Icons.star_half, // emptyColor: Colors.grey[500],
filledIcon: Icons.star, // isHalfAllowed: true,
emptyIcon: Icons.star, // halfFilledIcon: Icons.star_half,
), // filledIcon: Icons.star,
): Align( // emptyIcon: Icons.star,
alignment: Alignment.topRight, // ),
child: RatingBar.readOnly( RatingBar(
initialRating: previousModel initialRating: previousModel!
.productDetailService[0].reviews[index].rating .productDetailService[0]!.reviews![index]!.rating!.toDouble(),
.toDouble(), direction: Axis.horizontal,
size: 15.0, allowHalfRating: true,
filledColor: Colors.yellow[700], itemCount: 5,
emptyColor: Colors.grey[500], itemSize: 20,
isHalfAllowed: true, ignoreGestures: true,
halfFilledIcon: Icons.star_half, ratingWidget: RatingWidget(
filledIcon: Icons.star, full: Icon(Icons.star),
emptyIcon: Icons.star, half: Icon(Icons.star_half),
), empty: Icon(Icons.star),
), ),
tapOnlyMode: true,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
},
)
): RatingBar(
initialRating: previousModel!
.productDetailService[0]!.reviews![index]!.rating!.toDouble(),
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 20,
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);
},
))])
,
), ),
],
),
),
SizedBox(
height: 10,
),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Text( child: Text(
previousModel previousModel!
.productDetailService[0].reviews[index].replyText, .productDetailService[0].reviews![index].replyText,
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
), ),
@ -103,9 +127,8 @@ class ReviewsInfo extends StatelessWidget {
height: 50, height: 50,
), ),
Divider(height: 1, color: Colors.grey), Divider(height: 1, color: Colors.grey),
],
), ]));
);
}, },
) )
: Container( : Container(

@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
class CustomDivider extends StatelessWidget { class CustomDivider extends StatelessWidget {
const CustomDivider({ const CustomDivider({
Key key, Key? key,
this.color, this.color,
}) : super(key: key); }) : super(key: key);
final Color color; final Color? color;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -3,13 +3,13 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class IconWithBg extends StatelessWidget { class IconWithBg extends StatelessWidget {
final IconData icon; final IconData? icon;
final Color color; final Color? color;
final Function onPress; final VoidCallback? onPress;
final bool hasPadding; final bool hasPadding;
IconWithBg( IconWithBg(
{Key key, this.icon, this.color, this.onPress, this.hasPadding = false}) {Key? key, this.icon, this.color, this.onPress, this.hasPadding = false})
: super(key: key); : super(key: key);
@override @override
@ -35,7 +35,7 @@ class IconWithBg extends StatelessWidget {
), ),
color: color, color: color,
onPressed: () async { onPressed: () async {
onPress(); onPress!();
}, },
), ),
), ),

@ -16,18 +16,18 @@ import '../../../../../locator.dart';
import '../../../compare-list.dart'; import '../../../compare-list.dart';
import 'icon_with_bg.dart'; import 'icon_with_bg.dart';
class ProductAppBar extends StatelessWidget with PreferredSizeWidget { class ProductAppBar extends StatelessWidget implements PreferredSizeWidget {
final PharmacyProduct product; final PharmacyProduct? product;
final ProductDetailViewModel model; final ProductDetailViewModel? model;
final Function addToWishlistFunction; final VoidCallback? addToWishlistFunction;
final Function deleteFromWishlistFunction; final VoidCallback? deleteFromWishlistFunction;
final int quantity; final int? quantity;
final bool isInWishList; final bool? isInWishList;
final Function addToCartFunction; final Function? addToCartFunction;
ProductAppBar( ProductAppBar(
{Key key, {Key? key,
this.product, this.product,
this.model, this.model,
this.addToWishlistFunction, this.addToWishlistFunction,
@ -81,7 +81,7 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
locator<NavigationService>() locator<NavigationService>()
.navigatorKey .navigatorKey
.currentContext, .currentContext!,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
LandingPagePharmacy(currentTab: 3)), LandingPagePharmacy(currentTab: 3)),
@ -151,19 +151,19 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
return Container( return Container(
child: new Wrap( child: new Wrap(
children: <Widget>[ children: <Widget>[
if (product.stockAvailability != 'Out of stock' && product.isRx != true) if (product!.stockAvailability! != 'Out of stock' && product!.isRx! != true)
new ListTile( new ListTile(
leading: Icon(Icons.shopping_cart), leading: Icon(Icons.shopping_cart),
title: Text( title: Text(
TranslationBase.of(context).addToCart, TranslationBase.of(context).addToCart,
), ),
onTap: () async { onTap: () async {
if (quantity > 0) { if (quantity! > 0) {
{ {
await addToCartFunction( addToCartFunction!(
quantity: quantity, quantity: quantity!,
itemID: itemID, itemID: itemID!,
model: model); model: model!);
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
@ -176,19 +176,19 @@ class ProductAppBar extends StatelessWidget with PreferredSizeWidget {
}), }),
ListTile( ListTile(
leading: Icon( leading: Icon(
!isInWishList ? Icons.favorite_border : Icons.favorite, !isInWishList! ? Icons.favorite_border : Icons.favorite,
color: !isInWishList ? Colors.white : Colors.red[800], color: !isInWishList! ? Colors.white : Colors.red[800],
), ),
title: Text( title: Text(
isInWishList isInWishList!
? TranslationBase.of(context).removeFromWishlist ? TranslationBase.of(context).removeFromWishlist
: TranslationBase.of(context).addToWishlist, : TranslationBase.of(context).addToWishlist,
), ),
onTap: () async { onTap: () async {
if (isInWishList) if (isInWishList!)
await deleteFromWishlistFunction(); deleteFromWishlistFunction!();
else else
await addToWishlistFunction(); addToWishlistFunction!();
Navigator.of(context).pop(); Navigator.of(context).pop();
}), }),
ListTile( ListTile(

@ -12,17 +12,17 @@ var product;
var customerId; var customerId;
class RecommendedProductPage extends StatefulWidget { class RecommendedProductPage extends StatefulWidget {
String productId ; String? productId ;
RecommendedProductPage({this.productId}); RecommendedProductPage({this.productId});
@override @override
_RecommendedProductPageState createState() => _RecommendedProductPageState(productId: productId); _RecommendedProductPageState createState() => _RecommendedProductPageState(productId: productId!);
} }
class _RecommendedProductPageState extends State<RecommendedProductPage> class _RecommendedProductPageState extends State<RecommendedProductPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
List<RecommendedProductModel> recommendedProductList = []; List<RecommendedProductModel> recommendedProductList = [];
String productId; late String? productId;
_RecommendedProductPageState({this.productId}); _RecommendedProductPageState({this.productId});
String id = ""; String id = "";
bool styleOne = true; bool styleOne = true;

@ -26,8 +26,8 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return BaseView<BrandsViewModel>( return BaseView<BrandsViewModel>(
onModelReady: (model) => model.searchProducts(), onModelReady: (model) => model!.searchProducts(productName: ''),
builder: (BuildContext context, model, Widget child) => builder: (BuildContext context, model, Widget? child) =>
PharmacyAppScaffold( PharmacyAppScaffold(
appBarTitle: TranslationBase.of(context).search, appBarTitle: TranslationBase.of(context).search,
isBottomBar: false, isBottomBar: false,
@ -117,9 +117,9 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
child: Text( projectProvider.isArabic child: Text( projectProvider.isArabic!
? model.searchList[index].namen ? model.searchList[index].namen!
:model.searchList[index].name, :model.searchList[index].name!,
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
), ),
@ -142,7 +142,7 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
searchMedicine(model, BuildContext context) { searchMedicine(model, BuildContext context) {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
if (_formKey.currentState.validate()) if (_formKey.currentState!.validate())
model.searchProducts(productName: textController.text); model.searchProducts(productName: textController.text);
} }
} }

@ -10,10 +10,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ProductOrderItem extends StatefulWidget { class ProductOrderItem extends StatefulWidget {
final ShoppingCart item; final ShoppingCart? item;
final VoidCallback changeCartItems; final VoidCallback? changeCartItems;
final VoidCallback deleteCartItems; final VoidCallback? deleteCartItems;
final OrderPreviewViewModel model; final OrderPreviewViewModel? model;
ProductOrderItem( ProductOrderItem(
{this.item, this.changeCartItems, this.deleteCartItems, this.model}); {this.item, this.changeCartItems, this.deleteCartItems, this.model});
@ -33,16 +33,16 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_quantityController.text = "${widget.item.quantity}"; _quantityController.text = "${widget.item!.quantity!}";
_totalPrice = _totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; "${(widget.item!.product!.price! * widget.item!.quantity!).toStringAsFixed(2)}";
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return Column( return Column(
children: [ children: [
ListTile( ListTile(
leading: InkWell( leading: InkWell(
onTap: () => {widget.deleteCartItems()}, onTap: () => {widget.deleteCartItems!()},
child: Icon( child: Icon(
FontAwesomeIcons.trashAlt, FontAwesomeIcons.trashAlt,
size: 15, size: 15,
@ -55,10 +55,10 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
(widget.item.product.images != null && (widget.item!.product!.images! != null &&
widget.item.product.images.length > 0) widget.item!.product!.images!.length > 0)
? Image.network( ? Image.network(
widget.item.product.images[0].src, widget!.item!.product!.images![0]!.src!,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
) )
@ -79,8 +79,8 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
Container( Container(
child: Texts( child: Texts(
projectProvider.isArabic projectProvider.isArabic
? widget.item.product.namen ? widget.item!.product!.namen!
: "${widget.item.product.name}", : "${widget.item!.product!.name!}",
regular: true, regular: true,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
fontSize: 12, fontSize: 12,
@ -90,7 +90,7 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
), ),
Container( Container(
child: Texts( child: Texts(
"${(widget.item.product.price).toStringAsFixed(2)} ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}", "${(widget.item!.product!.price!).toStringAsFixed(2)} ${projectProvider.isArabic ? widget.item!.currencyn! : widget.item!.currency}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -135,13 +135,13 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
setState(() { setState(() {
var value = int.tryParse(text); var value = int.tryParse(text);
if (value == null) { if (value == null) {
widget.item.quantity = 0; widget!.item!.quantity = 0;
} else { } else {
widget.item.quantity = widget.item!.quantity =
int.parse(text); int.parse(text);
} }
_totalPrice = _totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; "${(widget.item!.product!.price! * widget.item!.quantity!).toStringAsFixed(2)}";
}); });
}, },
)), )),
@ -176,16 +176,16 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
fontSize: 12, fontSize: 12,
), ),
Texts( Texts(
"$_totalPrice ${projectProvider.isArabic ? widget.item.currencyn : widget.item.currency}", "$_totalPrice ${projectProvider.isArabic ? widget.item!.currencyn! : widget.item!.currency!}",
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
widget.item.product.stockQuantity == 0 widget.item!.product!.stockQuantity == 0
? Texts( ? Texts(
projectProvider.isArabic projectProvider.isArabic
? widget.item.product ? widget.item!.product!
.stockAvailabilityn .stockAvailabilityn!
: widget.item.product : widget.item!.product!
.stockAvailability, .stockAvailability,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 13, fontSize: 13,
@ -224,13 +224,13 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
switch (operation) { switch (operation) {
case Operation.inc: case Operation.inc:
{ {
newValue = widget.item.quantity + 1; newValue = widget.item!.quantity! + 1;
} }
break; break;
case Operation.dec: case Operation.dec:
{ {
newValue = widget.item.quantity - 1; newValue = widget.item!.quantity! - 1;
} }
break; break;
default: default:
@ -240,19 +240,19 @@ class _ProductOrderItemState extends State<ProductOrderItem> {
break; break;
} }
if (newValue > 0) { if (newValue > 0) {
widget.item.quantity = newValue; widget.item!.quantity = newValue;
await widget.changeCartItems(); widget!.changeCartItems!();
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model!.state == ViewState.ErrorLocal) {
if (operation == Operation.dec) { if (operation == Operation.dec) {
newValue = widget.item.quantity + 1; newValue = widget.item!.quantity! + 1;
} else { } else {
newValue = widget.item.quantity - 1; newValue = widget.item!.quantity! - 1;
} }
widget.item.quantity = newValue; widget.item!.quantity = newValue;
} }
_quantityController.text = "${widget.item.quantity}"; _quantityController.text = "${widget.item!.quantity!}";
_totalPrice = _totalPrice =
"${(widget.item.product.price * widget.item.quantity).toStringAsFixed(2)}"; "${(widget.item!.product!.price! * widget.item!.quantity!).toStringAsFixed(2)}";
} }
}); });
} }

@ -22,9 +22,9 @@ class ProductOrderPreviewItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
(item.product.images != null && item.product.images.length > 0) (item.product!.images != null && item.product!.images!.length > 0)
? Image.network( ? Image.network(
item.product.images[0].src, item.product!.images![0].src!,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
) )
@ -44,8 +44,8 @@ class ProductOrderPreviewItem extends StatelessWidget {
Container( Container(
child: Texts( child: Texts(
projectProvider.isArabic projectProvider.isArabic
? item.product.namen ? item.product!.namen
: item.product.name, : item.product!.name,
regular: true, regular: true,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
fontSize: 12, fontSize: 12,
@ -55,7 +55,7 @@ class ProductOrderPreviewItem extends StatelessWidget {
), ),
Container( Container(
child: Texts( child: Texts(
"${(item.product.price).toStringAsFixed(2)} ${projectProvider.isArabic ? item.currencyn : item.currency}", "${(item.product!.price)!.toStringAsFixed(2)} ${projectProvider.isArabic ? item.currencyn : item.currency}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -83,7 +83,7 @@ class ProductOrderPreviewItem extends StatelessWidget {
child: Container( child: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Texts( child: Texts(
"${(item.product.price * item.quantity).toStringAsFixed(2)} ${projectProvider.isArabic ? item.currencyn : item.currency}", "${(item.product!.price! * item.quantity!).toStringAsFixed(2)} ${projectProvider.isArabic ? item.currencyn : item.currency}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),

@ -12,9 +12,9 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'dart:math' as math; import 'dart:math' as math;
@ -160,11 +160,11 @@ class ProductTileItem extends StatelessWidget {
), ),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: (item.images != null && item.images.length > 0) child: (item.images != null && item.images!.length > 0)
? Padding( ? Padding(
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
child: Image.network( child: Image.network(
item.images[0].src, item.images![0].src!,
fit: BoxFit.cover, fit: BoxFit.cover,
height: itemHeight / 2, height: itemHeight / 2,
), ),
@ -274,15 +274,36 @@ class ProductTileItem extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
// Expanded( // Expanded(
RatingBar.readOnly( // RatingBar.readOnly(
initialRating: item.approvedRatingSum.toDouble(), // initialRating: item.approvedRatingSum.toDouble(),
size: 13.0, // size: 13.0,
filledColor: Color(0XFFD02127), // filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), // emptyColor: Color(0XFFD02127),
isHalfAllowed: true, // isHalfAllowed: true,
halfFilledIcon: Icons.star_half, // halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, // filledIcon: Icons.star,
emptyIcon: Icons.star_border, // emptyIcon: Icons.star_border,
// ),
//
//
RatingBar(
initialRating: item.approvedRatingSum!.toDouble(),
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 20,
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);
},
), ),
Texts( Texts(
"(${item.approvedTotalReviews})", "(${item.approvedTotalReviews})",

@ -45,7 +45,7 @@ class BestSellerWidget extends StatelessWidget {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500], Colors.grey[500]!,
), ),
), ),
), ),

@ -35,7 +35,7 @@ class GridViewCard extends StatelessWidget {
text, text,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: SizeConfig.textMultiplier * 1.3, fontSize: SizeConfig.textMultiplier! * 1.3,
), ),
], ],
), ),

@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MostViewedWidget extends StatelessWidget { class MostViewedWidget extends StatelessWidget {
const MostViewedWidget({Key key}) : super(key: key); const MostViewedWidget({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -47,7 +47,7 @@ class MostViewedWidget extends StatelessWidget {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500], Colors.grey[500]!,
), ),
), ),
), ),

@ -11,8 +11,9 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class PrescriptionsWidget extends StatelessWidget { class PrescriptionsWidget extends StatelessWidget {
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@ -81,7 +82,7 @@ class PrescriptionsWidget extends StatelessWidget {
radius: 30, radius: 30,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
child: Image.network( child: Image.network(
model.prescriptionsList[index].doctorImageURL, model.prescriptionsList[index].doctorImageURL!,
width: 50, width: 50,
height: 50, height: 50,
), ),
@ -160,7 +161,27 @@ class PrescriptionsWidget extends StatelessWidget {
Row(children: <Widget>[ Row(children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.only(left: 5),
child: RatingBar.readOnly( child:
RatingBar(
initialRating: model.prescriptionsList[index].actualDoctorRate!.toDouble(),
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemSize: 20,
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);
},
)
/* RatingBar.readOnly(
initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(), initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(),
size: 15.0, size: 15.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
@ -169,7 +190,7 @@ class PrescriptionsWidget extends StatelessWidget {
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),*/
), ),
SizedBox( SizedBox(
width: 130.0, width: 130.0,

@ -49,7 +49,7 @@ class RecentlyViewedWidget extends StatelessWidget {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500], Colors.grey[500]!,
), ),
), ),
), ),

@ -40,7 +40,7 @@ class ShopByBrandWidget extends StatelessWidget {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey[500], Colors.grey[500]!,
), ),
), ),
), ),

@ -69,13 +69,13 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.memberName, widget.model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.memberName,
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
"${widget.model.lacumInformation.yahalaAccountNo}", "${widget.model.lacumInformation!.yahalaAccountNo}",
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.black, color: Colors.black,
@ -83,23 +83,23 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
], ],
), ),
BorderedButton( BorderedButton(
widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus == "Active" widget.model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.accountStatus == "Active"
? TranslationBase.of(context).active ? TranslationBase.of(context).active
: TranslationBase.of(context).inactive, : TranslationBase.of(context).inactive,
textColor: widget.model.lacumInformation textColor: widget.model.lacumInformation!
.accountStatus == .accountStatus ==
1 1
? Colors.green ? Colors.green
: Colors.red, : Colors.red,
hasBorder: true, hasBorder: true,
borderColor: widget.model.lacumInformation borderColor: widget.model.lacumInformation!
.accountStatus == .accountStatus ==
1 1
? Colors.green ? Colors.green
: Colors.red, : Colors.red,
radius: 16, radius: 16,
rPadding: 16, rPadding: 16,
icon: widget.model.lacumInformation icon: widget.model.lacumInformation!
.accountStatus == .accountStatus ==
1 1
? Icon( ? Icon(
@ -132,7 +132,7 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
widget.model.lacumInformation widget.model.lacumInformation!
.identificationNo, .identificationNo,
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -175,7 +175,7 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber, widget.model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.mobileNumber,
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.black, color: Colors.black,
@ -192,7 +192,7 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
widget.model.lacumInformation.prefLang == widget.model.lacumInformation!.prefLang ==
"2" "2"
? TranslationBase.of(context).lanEnglish ? TranslationBase.of(context).lanEnglish
: TranslationBase.of(context).lanArabic, : TranslationBase.of(context).lanArabic,

@ -69,13 +69,13 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.memberName, widget.model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.memberName,
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
"${widget.model.lacumInformation.yahalaAccountNo}", "${widget.model.lacumInformation!.yahalaAccountNo}",
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.black, color: Colors.black,
@ -83,23 +83,23 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
], ],
), ),
BorderedButton( BorderedButton(
widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus == "Active" widget.model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.accountStatus == "Active"
? TranslationBase.of(context).active ? TranslationBase.of(context).active
: TranslationBase.of(context).inactive, : TranslationBase.of(context).inactive,
textColor: widget.model.lacumInformation textColor: widget.model.lacumInformation!
.accountStatus == .accountStatus! ==
1 1
? Colors.green ? Colors.green
: Colors.red, : Colors.red,
hasBorder: true, hasBorder: true,
borderColor: widget.model.lacumInformation borderColor: widget.model.lacumInformation!
.accountStatus == .accountStatus ==
1 1
? Colors.green ? Colors.green
: Colors.red, : Colors.red,
radius: 16, radius: 16,
rPadding: 16, rPadding: 16,
icon: widget.model.lacumInformation icon: widget.model.lacumInformation!
.accountStatus == .accountStatus ==
1 1
? Icon( ? Icon(
@ -132,7 +132,7 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
widget.model.lacumInformation widget.model.lacumInformation!
.identificationNo, .identificationNo,
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
@ -175,7 +175,7 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
widget.model.lacumGroupInformation.lakumInquiryInformationObjVersion.mobileNumber, widget.model.lacumGroupInformation!.lakumInquiryInformationObjVersion!.mobileNumber,
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.black, color: Colors.black,
@ -192,7 +192,7 @@ class _LakumBannerWidgetState extends State<LakumBannerWidget> {
color: Colors.black, color: Colors.black,
), ),
Texts( Texts(
widget.model.lacumInformation.prefLang == widget.model.lacumInformation!.prefLang ==
"1" "1"
? TranslationBase.of(context).lanEnglish ? TranslationBase.of(context).lanEnglish
: TranslationBase.of(context).lanArabic, : TranslationBase.of(context).lanArabic,

@ -7,9 +7,9 @@ class LakumPointTableRowWidget extends StatefulWidget {
final String rowTitle; final String rowTitle;
final num points; final num points;
final num riyal; final num riyal;
final Function onTap; final VoidCallback onTap;
final int rowIndex; final int rowIndex;
final Widget collapsed; final Widget? collapsed;
final bool expandFlag; final bool expandFlag;
LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points, LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points,

@ -7,9 +7,9 @@ class LakumPointTableRowWidget extends StatefulWidget {
final String rowTitle; final String rowTitle;
final double points; final double points;
final double riyal; final double riyal;
final Function onTap; final VoidCallback? onTap;
final int rowIndex; final int rowIndex;
final Widget collapsed; final Widget? collapsed;
final bool expandFlag; final bool expandFlag;
LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points, LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points,
@ -25,7 +25,7 @@ class _LakumPointTableRowWidgetState extends State<LakumPointTableRowWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: widget.onTap, onTap: widget.onTap!,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Column( Column(

@ -42,12 +42,12 @@ class ManufacturerItem extends StatelessWidget {
? Container( ? Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
child: AppText(item.name, fontWeight: FontWeight.w500,fontSize: 14,), child: AppText(item.name!, fontWeight: FontWeight.w500,fontSize: 14,),
) )
: Padding( : Padding(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
child: Image.network( child: Image.network(
item.image.src, item.image!.src!,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
class WishlistPage extends StatelessWidget { class WishlistPage extends StatelessWidget {
const WishlistPage({Key key}) : super(key: key); const WishlistPage({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -16,10 +16,10 @@ dynamic languageID;
class OrderPage extends StatefulWidget { class OrderPage extends StatefulWidget {
// orderList({this.customerId, this.pageId}); // orderList({this.customerId, this.pageId});
String customerID; String? customerID;
String customerGUID; String? customerGUID;
OrderPage({@required this.customerID, this.customerGUID}); OrderPage({required this.customerID, this.customerGUID});
@override @override
_OrderPageState createState() => _OrderPageState(); _OrderPageState createState() => _OrderPageState();
@ -38,7 +38,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
List<Orders> cancelledOrderList = []; List<Orders> cancelledOrderList = [];
List<Orders> pendingOrderList = []; List<Orders> pendingOrderList = [];
TabController _tabController; TabController? _tabController;
// AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
getLanguageID() async { getLanguageID() async {
@ -399,7 +399,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
processingOrderList.add(model.orders[i]); processingOrderList.add(model.orders[i]);
} }
} }
_tabController.index = 1; _tabController!.index = 1;
return Container( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: processingOrderList.length != 0 child: processingOrderList.length != 0
@ -531,7 +531,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
left: 13.0, right: 13.0), left: 13.0, right: 13.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.grey[500], color: Colors.grey[500]!,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 5.0, width: 5.0,
), ),
@ -862,7 +862,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
pendingOrderList.add(model.orders[i]); pendingOrderList.add(model.orders[i]);
} }
} }
_tabController.animateTo(2); _tabController!.animateTo(2);
return Container( return Container(
child: pendingOrderList.length != 0 child: pendingOrderList.length != 0
? SingleChildScrollView( ? SingleChildScrollView(
@ -995,7 +995,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
left: 13.0, right: 13.0), left: 13.0, right: 13.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.orange[300], color: Colors.orange[300]!,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 5.0, width: 5.0,
), ),
@ -1271,7 +1271,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
left: 10.0, right: 10.0), left: 10.0, right: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.red[900], color: Colors.red[900]!,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 5.0, width: 5.0,
), ),
@ -1415,5 +1415,5 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
class Test<T extends String> { class Test<T extends String> {
static const values = {"1": 1, "2": 2, "3": 3}; static const values = {"1": 1, "2": 2, "3": 3};
int operator [](String key) => values[key]; int operator [](String key) => values[key]!;
} }

@ -24,7 +24,7 @@ dynamic languageID;
class OrderDetailsPage extends StatefulWidget { class OrderDetailsPage extends StatefulWidget {
Orders orderModel; Orders orderModel;
OrderDetailsPage({@required this.orderModel}); OrderDetailsPage({required this.orderModel});
// Orders orderModel; // Orders orderModel;
// OrderModel orderModelDetails; // OrderModel orderModelDetails;
@ -40,7 +40,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
// AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
String customerId; late String customerId;
List<OrderDetailModel> ordersList = []; List<OrderDetailModel> ordersList = [];
List<OrderDetailModel> cancelledOrderList = []; List<OrderDetailModel> cancelledOrderList = [];
@ -52,9 +52,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
var isActiveDelivery = false; var isActiveDelivery = false;
var dataIsCancel; var dataIsCancel;
var dataIsRefund; var dataIsRefund;
BuildContext context; late BuildContext context;
MyInAppBrowser browser; MyInAppBrowser? browser;
@override @override
void initState() { void initState() {
@ -63,7 +63,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
// print(widget.orderModel.orderItems.length); // print(widget.orderModel.orderItems.length);
getCancelOrder(widget.orderModel.id); getCancelOrder(widget.orderModel.id);
print("ID is" + widget.orderModel.id); print("ID is" + widget.orderModel.id!);
// cancelOrderDetail(order) // cancelOrderDetail(order)
} }
@ -76,7 +76,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
onModelReady: (model) { onModelReady: (model) {
model.getOrderDetails(widget.orderModel.id, widget.orderModel.orderGuid).then((value) { model.getOrderDetails(widget.orderModel.id, widget.orderModel.orderGuid).then((value) {
setState(() { setState(() {
isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID.isNotEmpty)); isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID!.isNotEmpty));
}); });
}); });
}, },
@ -121,7 +121,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
padding: EdgeInsets.only(left: 11.0, right: 11.0), padding: EdgeInsets.only(left: 11.0, right: 11.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: getStatusBackgroundColor(), color: getStatusBackgroundColor()!,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 5.0, width: 5.0,
), ),
@ -164,7 +164,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
margin: EdgeInsets.only(left: 10.0, top: 13.0), margin: EdgeInsets.only(left: 10.0, top: 13.0),
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Text( Text(
"${model.orderListModel[0].shippingAddress.firstName} ${model.orderListModel[0].shippingAddress.lastName}", "${model.orderListModel[0].shippingAddress!.firstName} ${model.orderListModel[0].shippingAddress!.lastName}",
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -176,7 +176,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Text( Text(
model.orderListModel[0].shippingAddress.address1.toString(), model.orderListModel[0].shippingAddress!.address1.toString(),
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -189,11 +189,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Text( Text(
model.orderListModel[0].shippingAddress.address2.toString() + model.orderListModel[0].shippingAddress!.address2.toString() +
' ' + ' ' +
model.orderListModel[0].shippingAddress.country.toString() + model.orderListModel[0].shippingAddress!.country.toString() +
' ' + ' ' +
model.orderListModel[0].shippingAddress.zipPostalCode.toString(), model.orderListModel[0].shippingAddress!.zipPostalCode.toString(),
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -215,7 +215,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container( Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text( child: Text(
model.orderListModel[0].shippingAddress.phoneNumber.toString(), model.orderListModel[0].shippingAddress!.phoneNumber.toString(),
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
), ),
@ -339,24 +339,24 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount: model.orderListModel[0].orderItems.length, itemCount: model.orderListModel[0].orderItems!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
child: productTile( child: productTile(
productName: projectViewModel.isArabic ? productName: projectViewModel.isArabic ?
model.orderListModel[0].orderItems[index].product.namen.toString() model.orderListModel[0].orderItems![index].product!.namen.toString()
:model.orderListModel[0].orderItems[index].product.name.toString(), :model.orderListModel[0].orderItems![index].product!.name.toString(),
productPrice: model.orderListModel[0].orderItems[index].product.price.toString(), productPrice: model.orderListModel[0].orderItems![index!].product!.price!.toString(),
productRate: model.orderListModel[0].orderItems[index].product.approvedRatingSum.toDouble(), productRate: model.orderListModel[0].orderItems![index].product!.approvedRatingSum!.toDouble(),
productReviews: model.orderListModel[0].orderItems[index].product.approvedTotalReviews, productReviews: model.orderListModel[0].orderItems![index].product!.approvedTotalReviews,
totalPrice: "${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}", totalPrice: "${(model.orderListModel[0].orderItems![index].product!.price! * model.orderListModel![0].orderItems![index].quantity!).toStringAsFixed(2)}",
qyt: model.orderListModel[0].orderItems[index].quantity.toString(), qyt: model.orderListModel[0].orderItems![index].quantity.toString(),
isOrderDetails: true, isOrderDetails: true,
imgs: model.orderListModel[0].orderItems[index].product.images != null && model.orderListModel[0].orderItems[index].product.images.length != 0 imgs: model.orderListModel[0].orderItems![index].product!.images != null && model.orderListModel[0].orderItems![index].product!.images!.length != 0
? model.orderListModel[0].orderItems[index].product.images[0].src.toString() ? model.orderListModel[0].orderItems![index].product!.images![0].src.toString()
: null, : null,
status: model.orderListModel[0].orderStatusId, status: model.orderListModel[0].orderStatusId,
product: model.orderListModel[0].orderItems[index].product, product: model.orderListModel[0].orderItems![index].product,
), ),
); );
}), }),
@ -533,7 +533,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
model.orderListModel[0].orderStatusId == 10 model.orderListModel[0].orderStatusId == 10
? InkWell( ? InkWell(
onTap: () { onTap: () {
openPayment(model.orderListModel[0], model.user); openPayment(model.orderListModel[0], model.user!);
}, },
child: Container( child: Container(
padding: EdgeInsets.only(left: 10.0, right: 10.0), padding: EdgeInsets.only(left: 10.0, right: 10.0),
@ -604,30 +604,30 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
); );
} }
Color getStatusBackgroundColor() { Color? getStatusBackgroundColor() {
print(widget.orderModel.orderStatusId); print(widget.orderModel.orderStatusId);
// if(orderStatus == 'delivered') // if(orderStatus == 'delivered')
if (widget.orderModel.orderStatusId == 30 || widget.orderModel.orderStatusId == 997 || widget.orderModel.orderStatusId == 994) if (widget.orderModel.orderStatusId == 30 || widget.orderModel.orderStatusId == 997 || widget.orderModel.orderStatusId == 994)
return Color(0xFF4CAF50); return Color(0xFF4CAF50);
else if (widget.orderModel.orderStatusId == 20 || widget.orderModel.orderStatusId == 995 || widget.orderModel.orderStatusId == 998 || widget.orderModel.orderStatusId == 999) else if (widget.orderModel.orderStatusId == 20 || widget.orderModel.orderStatusId == 995 || widget.orderModel.orderStatusId == 998 || widget.orderModel.orderStatusId == 999)
return Colors.grey[500]; return Colors.grey[500]!;
else if (widget.orderModel.orderStatusId == 10) else if (widget.orderModel.orderStatusId == 10)
return Colors.orange[300]; return Colors.orange[300]!;
else if (widget.orderModel.orderStatusId == 40 || widget.orderModel.orderStatusId == 996 || widget.orderModel.orderStatusId == 200) return Colors.red[900]; else if (widget.orderModel.orderStatusId == 40 || widget.orderModel.orderStatusId == 996 || widget.orderModel.orderStatusId == 200) return Colors.red[900]!;
} }
getCancelOrder(dataIsCancel) { getCancelOrder(dataIsCancel) {
if (widget.orderModel.canCancel && widget.orderModel.canRefund) { if (widget.orderModel.canCancel! && widget.orderModel.canRefund!) {
setState(() { setState(() {
isCancel = true; isCancel = true;
isRefund = false; isRefund = false;
}); });
} else if (widget.orderModel.canCancel) { } else if (widget.orderModel.canCancel!) {
setState(() { setState(() {
isCancel = true; isCancel = true;
isRefund = false; isRefund = false;
}); });
} else if (widget.orderModel.canRefund) { } else if (widget.orderModel.canRefund!) {
setState(() { setState(() {
isCancel = false; isCancel = false;
isRefund = true; isRefund = true;
@ -659,7 +659,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
getCanceledOrder(order) { getCanceledOrder(order) {
Navigator.pop(context); Navigator.pop(context);
if (widget.orderModel.canCancel && widget.orderModel.canRefund == false) { if (widget.orderModel.canCancel! && widget.orderModel.canRefund == false) {
// getCanceledOrder(order); // getCanceledOrder(order);
// AppToast.showSuccessToast(message: "Request Sent Successfully"); // AppToast.showSuccessToast(message: "Request Sent Successfully");
// Navigator.push(context, // Navigator.push(context,
@ -674,8 +674,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
) { ) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart);
browser.openPharmacyPaymentBrowser(order, order.orderTotal, 'ePharmacy Order', order.id, order.billingAddress.email, order.customValuesXml, browser?.openPharmacyPaymentBrowser(order, order.orderTotal, 'ePharmacy Order', order.id!, order.billingAddress!.email!, order.customValuesXml!,
"${authenticatedUser.firstName} ${authenticatedUser.middleName} ${authenticatedUser.lastName}", authenticatedUser.patientID, authenticatedUser, browser); "${authenticatedUser.firstName} ${authenticatedUser.middleName} ${authenticatedUser.lastName}", authenticatedUser.patientID, authenticatedUser, browser!);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -684,7 +684,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser.isOpened()) browser.close(); if (browser!.isOpened()) browser!.close();
MyInAppBrowser.isPaymentDone = true; MyInAppBrowser.isPaymentDone = true;
return; return;
} }
@ -692,7 +692,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser.isOpened()) browser.close(); if (browser!.isOpened()) browser!.close();
MyInAppBrowser.isPaymentDone = false; MyInAppBrowser.isPaymentDone = false;
return; return;
} }

@ -7,8 +7,8 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/image.dart' as flutterImage; import 'package:flutter/src/widgets/image.dart' as flutterImage;
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:rating_bar/rating_bar.dart';
class ProductReviewPage extends StatefulWidget { class ProductReviewPage extends StatefulWidget {
final PharmacyProduct product; final PharmacyProduct product;
@ -49,7 +49,7 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
children: [ children: [
widget.product.images != null widget.product.images != null
? flutterImage.Image.network( ? flutterImage.Image.network(
widget.product.images[0].src, widget.product.images![0]!.src!,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
) )
@ -99,16 +99,38 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
Container( Container(
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RatingBar.readOnly( child:
// RatingBar.readOnly(
// initialRating: ratingValue,
// size: 15.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
//
//
RatingBar(
initialRating: ratingValue, initialRating: ratingValue,
size: 15.0, direction: Axis.horizontal,
filledColor: Colors.yellow[700], allowHalfRating: true,
emptyColor: Colors.grey[500], itemCount: 5,
isHalfAllowed: true, itemSize: 20,
halfFilledIcon: Icons.star_half, ignoreGestures: true,
filledIcon: Icons.star, ratingWidget: RatingWidget(
emptyIcon: Icons.star, 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);
},
)
), ),
), ),
SizedBox( SizedBox(
@ -150,18 +172,38 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
// RatingBar(
// size: 40.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// onRatingChanged: (rating) {
// currentRating = rating;
// },
// ),
RatingBar( RatingBar(
size: 40.0, initialRating: ratingValue,
filledColor: Colors.yellow[700], direction: Axis.horizontal,
emptyColor: Colors.grey[500], allowHalfRating: true,
isHalfAllowed: true, itemCount: 5,
halfFilledIcon: Icons.star_half, itemSize: 20,
filledIcon: Icons.star, ignoreGestures: true,
emptyIcon: Icons.star, ratingWidget: RatingWidget(
onRatingChanged: (rating) { full: Icon(Icons.star),
currentRating = rating; half: Icon(Icons.star_half),
empty: Icon(Icons.star),
),
tapOnlyMode: true,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
onRatingUpdate: (rating) {
print(rating);
}, },
), )
], ],
), ),
), ),
@ -179,13 +221,13 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
borderSide: borderSide:
BorderSide(width: 1, color: Colors.grey[400]), BorderSide(width: 1, color: Colors.grey[400]!),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(5.0)), BorderRadius.all(Radius.circular(5.0)),
borderSide: borderSide:
BorderSide(color: Colors.grey[400], width: 1), BorderSide(color: Colors.grey[400]!, width: 1),
), ),
), ),
onChanged: (value) { onChanged: (value) {
@ -220,9 +262,9 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: _reviewController.value.text != null && color: _reviewController!.value.text! != null &&
_reviewController.value.text != "" _reviewController!.value.text! != ""
? Colors.yellow[700] ? Colors.yellow[700]!
: Color(0xFFf5d69c), : Color(0xFFf5d69c),
style: BorderStyle.solid, style: BorderStyle.solid,
width: 1.0), width: 1.0),

@ -28,14 +28,14 @@ class AddAddressPage extends StatefulWidget {
} }
class _AddAddressPageState extends State<AddAddressPage> { class _AddAddressPageState extends State<AddAddressPage> {
double _latitude; double? _latitude;
double _longitude; double? _longitude;
AppMap appMap; AppMap? appMap;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences? sharedPref = AppSharedPreferences();
LatLng currentPostion; LatLng? currentPostion;
Completer<GoogleMapController> mapController = Completer(); Completer<GoogleMapController> mapController = Completer();
Placemark selectedPlace; Placemark? selectedPlace;
LocationUtils locationUtils; LocationUtils? locationUtils;
static CameraPosition _kGooglePlex = CameraPosition( static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: LatLng(37.42796133580664, -122.085749655962),
@ -47,7 +47,7 @@ class _AddAddressPageState extends State<AddAddressPage> {
super.initState(); super.initState();
if (widget.editedAddress != null && widget.editedAddress.latLong != null && widget.editedAddress.latLong != "") { if (widget.editedAddress != null && widget.editedAddress.latLong != null && widget.editedAddress.latLong != "") {
List<String> latLng = widget.editedAddress.latLong.split(","); List<String> latLng = widget.editedAddress.latLong!.split(",");
_latitude = double.parse(latLng[0]); _latitude = double.parse(latLng[0]);
_longitude = double.parse(latLng[1]); _longitude = double.parse(latLng[1]);
} else { } else {
@ -56,19 +56,19 @@ class _AddAddressPageState extends State<AddAddressPage> {
// setState(() {}); // setState(() {});
appMap = AppMap( appMap = AppMap(
_kGooglePlex.toMap(), _kGooglePlex!.toMap() as Map<dynamic, dynamic>,
onCameraMove: (camera) { onCameraMove: () {
_updatePosition(camera); _updatePosition(_kGooglePlex);
}, },
onMapCreated: () { onMapCreated: () {
currentPostion = LatLng(_latitude, _longitude); currentPostion = LatLng(_latitude!, _longitude!);
// latitude = widget.latitude; // latitude = widget.latitude;
// longitude = widget.longitude; // longitude = widget.longitude;
setMap(); setMap();
setState(() {}); setState(() {});
}, },
onCameraIdle: () async { onCameraIdle: () async {
List<Placemark> placemarks = await placemarkFromCoordinates(_latitude, _longitude); List<Placemark> placemarks = await placemarkFromCoordinates(_latitude!, _longitude!);
selectedPlace = placemarks[0]; selectedPlace = placemarks[0];
print(selectedPlace); print(selectedPlace);
}, },
@ -78,10 +78,10 @@ class _AddAddressPageState extends State<AddAddressPage> {
setMap() { setMap() {
setState(() { setState(() {
_kGooglePlex = CameraPosition( _kGooglePlex = CameraPosition(
target: currentPostion, target: currentPostion!,
zoom: 14.4746, zoom: 14.4746,
); );
appMap.moveTo(cameraPostion: _kGooglePlex); appMap!.moveTo(cameraPostion: _kGooglePlex);
}); });
} }
@ -92,16 +92,16 @@ class _AddAddressPageState extends State<AddAddressPage> {
} }
_getCurrentLocation() async { _getCurrentLocation() async {
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { if (await this.sharedPref!.getDouble(USER_LAT) != null && await this.sharedPref!.getDouble(USER_LONG) != null) {
var lat = await this.sharedPref.getDouble(USER_LAT); var lat = await this.sharedPref!.getDouble(USER_LAT);
var long = await this.sharedPref.getDouble(USER_LONG); var long = await this.sharedPref!.getDouble(USER_LONG);
_latitude = lat; _latitude = lat;
_longitude = long; _longitude = long;
currentPostion = LatLng(lat, long); currentPostion = LatLng(lat, long);
setMap(); setMap();
} else { } else {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(callBack: (value) { locationUtils!.getCurrentLocation(callBack: (value) {
print(value); print(value);
setMap(); setMap();
}); });
@ -136,7 +136,7 @@ class _AddAddressPageState extends State<AddAddressPage> {
child: Stack( child: Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: [ children: [
if (appMap != null) appMap, if (appMap != null) appMap!,
Container( Container(
margin: EdgeInsets.only(bottom: 50.0), margin: EdgeInsets.only(bottom: 50.0),
child: Icon( child: Icon(
@ -171,7 +171,7 @@ class _AddAddressPageState extends State<AddAddressPage> {
// ]), // ]),
// ); // );
widget.onPick(selectedPlace, "$_latitude,$_longitude"); widget.onPick(selectedPlace!, "$_latitude,$_longitude");
Navigator.of(context).pop(); Navigator.of(context).pop();
// await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); // await model.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);

@ -20,13 +20,13 @@ import 'package:provider/provider.dart';
///TODO Elham* split this to tow files ///TODO Elham* split this to tow files
class PharmacyAddressesPage extends StatefulWidget { class PharmacyAddressesPage extends StatefulWidget {
final OrderPreviewViewModel orderPreviewViewModel; final OrderPreviewViewModel? orderPreviewViewModel;
final Function changeMainState; final Function? changeMainState;
final bool isUpdate; final bool isUpdate;
final bool isShippingAddress; final bool isShippingAddress;
const PharmacyAddressesPage({Key key, this.orderPreviewViewModel, this.isUpdate = false, this.isShippingAddress = false, this.changeMainState}) : super(key: key); const PharmacyAddressesPage({Key? key, this.orderPreviewViewModel, this.isUpdate = false, this.isShippingAddress = false, this.changeMainState}) : super(key: key);
@override @override
_PharmacyAddressesState createState() => _PharmacyAddressesState(); _PharmacyAddressesState createState() => _PharmacyAddressesState();
@ -96,7 +96,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
vPadding: 12, vPadding: 12,
hasShadow: true, hasShadow: true,
handler: () { handler: () {
navigateToAddressPage(context, model, null); navigateToAddressPage(context, model, AddressInfo());
}, },
), ),
), ),
@ -132,17 +132,17 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
fontSize: 14, fontSize: 14,
vPadding: 8, vPadding: 8,
handler: () async { handler: () async {
widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson()); widget.orderPreviewViewModel!.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson());
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.orderPreviewViewModel.getInformationsByAddress(projectProvider.user.patientIdentificationNo); await widget.orderPreviewViewModel!.getInformationsByAddress(projectProvider.user!.patientIdentificationNo!);
if (widget.orderPreviewViewModel.error == "") { if (widget.orderPreviewViewModel!.error == "") {
await widget.orderPreviewViewModel.getShoppingCart(); await widget.orderPreviewViewModel!.getShoppingCart();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]); model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]);
_navigateToPaymentOption(model); _navigateToPaymentOption(model);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.orderPreviewViewModel.error); AppToast.showErrorToast(message: widget.orderPreviewViewModel!.error);
return; return;
} }
}, },
@ -158,8 +158,8 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
_navigateToPaymentOption(model) { _navigateToPaymentOption(model) {
if (widget.isUpdate) { if (widget.isUpdate) {
widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson()); widget.orderPreviewViewModel!.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson());
widget.changeMainState(); widget.changeMainState!();
Navigator.pop(context); Navigator.pop(context);
return; return;
@ -168,12 +168,12 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
context, context,
FadePage( FadePage(
page: PaymentMethodSelectPage( page: PaymentMethodSelectPage(
model: widget.orderPreviewViewModel, model: widget.orderPreviewViewModel!,
))).then((result) => { ))).then((result) => {
setState(() { setState(() {
if (result != null) { if (result != null) {
var paymentOption = result; var paymentOption = result;
widget.orderPreviewViewModel.paymentCheckoutData.paymentOption = paymentOption; widget.orderPreviewViewModel!.paymentCheckoutData!.paymentOption = paymentOption;
} }
// widget.changeMainState(); // widget.changeMainState();
}) })
@ -184,7 +184,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
class AddressItemWidget extends StatefulWidget { class AddressItemWidget extends StatefulWidget {
final PharmacyAddressesViewModel model; final PharmacyAddressesViewModel model;
final AddressInfo address; final AddressInfo address;
final Function selectAddress; final VoidCallback selectAddress;
final bool isSelected; final bool isSelected;
final Function(AddressInfo) onTabEditAddress; final Function(AddressInfo) onTabEditAddress;
@ -210,7 +210,7 @@ class _AddressItemWidgetState extends State<AddressItemWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: widget.selectAddress, onTap: widget!.selectAddress!,
child: Container( child: Container(
margin: EdgeInsets.only(left: 16, right: 16), margin: EdgeInsets.only(left: 16, right: 16),
child: Padding( child: Padding(

@ -42,7 +42,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
Card( Card(
elevation: 2, elevation: 2,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.grey[300], width: 2), side: BorderSide(color: Colors.grey[300]!, width: 2),
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(

@ -30,9 +30,9 @@ dynamic languageID;
class PharmacyProfilePage extends StatefulWidget { class PharmacyProfilePage extends StatefulWidget {
final bool moveToOrder; final bool moveToOrder;
final Function(int) changeTab; final VoidCallbackAction? changeTab;
PharmacyProfilePage({@required this.moveToOrder, this.changeTab}); PharmacyProfilePage({required this.moveToOrder, this.changeTab});
@override @override
_ProfilePageState createState() => _ProfilePageState(); _ProfilePageState createState() => _ProfilePageState();
@ -42,13 +42,13 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String page_id = ""; String page_id = "";
AuthenticatedUser user; AuthenticatedUser? user;
bool isLogin = false; bool? isLogin = false;
String firstName; String? firstName;
String customerId; String? customerId;
String customerGUID; String? customerGUID;
String lastName, mobileNo, identificationNo; String? lastName, mobileNo, identificationNo;
int languageId; int? languageId;
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE); languageID = await sharedPref.getString(APP_LANGUAGE);
@ -71,7 +71,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
if (userData != null) { if (userData != null) {
user = AuthenticatedUser.fromJson(userData); user = AuthenticatedUser.fromJson(userData);
setState(() { setState(() {
firstName = user.firstName.toString(); firstName = user!.firstName!.toString();
}); });
} else { } else {
if (userData == null) { if (userData == null) {
@ -89,7 +89,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
super.initState(); super.initState();
getUser(); getUser();
if (widget.moveToOrder) { if (widget.moveToOrder) {
Navigator.push(context, FadePage(page: OrderPage(customerID: customerId, customerGUID: customerGUID))); Navigator.push(context, FadePage(page: OrderPage(customerID: customerId!, customerGUID: customerGUID!)));
} }
} }
@ -111,9 +111,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
showPharmacyCart: false, showPharmacyCart: false,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
isMainPharmacyPages: true, isMainPharmacyPages: true,
backButtonTab: () { backButtonTab: widget.changeTab!,
widget.changeTab(0);
},
body: user != null body: user != null
? Container( ? Container(
color: Colors.white, color: Colors.white,
@ -134,7 +132,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
bottom: 10.0, bottom: 10.0,
), ),
child: LargeAvatar( child: LargeAvatar(
name: user.firstName.toString(), name: user!.firstName.toString(),
url: '', url: '',
), ),
), ),
@ -150,7 +148,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Text( Text(
languageID == "ar" ? user.firstNameN.toString() + " " + user.lastNameN.toString() : user.firstName.toString() + " " + user.lastName.toString(), languageID == "ar" ? user!.firstNameN!.toString() + " " + user!.lastNameN!.toString() : user!.firstName!.toString() + " " + user!.lastName!.toString(),
style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold),
), ),
]), ]),
@ -181,7 +179,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
AppToast.showErrorToast(message: "Customer not found"); AppToast.showErrorToast(message: "Customer not found");
return; return;
} }
Navigator.push(context, FadePage(page: OrderPage(customerID: customerId, customerGUID: customerGUID))); Navigator.push(context, FadePage(page: OrderPage(customerID: customerId!, customerGUID: customerGUID!)));
}, },
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -492,7 +490,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, this.mobileNo, this.languageId))); Navigator.push(context, FadePage(page: LakumTermsConditions(this.identificationNo!, this.firstName!, this.lastName!, this.mobileNo!, this.languageId!)));
}, },
child: Row( child: Row(
children: <Widget>[ children: <Widget>[

@ -18,9 +18,9 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class RateAppointmentClinic extends StatefulWidget { class RateAppointmentClinic extends StatefulWidget {
final AppointmentDetails appointmentDetails; late final AppointmentDetails? appointmentDetails;
final String doctorNote; late final String? doctorNote;
final int doctorRate; late final int? doctorRate;
RateAppointmentClinic({this.appointmentDetails, this.doctorRate, this.doctorNote}); RateAppointmentClinic({this.appointmentDetails, this.doctorRate, this.doctorNote});
@ -211,21 +211,21 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
: () { : () {
model model
.sendAppointmentRate( .sendAppointmentRate(
rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note) rating, widget.appointmentDetails!.appointmentNo!, widget.appointmentDetails!.projectID!, widget.appointmentDetails!.doctorID!, widget.appointmentDetails!.clinicID!, note)
.then( .then(
(value) => { (value) => {
model model
.sendDoctorRate( .sendDoctorRate(
widget.doctorRate, widget.doctorRate!,
widget.appointmentDetails.appointmentNo, widget.appointmentDetails!.appointmentNo!,
widget.appointmentDetails.projectID, widget.appointmentDetails!.projectID!,
widget.appointmentDetails.doctorID, widget.appointmentDetails!.doctorID!,
widget.appointmentDetails.clinicID, widget.appointmentDetails!.clinicID!,
note, note,
widget.appointmentDetails.appointmentDate, widget.appointmentDetails!.appointmentDate,
widget.appointmentDetails.doctorName, widget.appointmentDetails!.doctorName,
widget.appointmentDetails.projectName, widget.appointmentDetails!.projectName,
widget.appointmentDetails.clinicName) widget.appointmentDetails!.clinicName)
.then((value) { .then((value) {
Navigator.pushReplacement( Navigator.pushReplacement(
context, context,

@ -26,7 +26,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
bool location = false; bool location = false;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
var permission = new PermissionService(); var permission = new PermissionService();
LocationPermission locationPermission; LocationPermission? locationPermission;
var mediaQueryData; var mediaQueryData;
@override @override
@ -59,7 +59,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
value: vibration, value: vibration,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
vibration = value; vibration = value!;
}); });
}, },
activeColor: CustomColors.accentColor, activeColor: CustomColors.accentColor,
@ -79,7 +79,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
value: accsibility, value: accsibility,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
accsibility = value; accsibility = value!;
}); });
}, },
activeColor: CustomColors.accentColor, activeColor: CustomColors.accentColor,
@ -112,7 +112,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
groupValue: blindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
blindValue = value; blindValue = value!;
setTheme(value); setTheme(value);
}); });
}, },
@ -133,7 +133,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
groupValue: blindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
blindValue = value; blindValue = value!;
setTheme(value); setTheme(value);
}); });
}, },
@ -154,7 +154,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
groupValue: blindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
blindValue = value; blindValue = value!;
setTheme(value); setTheme(value);
}); });
}, },
@ -175,7 +175,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
groupValue: blindValue, groupValue: blindValue,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
blindValue = value; blindValue = value!;
setTheme(value); setTheme(value);
}); });
}, },
@ -207,7 +207,7 @@ class _GeneralSettings extends State<GeneralSettings> with TickerProviderStateMi
value: camera, value: camera,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
camera = value; camera = value!;
}); });
this.permission.openSettings(); this.permission.openSettings();
}, },

@ -29,7 +29,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
TextEditingController emergencyContact = new TextEditingController(); TextEditingController emergencyContact = new TextEditingController();
TextEditingController emailController = new TextEditingController(); TextEditingController emailController = new TextEditingController();
TextEditingController emergencyContactName = new TextEditingController(); TextEditingController emergencyContactName = new TextEditingController();
ProjectViewModel projectProvider; ProjectViewModel? projectProvider;
@override @override
void initState() { void initState() {
@ -68,7 +68,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
), ),
), ),
Text( Text(
model.user.patientID.toString(), model.user!.patientID.toString(),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -106,7 +106,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
groupValue: language, groupValue: language,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
language = value; language = value!;
}); });
}, },
), ),
@ -128,7 +128,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
groupValue: language, groupValue: language,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
language = value; language = value!;
}); });
}, },
), ),
@ -167,7 +167,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
value: emailAlert, value: emailAlert,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
emailAlert = value; emailAlert = value!;
}); });
}, },
activeColor: CustomColors.accentColor, activeColor: CustomColors.accentColor,
@ -187,7 +187,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
value: smsAlert, value: smsAlert,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
smsAlert = value; smsAlert = value!;
}); });
}, },
activeColor: CustomColors.accentColor, activeColor: CustomColors.accentColor,
@ -268,7 +268,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
); );
} }
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( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -368,8 +368,8 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request["IsActive"] = false; request["IsActive"] = false;
request["PatientIdentificationID"] = projectProvider.user.patientIdentificationNo; request["PatientIdentificationID"] = projectProvider!.user!.patientIdentificationNo!;
request["PatientMobileNumber"] = Utils.getPhoneNumberWithoutZero(projectProvider.user.mobileNumber); request["PatientMobileNumber"] = Utils.getPhoneNumberWithoutZero(projectProvider!.user!.mobileNumber!);
authService.deactivateAccount(request, false).then((result) { authService.deactivateAccount(request, false).then((result) {
AppToast.showSuccessToast(message: TranslationBase.of(context).accountDeactivated); AppToast.showSuccessToast(message: TranslationBase.of(context).accountDeactivated);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -403,9 +403,9 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
authService.saveSettings(request).then((result) { authService.saveSettings(request).then((result) {
AppToast.showSuccessToast(message: TranslationBase.of(context).profileUpdate); AppToast.showSuccessToast(message: TranslationBase.of(context).profileUpdate);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AuthenticatedUser authUser = projectProvider.user; AuthenticatedUser authUser = projectProvider!.user!;
authUser.emailAddress = this.emailController.text; authUser.emailAddress = this.emailController.text;
projectProvider.setUser(authUser); projectProvider!.setUser(authUser);
}); });
} }
} }

@ -17,14 +17,14 @@ class Settings extends StatefulWidget {
} }
class _Settings extends State<Settings> with TickerProviderStateMixin { class _Settings extends State<Settings> with TickerProviderStateMixin {
TabController _tabController; TabController? _tabController;
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type);
if (widget.type == 1) { if (widget.type == 1) {
_tabController.animateTo(1); _tabController!.animateTo(1);
} }
super.initState(); super.initState();

@ -94,7 +94,7 @@ class _SymptomInfo extends State<SymptomInfo> {
value: checkValue, value: checkValue,
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
this.checkValue = newValue; this.checkValue = newValue!;
}); });
}, },
controlAffinity: ListTileControlAffinity controlAffinity: ListTileControlAffinity

@ -22,16 +22,16 @@ class _MyVaccinesItemPageState extends State<MyVaccinesItemPage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<VaccineViewModel>( return BaseView<VaccineViewModel>(
onModelReady: (model) => model.getMyVaccinationItem(), onModelReady: (model) => model.getMyVaccinationItem(),
builder: (BuildContext context, VaccineViewModel model, Widget child) => builder: (BuildContext context, VaccineViewModel model, Widget? child) =>
AppScaffold( AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).myVaccinesAvailability, appBarTitle: TranslationBase.of(context).myVaccinesAvailability,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: SizeConfig.screenWidth * 0.004, left: SizeConfig.screenWidth! * 0.004,
right: SizeConfig.screenWidth * 0.004, right: SizeConfig.screenWidth! * 0.004,
top: SizeConfig.screenWidth * 0.04, top: SizeConfig.screenWidth! * 0.04,
), ),
child: ListView.builder( child: ListView.builder(
itemCount: model.vaccinationItemList.length, itemCount: model.vaccinationItemList.length,

@ -27,7 +27,7 @@ class _MyVaccinesState extends State<MyVaccines> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<VaccineViewModel>( return BaseView<VaccineViewModel>(
onModelReady: (model) => model.getVaccine(), onModelReady: (model) => model.getVaccine(),
builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, VaccineViewModel model, Widget? child) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
@ -42,7 +42,7 @@ class _MyVaccinesState extends State<MyVaccines> {
children: <Widget>[ children: <Widget>[
AppExpandableNotifier( AppExpandableNotifier(
isExpand: true, isExpand: true,
title: model.state == ViewState.Idle ? DateUtil.convertStringToDate(model.vaccineList[0].vaccinationDate).year.toString() : "", title: model.state == ViewState.Idle ? DateUtil.convertStringToDate(model.vaccineList[0].vaccinationDate!).year.toString() : "",
bodyWidget: Container( bodyWidget: Container(
child: ListView.separated( child: ListView.separated(
physics: ScrollPhysics(), physics: ScrollPhysics(),
@ -56,13 +56,13 @@ class _MyVaccinesState extends State<MyVaccines> {
onTap: null, onTap: null,
isInOutPatient: true, isInOutPatient: true,
isShowInOutPatient: false, isShowInOutPatient: false,
name: TranslationBase.of(context).dr.toString() + " " + model.vaccineList[index].doctorName, name: TranslationBase.of(context).dr.toString() + " " + model.vaccineList[index].doctorName!,
billNo: "", billNo: "",
vaccineName: model.vaccineList[index].vaccineName, vaccineName: model.vaccineList[index].vaccineName!,
profileUrl: model.vaccineList[index].doctorImageURL, profileUrl: model.vaccineList[index].doctorImageURL,
subName: model.vaccineList[index].projectName, subName: model.vaccineList[index].projectName,
isLiveCareAppointment: false, isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(model.vaccineList[index].vaccinationDate), date: DateUtil.convertStringToDate(model.vaccineList[index].vaccinationDate!),
isSortByClinic: true, isSortByClinic: true,
); );
}, },
@ -83,7 +83,7 @@ class _MyVaccinesState extends State<MyVaccines> {
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: projectViewModel.user.emailAddress, email: projectViewModel.user!.emailAddress!,
onTapSendEmail: () { onTapSendEmail: () {
model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully); model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully);
}, },

@ -4,11 +4,11 @@ import 'dart:convert';
import 'dart:async'; import 'dart:async';
class SimpleWebSocket { class SimpleWebSocket {
String _url; String? _url;
var _socket; late var _socket;
Function() onOpen; late Function() onOpen;
Function(dynamic msg) onMessage; late Function(dynamic msg) onMessage;
Function(int code, String reaso) onClose; late Function(int code, String reaso) onClose;
SimpleWebSocket(this._url); SimpleWebSocket(this._url);
connect() async { connect() async {

@ -2,11 +2,11 @@
import 'dart:html'; import 'dart:html';
class SimpleWebSocket { class SimpleWebSocket {
String _url; late String _url;
var _socket; late var _socket;
Function() onOpen; late Function() onOpen;
Function(dynamic msg) onMessage; late Function(dynamic msg) onMessage;
Function(int code, String reason) onClose; late Function(int code, String reason) onClose;
SimpleWebSocket(this._url) { SimpleWebSocket(this._url) {
_url = _url.replaceAll('https:', 'wss:'); _url = _url.replaceAll('https:', 'wss:');

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save