Merge branch 'dev_v3.13.6' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

# Conflicts:
#	lib/widgets/buttons/custom_text_button.dart
merge-update-with-lab-changes
Sultan khan 2 years ago
commit 8a42bf8b2f

@ -30,7 +30,7 @@ class AmbulanceRequestOrdersModel {
String? branch; String? branch;
String? time; String? time;
String? notes; String? notes;
num? iD; int? iD;
num? patientId; num? patientId;
num? patientOutSa; num? patientOutSa;
bool? isOutPatient; bool? isOutPatient;
@ -40,7 +40,7 @@ class AmbulanceRequestOrdersModel {
dynamic latitude; dynamic latitude;
dynamic appointmentNo; dynamic appointmentNo;
dynamic dischargeId; dynamic dischargeId;
num? statusId; int? statusId;
num? serviceId; num? serviceId;
num? channel; num? channel;
Orderpayment? orderpayment; Orderpayment? orderpayment;

@ -7,7 +7,7 @@ class DoctorList {
String? name; String? name;
int? projectID; int? projectID;
String? projectName; String? projectName;
num? actualDoctorRate; int? actualDoctorRate;
num? clinicRoomNo; num? clinicRoomNo;
dynamic date; dynamic date;
dynamic appointmentDate; dynamic appointmentDate;

@ -39,7 +39,7 @@ class DoctorProfileList {
String? doctorTitleForProfile; String? doctorTitleForProfile;
bool? isAppointmentAllowed; bool? isAppointmentAllowed;
String? nationalityFlagURL; String? nationalityFlagURL;
num? noOfPatientsRate; int? noOfPatientsRate;
String? qR; String? qR;
num? serviceID; num? serviceID;

@ -9,8 +9,8 @@ class DriveThroughTestingCenterModel {
bool? isActive; bool? isActive;
int? createdBy; int? createdBy;
String? createdOn; String? createdOn;
num? testTypeEnum; int? testTypeEnum;
num? testProcedureEnum; int? testProcedureEnum;
dynamic editedBy; dynamic editedBy;
dynamic editedON; dynamic editedON;
dynamic projectName; dynamic projectName;

@ -24,10 +24,10 @@ import 'package:provider/provider.dart';
class DentalComplaints extends StatefulWidget { class DentalComplaints extends StatefulWidget {
SearchInfo searchInfo; SearchInfo searchInfo;
Function onSelectedMethod; Function? onSelectedMethod;
bool isDoctorNameSearch; bool isDoctorNameSearch;
DentalComplaints({required this.searchInfo, required this.onSelectedMethod, this.isDoctorNameSearch = false}); DentalComplaints({required this.searchInfo, this.onSelectedMethod, this.isDoctorNameSearch = false});
@override @override
_DentalComplaintsState createState() => _DentalComplaintsState(); _DentalComplaintsState createState() => _DentalComplaintsState();

@ -26,8 +26,8 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/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 'BookConfirm.dart'; import 'BookConfirm.dart';
import 'components/DocAvailableAppointments.dart'; import 'components/DocAvailableAppointments.dart';
@ -40,16 +40,16 @@ class DoctorProfile extends StatefulWidget {
bool isLiveCareAppointment; bool isLiveCareAppointment;
bool isDoctorNameSearch; bool isDoctorNameSearch;
DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false}); DoctorProfile({required this.doctor, required this.docProfileList, required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false});
AuthenticatedUser authUser; late AuthenticatedUser authUser;
@override @override
_DoctorProfileState createState() => _DoctorProfileState(); _DoctorProfileState createState() => _DoctorProfileState();
} }
class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateMixin { class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
bool showFooterButton = false; bool showFooterButton = false;
var event = RobotProvider(); var event = RobotProvider();
dynamic doctorSchedule; dynamic doctorSchedule;
@ -67,13 +67,13 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
super.initState(); super.initState();
} }
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name, appBarTitle: widget.doctor.doctorTitle! + " " + widget.doctor.name!,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true, showNewAppBar: true,
@ -111,18 +111,18 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
children: <Widget>[ children: <Widget>[
DoctorHeader( DoctorHeader(
headerModel: HeaderModel( headerModel: HeaderModel(
widget.doctor.name, widget.doctor.name!,
widget.doctor.doctorID, widget.doctor.doctorID!,
widget.doctor.doctorImageURL, widget.doctor.doctorImageURL!,
widget.doctor.speciality, widget.doctor.speciality!,
"", "",
widget.doctor.projectName, widget.doctor.projectName!,
null, null,
null, null,
widget.doctor.nationalityFlagURL, widget.doctor.nationalityFlagURL!,
widget.doctor.doctorRate, widget.doctor.doctorRate,
widget.doctor.actualDoctorRate, widget.doctor.actualDoctorRate!,
widget.docProfileList.noOfPatientsRate, widget.docProfileList.noOfPatientsRate!,
"", "",
decimalDoctorRate: widget.docProfileList.decimalDoctorRate.toString(), decimalDoctorRate: widget.docProfileList.decimalDoctorRate.toString(),
), ),
@ -151,7 +151,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
}, },
buttonTitle: TranslationBase.of(context).schedule, buttonTitle: TranslationBase.of(context).schedule,
), ),
mDivider(Colors.grey[300]), mDivider(Colors.grey[300]!),
if (widget.docProfileList.isDoctorHasPrePostImages == true) Container(height: 50, alignment: Alignment.center, child: prePostImagesButton(context)), if (widget.docProfileList.isDoctorHasPrePostImages == true) Container(height: 50, alignment: Alignment.center, child: prePostImagesButton(context)),
TabBar( TabBar(
onTap: (index) { onTap: (index) {
@ -234,7 +234,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatings() { getDoctorRatings() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { service.getDoctorsRating(widget.doctor.doctorID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['NotesDoctorRatingList']); print(res['NotesDoctorRatingList']);
@ -251,7 +251,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatingsDetails() { getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) { service.getDoctorsRatingDetails(widget.doctor.doctorID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();
@ -319,19 +319,37 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))),
Container( Container(
margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.doctor.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.doctor.actualDoctorRate!.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center, alignment: Alignment.center,
child: RatingBar.readOnly( // child: RatingBar.readOnly(
initialRating: this.widget.doctor.actualDoctorRate.toDouble(), // initialRating: this.widget.doctor.actualDoctorRate!.toDouble(),
size: 35.0, // size: 35.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,
// ),
child: RatingBar(
initialRating: this.widget.doctor.actualDoctorRate!.toDouble(),
ratingWidget: RatingWidget(
full: Icon(
Icons.star,
color: Color(0XFFD02127),
),
half: Icon(
Icons.star_half,
color: Color(0XFFD02127),
),
empty: Icon(
Icons.star_border,
color: Color(0XFFD02127),
),
),
onRatingUpdate: (double value) {},
), ),
), ),
Container( Container(
@ -473,11 +491,13 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
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.docProfileList.noOfPatientsRate) * 100; var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate!) * 100;
return width; return width;
} }
@ -497,12 +517,12 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
// } else { // } else {
if (DocAvailableAppointments.areSlotsAvailable) { if (DocAvailableAppointments.areSlotsAvailable) {
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user.age > 12) { if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user!.age! > 12) {
navigateToDentalComplaints(context); navigateToDentalComplaints(context);
} else { } else {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime; final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
navigateToBookConfirm(context); navigateToBookConfirm(context);
projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
} }
} else { } else {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
@ -558,9 +578,9 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
page: BookConfirm( page: BookConfirm(
doctor: widget.doctor, doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment, isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate, selectedDate: DocAvailableAppointments.selectedDate!,
selectedTime: DocAvailableAppointments.selectedTime, selectedTime: DocAvailableAppointments.selectedTime!,
initialSlotDuration: DocAvailableAppointments.initialSlotDuration, initialSlotDuration: DocAvailableAppointments.initialSlotDuration!,
), ),
), ),
); );

@ -32,7 +32,7 @@ class QRCode extends StatefulWidget {
AuthenticatedUser? authUser; AuthenticatedUser? authUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
QRCode({required this.patientShareResponse, required this.appoQR, required this.appointment}); QRCode({required this.patientShareResponse, required this.appoQR, this.appointment});
@override @override
_QRCodeState createState() => _QRCodeState(); _QRCodeState createState() => _QRCodeState();
@ -89,17 +89,17 @@ class _QRCodeState extends State<QRCode> {
children: [ children: [
DoctorHeader( DoctorHeader(
headerModel: HeaderModel( headerModel: HeaderModel(
widget.appointment!.doctorTitle + " " + widget.appointment!.doctorNameObj, widget.appointment!.doctorTitle! + " " + widget.appointment!.doctorNameObj!,
widget.appointment!.doctorID, widget.appointment!.doctorID!,
widget.appointment!.doctorImageURL, widget.appointment!.doctorImageURL!,
widget.appointment!.doctorSpeciality, widget.appointment!.doctorSpeciality!,
"", "",
widget.appointment!.projectName, widget.appointment!.projectName!,
DateUtil.convertStringToDate(widget.appointment!.appointmentDate), DateUtil.convertStringToDate(widget.appointment!.appointmentDate!),
widget.appointment!.isLiveCareAppointment widget.appointment!.isLiveCareAppointment!
? DateUtil.convertStringToDate(widget.appointment!.appointmentDate).toString().split(" ")[1].substring(0, 5) ? DateUtil.convertStringToDate(widget.appointment!.appointmentDate!).toString().split(" ")[1].substring(0, 5)
: widget.appointment!.startTime.substring(0, 5), : widget.appointment!.startTime!.substring(0, 5),
null, "null",
widget.appointment!.doctorRate, widget.appointment!.doctorRate,
widget.appointment!.actualDoctorRate, widget.appointment!.actualDoctorRate,
widget.appointment!.noOfPatientsRate, widget.appointment!.noOfPatientsRate,
@ -125,11 +125,11 @@ class _QRCodeState extends State<QRCode> {
showNfcReader(context, onNcfScan: (String nfcId) { showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId); sendNfcCheckInRequest(nfcId);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment); locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!);
}); });
}, onCancel: () { }, onCancel: () {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
locator<GAnalytics>().todoList.to_do_list_nfc_cancel(widget.appointment); locator<GAnalytics>().todoList.to_do_list_nfc_cancel(widget.appointment!);
}); });
}, },
), ),
@ -197,14 +197,15 @@ class _QRCodeState extends State<QRCode> {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: "Send a copy of this QR to the email " + widget.authUser.emailAddress + "?", confirmMessage: "Send a copy of this QR to the email " + widget.authUser!.emailAddress! + "?",
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () { okFunction: () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.sendAppointmentQREmail(widget.authUser.emailAddress, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo.toString(), .sendAppointmentQREmail(widget.authUser!.emailAddress!, widget.patientShareResponse!.appointmentDate!, widget.patientShareResponse!.appointmentNo!.toString(),
widget.patientShareResponse.doctorNameObj, widget.patientShareResponse.projectName, widget.appoQR, getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), context) //Changed By Aamir
widget.patientShareResponse!.doctorNameObj, widget.patientShareResponse!.projectName, widget.appoQR!, getDoctorSpeciality(widget.patientShareResponse!.doctorSpeciality as List<String>), context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
@ -263,7 +264,7 @@ class _QRCodeState extends State<QRCode> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) { service.sendCheckinNfcRequest(widget.patientShareResponse!.appointmentNo!, nfcId, widget.patientShareResponse!.projectID!, context).then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -14,8 +14,8 @@ import 'components/SearchByClinic.dart';
class Search extends StatefulWidget { class Search extends StatefulWidget {
final int type; final int type;
final List clnicIds; final List? clnicIds;
Function onBackClick; VoidCallbackAction? onBackClick;
Search({this.type = 0, this.clnicIds, this.onBackClick}); Search({this.type = 0, this.clnicIds, this.onBackClick});
@ -24,7 +24,7 @@ class Search extends StatefulWidget {
} }
class _SearchState extends State<Search> with TickerProviderStateMixin { class _SearchState extends State<Search> with TickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
@override @override
void initState() { void initState() {
@ -79,7 +79,7 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
child: TabBarView( child: TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
SearchByClinic(clnicIds: widget.clnicIds), SearchByClinic(clnicIds: widget.clnicIds!),
SearchByDoctor(), SearchByDoctor(),
], ],
controller: _tabController, controller: _tabController,

@ -18,7 +18,7 @@ class SearchResults extends StatefulWidget {
bool isDoctorNameSearch; bool isDoctorNameSearch;
OBGyneProcedureListResponse obGyneProcedureListResponse; OBGyneProcedureListResponse obGyneProcedureListResponse;
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, @required this.isLiveCareAppointment, this.obGyneProcedureListResponse}); SearchResults({required this.doctorsList, required this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, required this.isLiveCareAppointment, required this.obGyneProcedureListResponse});
@override @override
_SearchResultsState createState() => _SearchResultsState(); _SearchResultsState createState() => _SearchResultsState();
@ -26,7 +26,7 @@ class SearchResults extends StatefulWidget {
class _SearchResultsState extends State<SearchResults> { class _SearchResultsState extends State<SearchResults> {
List<DoctorList> tempList = []; List<DoctorList> tempList = [];
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -49,7 +49,7 @@ class _SearchResultsState extends State<SearchResults> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return AppExpandableNotifier( return AppExpandableNotifier(
title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0")
? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km ? widget.patientDoctorAppointmentListHospital[index].filterName! + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs! + " " + TranslationBase.of(context).km
: widget.patientDoctorAppointmentListHospital[index].filterName, : widget.patientDoctorAppointmentListHospital[index].filterName,
isTitleSingleLine: false, isTitleSingleLine: false,
isExpand: widget.patientDoctorAppointmentListHospital.length == 1 ? true : false, isExpand: widget.patientDoctorAppointmentListHospital.length == 1 ? true : false,
@ -58,7 +58,7 @@ class _SearchResultsState extends State<SearchResults> {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index]; final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList![_index];
return DoctorView( return DoctorView(
doctor: doctor, doctor: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment, isLiveCareAppointment: widget.isLiveCareAppointment,
@ -70,7 +70,7 @@ class _SearchResultsState extends State<SearchResults> {
}); });
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length), itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList!.length),
); );
}, },
itemCount: widget.patientDoctorAppointmentListHospital.length, itemCount: widget.patientDoctorAppointmentListHospital.length,

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
class DoctorPostPreImagesContent extends StatefulWidget { class DoctorPostPreImagesContent extends StatefulWidget {
final DoctorPrePostImages doctorPrePostImages; final DoctorPrePostImages doctorPrePostImages;
const DoctorPostPreImagesContent({this.doctorPrePostImages}); const DoctorPostPreImagesContent({required this.doctorPrePostImages});
@override @override
DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState(); DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState();

@ -19,19 +19,19 @@ enum Gender { Male, Female, NON }
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
class AddNewChildPage extends StatefulWidget { class AddNewChildPage extends StatefulWidget {
final int frequency; final int? frequency;
final int days; final int? days;
final String itemDescription; final String? itemDescription;
String dateAdd; String? dateAdd;
List<DateTime> _scheduleList =[]; List<DateTime> _scheduleList =[];
List<DayOfWeek> daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday]; List<DayOfWeek> daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday];
DateTime startDay; DateTime? startDay;
DateTime endDay; DateTime? endDay;
//AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); //AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key);
AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) { AddNewChildPage({Key? key, this.frequency, this.days, this.itemDescription}) {
startDay = DateTime.now(); startDay = DateTime.now();
endDay = DateTime.now(); //endDay = DateTime.now().add(Duration(days: days)); endDay = DateTime.now(); //endDay = DateTime.now().add(Duration(days: days));
int hour = 24; //(24 / frequency).round(); int hour = 24; //(24 / frequency).round();
@ -46,8 +46,8 @@ class AddNewChildPage extends StatefulWidget {
} }
class _AddNewChildPageState extends State<AddNewChildPage> { class _AddNewChildPageState extends State<AddNewChildPage> {
int tappedIndex; late int tappedIndex;
int checkedValue; late int checkedValue;
@override @override
void initState() { void initState() {
@ -278,11 +278,11 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
} }
String getStartDay() { String getStartDay() {
return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; return "${DateUtil.getMonth(widget.startDay!.month)} ${widget.startDay!.day}, ${widget.startDay!.year}";
} }
String getEndDay() { String getEndDay() {
return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; return "${DateUtil.getMonth(widget.endDay!.month)} ${widget.endDay!.day}, ${widget.endDay!.year}";
} }
String getDateTime(DateTime dateTime) { String getDateTime(DateTime dateTime) {
@ -313,7 +313,7 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
} }
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),
alignment: Alignment.center, alignment: Alignment.center,

@ -18,8 +18,7 @@ class ChildPage extends StatefulWidget {
_ChildPageState createState() => _ChildPageState(); _ChildPageState createState() => _ChildPageState();
} }
class _ChildPageState extends State<ChildPage> class _ChildPageState extends State<ChildPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
DeleteBaby deleteBaby = DeleteBaby(); DeleteBaby deleteBaby = DeleteBaby();
@override @override
@ -57,20 +56,16 @@ class _ChildPageState extends State<ChildPage>
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: VaccinationTablePage(model page: VaccinationTablePage(model.babyInformationModelList[index]),
.babyInformationModelList[index]),
), ),
); );
}, },
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, right: 0, bottom: 20),
left: 0, right: 0, bottom: 20),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.white, width: 0.5),
color: Colors.white, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(5)),
borderRadius:
BorderRadius.all(Radius.circular(5)),
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -78,24 +73,14 @@ class _ChildPageState extends State<ChildPage>
child: Column( child: Column(
children: [ children: [
Row(children: [ Row(children: [
Texts(TranslationBase.of(context) Texts(TranslationBase.of(context).childName),
.childName),
]), ]),
Row(children: [ Row(children: [
Texts(model Texts(model.babyInformationModelList[index].babyName!.trim()),
.babyInformationModelList[index]
.babyName
.trim()),
]), ]),
Row(children: [ Row(children: [
IconButton( IconButton(
icon: Image.asset(model icon: Image.asset(model.babyInformationModelList[index].gender == 1 ? 'assets/images/new-design/male.png' : 'assets/images/new-design/female.png'),
.babyInformationModelList[
index]
.gender ==
1
? 'assets/images/new-design/male.png'
: 'assets/images/new-design/female.png'),
tooltip: '', tooltip: '',
onPressed: () { onPressed: () {
setState(() { setState(() {
@ -104,9 +89,7 @@ class _ChildPageState extends State<ChildPage>
}); });
}, },
), ),
Texts(model Texts(model.babyInformationModelList[index].genderDescription),
.babyInformationModelList[index]
.genderDescription),
IconButton( IconButton(
icon: Icon( icon: Icon(
Icons.remove_red_eye, Icons.remove_red_eye,
@ -117,9 +100,7 @@ class _ChildPageState extends State<ChildPage>
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: VaccinationTablePage(model page: VaccinationTablePage(model.babyInformationModelList[index]),
.babyInformationModelList[
index]),
), ),
); );
}, },
@ -130,47 +111,34 @@ class _ChildPageState extends State<ChildPage>
]), ]),
Row(children: [ Row(children: [
IconButton( IconButton(
icon: new Image.asset( icon: new Image.asset('assets/images/new-design/calender-secondary.png'),
'assets/images/new-design/calender-secondary.png'),
tooltip: '', tooltip: '',
onPressed: () { onPressed: () {
setState(() {}); setState(() {});
}, },
), ),
Texts(DateUtil.yearMonthDay(model Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB!)),
.babyInformationModelList[index]
.dOB)),
]), ]),
Row(children: [ Row(children: [
IconButton( IconButton(
icon: new Image.asset( icon: new Image.asset('assets/images/new-design/garbage.png'),
'assets/images/new-design/garbage.png'),
tooltip: '', tooltip: '',
onPressed: () async { onPressed: () async {
//===================== //=====================
await model.deleteBabyOrders( await model.deleteBabyOrders(newChild: deleteBaby);
newChild: deleteBaby);
deleteBaby.babyID = model deleteBaby.babyID = model.babyInformationModelList[index].babyID;
.babyInformationModelList[index]
.babyID;
await model.deleteBabyOrders( await model.deleteBabyOrders(newChild: deleteBaby);
newChild: deleteBaby);
if (model.isDeleted) { if (model.isDeleted) {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).recordDeleted);
message: TranslationBase.of( Navigator.pop(context, model.isDeleted);
context)
.recordDeleted);
Navigator.pop(
context, model.isDeleted);
} else { } else {
//TODO handling error //TODO handling error
} }
}, },
), ),
Texts(TranslationBase.of(context) Texts(TranslationBase.of(context).deleteView),
.deleteView),
]), ]),
SizedBox( SizedBox(
height: 12, height: 12,

@ -86,20 +86,20 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage> with SingleTicker
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
fillColor: Colors.red, fillColor: Colors.red,
hintText: model.user != null ? model.user.emailAddress : "", hintText: model.user != null ? model.user!.emailAddress : "",
controller: titleController, controller: titleController,
fontSize: 20, fontSize: 20,
hintColor: Colors.black, hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onChanged: (text) { onChanged: (text) {
addEmail = text; addEmail = text;
model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true; model.user!.emailAddress == addEmail ? checkedValue = false : checkedValue = true;
}, },
validator: (value) { validator: (value) {
if (value == null) { if (value == null) {
return model.user.emailAddress; return model.user!.emailAddress;
} else { } else {
return model.user.emailAddress; return model.user!.emailAddress;
} }
}, },
), ),
@ -122,7 +122,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage> with SingleTicker
label: TranslationBase.of(context).updateEmail, label: TranslationBase.of(context).updateEmail,
// //
onTap: () { onTap: () {
model.user.emailAddress = addEmail.toString(); model.user!.emailAddress = addEmail.toString();
AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg); AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg);
// bloodDetails.city=_selectedHospital.toString(); // bloodDetails.city=_selectedHospital.toString();

@ -7,7 +7,7 @@ class SelectGenderDialog extends StatefulWidget {
final Email; final Email;
final Function okFunction; final Function okFunction;
const SelectGenderDialog({Key key, this.Email, this.okFunction}) const SelectGenderDialog({Key? key, this.Email, required this.okFunction})
: super(key: key); : super(key: key);
@override @override

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -77,7 +78,7 @@ class _ChildVaccinesPageState extends State<ChildInitialPage> with SingleTickerP
), ),
TextFields( TextFields(
fillColor: Colors.red, fillColor: Colors.red,
hintText: model.user != null ? model.user.emailAddress : "", hintText: model.user != null ? model.user!.emailAddress : "",
controller: titleController, controller: titleController,
fontSize: 14, fontSize: 14,
hintColor: Colors.black, hintColor: Colors.black,
@ -90,13 +91,13 @@ class _ChildVaccinesPageState extends State<ChildInitialPage> with SingleTickerP
}, },
onChanged: (text) { onChanged: (text) {
addEmail = text; addEmail = text;
model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true; model.user!.emailAddress == addEmail ? checkedValue = false : checkedValue = true;
}, },
validator: (value) { validator: (value) {
if (value == null) { if (value == null) {
return model.user.emailAddress; return model.user!.emailAddress;
} else { } else {
return model.user.emailAddress; return model.user!.emailAddress;
} }
}, },
), ),
@ -117,7 +118,7 @@ class _ChildVaccinesPageState extends State<ChildInitialPage> with SingleTickerP
label: TranslationBase.of(context).updateEmail, label: TranslationBase.of(context).updateEmail,
// //
onTap: () { onTap: () {
model.user.emailAddress = addEmail.toString(); model.user!.emailAddress = addEmail.toString();
AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg); AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg);
// bloodDetails.city=_selectedHospital.toString(); // bloodDetails.city=_selectedHospital.toString();

@ -85,7 +85,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
model.babyInformationModelList[index].babyName.trim(), model.babyInformationModelList[index].babyName!.trim(),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
letterSpacing: -0.46, letterSpacing: -0.46,
@ -94,7 +94,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
), ),
), ),
Text( Text(
model.babyInformationModelList[index].genderDescription, model.babyInformationModelList[index].genderDescription!,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
color: selectedColor, color: selectedColor,
@ -109,7 +109,7 @@ class _ChildPageState extends State<ChildVaccinePage> with SingleTickerProviderS
color: selectedColor, color: selectedColor,
), ),
), ),
Text(" " + DateUtil.getDayMonthYearDateFormatted(model.babyInformationModelList[index].dOB), Text(" " + DateUtil.getDayMonthYearDateFormatted(model.babyInformationModelList[index].dOB!),
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
color: selectedColor, color: selectedColor,

@ -58,7 +58,7 @@ class VaccinationTablePage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
babyInfo.babyName, babyInfo.babyName!,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -100,7 +100,7 @@ class VaccinationTablePage extends StatelessWidget {
), ),
), ),
Text( Text(
DateUtil.getFormattedDate(babyInfo.dOB, "MMM dd,yyyy"), DateUtil.getFormattedDate(babyInfo.dOB!, "MMM dd,yyyy"),
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -183,13 +183,13 @@ class VaccinationTablePage extends StatelessWidget {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ children: [
Utils.tableColumnValue(diabtec.visit, isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(diabtec.visit!, isCapitable: false, mProjectViewModel: projectViewModel),
// Utils.tableColumnValue(diabtec.vaccinesDescription, isCapitable: false, mProjectViewModel: projectViewModel), // Utils.tableColumnValue(diabtec.vaccinesDescription, isCapitable: false, mProjectViewModel: projectViewModel),
Html( Html(
// data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription // data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription
data: diabtec.vaccinesDescription, data: diabtec.vaccinesDescription,
), ),
Utils.tableColumnValue(diabtec.givenAt, isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(diabtec.givenAt!, isCapitable: false, mProjectViewModel: projectViewModel),
], ],
), ),
); );

@ -15,8 +15,8 @@ class HospitalsLiveChatPage extends StatefulWidget {
} }
class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> { class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
int tappedIndex; int? tappedIndex;
String chat; String? chat;
@override @override
void initState() { void initState() {
@ -63,7 +63,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
setState(() { setState(() {
tappedIndex = index; tappedIndex = index;
chat = chat =
"http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user!.firstName}&PatientID=${model.user!.patientID}&MobileNo=${model.user!.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}";
}); });
}, },
child: Container( child: Container(
@ -108,9 +108,10 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).start, TranslationBase.of(context).start,
chat.isEmpty ? null : () => {launch(chat)}, //Changed By Aamir URL
chat!.isEmpty ? null : () => {launch(chat!)},
color: Color(0xffD02127), color: Color(0xffD02127),
textColor: chat.isEmpty ? Color(0xff000000) : Colors.white, textColor: chat!.isEmpty ? Color(0xff000000) : Colors.white,
disabledColor: Color(0xffEAEAEA), disabledColor: Color(0xffEAEAEA),
), ),
), ),

@ -13,7 +13,7 @@ class LiveChatPage extends StatefulWidget {
} }
class _LiveChatPageState extends State<LiveChatPage> with SingleTickerProviderStateMixin { class _LiveChatPageState extends State<LiveChatPage> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
@override @override

@ -10,7 +10,7 @@ import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class PharmaciesLiveChatPage extends StatelessWidget { class PharmaciesLiveChatPage extends StatelessWidget {
PharmaciesLiveChatPage({Key key}) : super(key: key); PharmaciesLiveChatPage({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -15,7 +15,7 @@ class ContactUsPage extends StatefulWidget {
} }
class _ContactUsPageState extends State<ContactUsPage> { class _ContactUsPageState extends State<ContactUsPage> {
LocationUtils locationUtils; late LocationUtils locationUtils;
@override @override
void initState() { void initState() {
@ -72,7 +72,7 @@ class _ContactUsPageState extends State<ContactUsPage> {
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).findUs, title: TranslationBase.of(context).findUs,
imagePath: 'assets/images/new-design/find_us_icon.png', imagePath: 'assets/images/new-design/find_us_icon.png',
subTitle: null, subTitle: "",
isPngImage: true, isPngImage: true,
), ),
)); ));
@ -85,7 +85,7 @@ class _ContactUsPageState extends State<ContactUsPage> {
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).feedback, title: TranslationBase.of(context).feedback,
imagePath: 'assets/images/new-design/feedback_icon.png', imagePath: 'assets/images/new-design/feedback_icon.png',
subTitle: null, subTitle: "",
isPngImage: true, isPngImage: true,
), ),
)); ));
@ -98,7 +98,7 @@ class _ContactUsPageState extends State<ContactUsPage> {
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).liveChat, title: TranslationBase.of(context).liveChat,
imagePath: 'assets/images/new-design/live_chat_icon.png', imagePath: 'assets/images/new-design/live_chat_icon.png',
subTitle: null, subTitle: "",
isPngImage: true, isPngImage: true,
), ),
)); ));

@ -15,7 +15,7 @@ class FindUsPage extends StatefulWidget {
} }
class _FindUsPageState extends State<FindUsPage> with SingleTickerProviderStateMixin { class _FindUsPageState extends State<FindUsPage> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
@override @override
void initState() { void initState() {
super.initState(); super.initState();

@ -7,7 +7,7 @@ import 'package:url_launcher/url_launcher.dart';
class HospitalsPage extends StatefulWidget { class HospitalsPage extends StatefulWidget {
final List<GetHMGLocationsModel> findusHospitalModelList; final List<GetHMGLocationsModel> findusHospitalModelList;
HospitalsPage({Key key, this.findusHospitalModelList}); HospitalsPage({Key? key, required this.findusHospitalModelList});
@override @override
_HospitalsPageState createState() => _HospitalsPageState(); _HospitalsPageState createState() => _HospitalsPageState();

@ -7,7 +7,7 @@ import 'package:url_launcher/url_launcher.dart';
class PharmaciesPage extends StatefulWidget { class PharmaciesPage extends StatefulWidget {
final List<GetHMGLocationsModel> findusPharmaciesModelList; final List<GetHMGLocationsModel> findusPharmaciesModelList;
PharmaciesPage({Key key, this.findusPharmaciesModelList}); PharmaciesPage({Key? key, required this.findusPharmaciesModelList});
@override @override
_PharmaciesPageState createState() => _PharmaciesPageState(); _PharmaciesPageState createState() => _PharmaciesPageState();

@ -24,7 +24,7 @@ class CardCommonContact extends StatelessWidget {
final ProjectViewModel projectViewModel; final ProjectViewModel projectViewModel;
final ToDoCountProviderModel model; final ToDoCountProviderModel model;
const CardCommonContact({@required this.image, @required this.text, @required this.subText, @required this.type, this.width, this.height, this.projectViewModel, this.model}); const CardCommonContact({required this.image, required this.text, required this.subText, required this.type, this.width, this.height, required this.projectViewModel, required this.model});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -29,31 +29,31 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart';
class CovidTimeSlots extends StatefulWidget { class CovidTimeSlots extends StatefulWidget {
int projectID; int? projectID;
static bool areSlotsAvailable = false; static bool areSlotsAvailable = false;
static DateTime selectedAppoDateTime; static DateTime? selectedAppoDateTime;
static String selectedDate; static String? selectedDate;
static String selectedTime; static String? selectedTime;
CovidTestProceduresResponse selectedProcedure; CovidTestProceduresResponse? selectedProcedure;
DriveThroughTestingCenterModel selectedProject; DriveThroughTestingCenterModel? selectedProject;
int selectedClinicID; int? selectedClinicID;
int selectedDoctorID; int? selectedDoctorID;
var language; var language;
PatientShareResponse patientShareResponse; PatientShareResponse? patientShareResponse;
CovidTimeSlots({@required this.projectID, @required this.selectedProcedure, @required this.selectedProject}); CovidTimeSlots({required this.projectID, required this.selectedProcedure, required this.selectedProject});
@override @override
_CovidTimeSlotsState createState() => _CovidTimeSlotsState(); _CovidTimeSlotsState createState() => _CovidTimeSlotsState();
} }
class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStateMixin { class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStateMixin {
Map<DateTime, List> _events; late Map<DateTime, List> _events;
AnimationController _animationController; late AnimationController _animationController;
CalendarController _calendarController; late CalendarController _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -68,10 +68,10 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
dynamic freeSlotsResponse; dynamic freeSlotsResponse;
ScrollController _scrollController; late ScrollController _scrollController;
ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -85,7 +85,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
_selectedDay: ['Event A0'] _selectedDay: ['Event A0']
}; };
WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID)); WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID!));
_calendarController = CalendarController(); _calendarController = CalendarController();
_animationController = AnimationController( _animationController = AnimationController(
@ -224,11 +224,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}, },
child: Text( child: Text(
TranslationBase.of(context).bookAppo, TranslationBase.of(context).bookAppo,
style: TextStyle( style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, color: Colors.white),
fontSize: 16.0,
letterSpacing: -0.64,
color: Colors.white
),
), ),
), ),
), ),
@ -254,7 +250,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
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);
}, },
); );
} }
@ -354,7 +350,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
print(CovidTimeSlots.selectedTime); print(CovidTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))), child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))),
); );
} }
@ -369,25 +365,25 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
print(CovidTimeSlots.selectedTime); print(CovidTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))), child: Text(dayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xFF60686b))),
); );
} }
bookCovidTestAppointment() { bookCovidTestAppointment() {
if (CovidTimeSlots.areSlotsAvailable) { if (CovidTimeSlots.areSlotsAvailable) {
var messageEn = "This Appointment is being booked for patient " + var messageEn = "This Appointment is being booked for patient " +
projectViewModel.authenticatedUserObject.user.firstName + projectViewModel.authenticatedUserObject.user!.firstName! +
" " + " " +
projectViewModel.authenticatedUserObject.user.lastName + projectViewModel.authenticatedUserObject.user!.lastName! +
", Having file number " + ", Having file number " +
projectViewModel.authenticatedUserObject.user.patientID.toString() + projectViewModel.authenticatedUserObject.user!.patientID.toString() +
". Please confirm!"; ". Please confirm!";
var messageAr = "يتم حجز هذا الموعد المراجع " + var messageAr = "يتم حجز هذا الموعد المراجع " +
projectViewModel.authenticatedUserObject.user.firstName + projectViewModel.authenticatedUserObject.user!.firstName! +
" " + " " +
projectViewModel.authenticatedUserObject.user.lastName + projectViewModel.authenticatedUserObject.user!.lastName! +
", وجود رقم الملف " + ", وجود رقم الملف " +
projectViewModel.authenticatedUserObject.user.patientID.toString() + projectViewModel.authenticatedUserObject.user!.patientID.toString() +
". يرجى تأكيد!"; ". يرجى تأكيد!";
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -412,7 +408,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
insertCovidQuestionnaire(context, DoctorList docObject) async { insertCovidQuestionnaire(context, DoctorList docObject) async {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List qa = await sharedPref.getObject(COVID_QA_LIST); List qa = await sharedPref.getObject(COVID_QA_LIST);
service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { service.insertCovidQuestionnaire(qa, widget.projectID!, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum!).then((res) {
insertAppointmentCovidTest(context, docObject); insertAppointmentCovidTest(context, docObject);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -421,7 +417,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
updateCovidQuestionnaire(context, String appoNo) async { updateCovidQuestionnaire(context, String appoNo) async {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.updateCovidQuestionnaire(appoNo, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) {}).catchError((err) { service.updateCovidQuestionnaire(appoNo, widget.projectID!, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum!).then((res) {}).catchError((err) {
print(err); print(err);
}); });
} }
@ -430,13 +426,13 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
service service
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID, .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, CovidTimeSlots.selectedTime!, CovidTimeSlots.selectedDate!, 0, context,
widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum) widget.selectedProcedure!.procedureID, widget.selectedProject!.testTypeEnum, widget.selectedProject!.testProcedureEnum)
.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);
getToDoCount(); getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList(); appo = new AppoitmentAllHistoryResultList();
@ -516,7 +512,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: CovidPaymentAlert(patientShareResponse: widget.patientShareResponse), page: CovidPaymentAlert(patientShareResponse: widget.patientShareResponse!),
), ),
); );
} }
@ -524,7 +520,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
getCovidFreeSlots(BuildContext context, int projectID) { getCovidFreeSlots(BuildContext context, int projectID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidFreeSlots(context, projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { service.getCovidFreeSlots(context, projectID, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum!).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) { if (res['COVID19_FreeTimeSlots'].length != 0) {
@ -552,32 +548,32 @@ 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;
} }

@ -26,14 +26,14 @@ class CovidDirveThruQuestions extends StatefulWidget {
final List<CovidTestProceduresResponse> proceduresList; final List<CovidTestProceduresResponse> proceduresList;
DriveThroughTestingCenterModel selectedProject; DriveThroughTestingCenterModel selectedProject;
CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList, @required this.selectedProject}); CovidDirveThruQuestions({required this.projectId, required this.proceduresList, required this.selectedProject});
@override @override
CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState(); CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState();
} }
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> { class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa; late List qa;
@override @override
void initState() { void initState() {
@ -41,8 +41,8 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
qa = getQuestionsFromJson(); qa = getQuestionsFromJson();
} }
TranslationBase localize; late TranslationBase localize;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -96,7 +96,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -118,7 +118,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
), ),
mWidth(3), mWidth(3),
Text( Text(
projectViewModel.user.patientIdentificationNo, projectViewModel.user!.patientIdentificationNo!,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
@ -235,7 +235,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
height: 50, height: 50,
elevation: 0, elevation: 0,
color: all2 ? CustomColors.accentColor : CustomColors.grey, color: all2 ? CustomColors.accentColor : CustomColors.grey,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), disabledColor: Theme.of(context).appBarTheme.color!.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text( child: Text(
localize.next, localize.next,
@ -303,7 +303,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID!, widget.selectedProject.testTypeEnum!, widget.selectedProject.testProcedureEnum!).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);

@ -27,7 +27,7 @@ class CovidDrivethruLocation extends StatefulWidget {
} }
class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> { class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectDropdownValue; late String projectDropdownValue;
List<DriveThroughTestingCenterModel> projectsList = []; List<DriveThroughTestingCenterModel> projectsList = [];
List<CovidTestProceduresResponse> proceduresList = []; List<CovidTestProceduresResponse> proceduresList = [];
bool isLocationSelected = false; bool isLocationSelected = false;
@ -37,10 +37,10 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectID = ""; String projectID = "";
List<ImagesInfo> imagesInfo = []; List<ImagesInfo> imagesInfo = [];
DriveThroughTestingCenterModel selectedProject; late DriveThroughTestingCenterModel selectedProject;
final GlobalKey locationDropdownKey = GlobalKey(); final GlobalKey locationDropdownKey = GlobalKey();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -132,7 +132,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
}).toList(), }).toList(),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
selectedProject = newValue; selectedProject = newValue!;
setProjectLocation(newValue); setProjectLocation(newValue);
}); });
}, },
@ -262,6 +262,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
Container(padding: EdgeInsets.only(left: 5.0, right: 5.0), child: SvgPicture.asset("assets/images/new/DriveThru.svg", width: 20.0)), Container(padding: EdgeInsets.only(left: 5.0, right: 5.0), child: SvgPicture.asset("assets/images/new/DriveThru.svg", width: 20.0)),
], ],
); );
} else {
return SizedBox();
} }
} }
@ -300,7 +302,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID, selectedProject.testTypeEnum, selectedProject.testProcedureEnum).then((res) { service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID!, selectedProject.testTypeEnum!, selectedProject.testProcedureEnum!).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
@ -325,7 +327,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidTestProceduresList(context, selectedProject.testTypeEnum, selectedProject.testProcedureEnum, selectedProject.projectID).then((res) { service.getCovidTestProceduresList(context, selectedProject.testTypeEnum!, selectedProject.testProcedureEnum!, selectedProject.projectID!).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
res['COVID19_TestProceduresList'].forEach((v) { res['COVID19_TestProceduresList'].forEach((v) {

@ -15,7 +15,7 @@ import 'package:flutter/material.dart';
class CovidPaymentAlert extends StatefulWidget { class CovidPaymentAlert extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
CovidPaymentAlert({@required this.patientShareResponse}); CovidPaymentAlert({required this.patientShareResponse});
@override @override
_CovidPaymentAlertState createState() => _CovidPaymentAlertState(); _CovidPaymentAlertState createState() => _CovidPaymentAlertState();
@ -23,7 +23,7 @@ class CovidPaymentAlert extends StatefulWidget {
class _CovidPaymentAlertState extends State<CovidPaymentAlert> { class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; late AuthenticatedUser authUser;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -182,8 +182,8 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: CustomColors.accentColor, backgroundColor: CustomColors.accentColor,
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: () {
startPaymentProcess(); startPaymentProcess();

@ -19,10 +19,10 @@ class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse; CovidPaymentInfoResponse covidPaymentInfoResponse;
int projectID; int projectID;
List<CovidTestProceduresResponse> proceduresList; List<CovidTestProceduresResponse> proceduresList;
CovidTestProceduresResponse selectedProcedure; late CovidTestProceduresResponse selectedProcedure;
DriveThroughTestingCenterModel selectedProject; DriveThroughTestingCenterModel selectedProject;
CovidPaymentDetails({@required this.covidPaymentInfoResponse, @required this.projectID, @required this.proceduresList, @required this.selectedProject}); CovidPaymentDetails({required this.covidPaymentInfoResponse, required this.projectID, required this.proceduresList, required this.selectedProject});
@override @override
_CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState();
@ -74,7 +74,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
onTap: () { onTap: () {
setState(() { setState(() {
widget.selectedProcedure = widget.proceduresList[index]; widget.selectedProcedure = widget.proceduresList[index];
getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID!);
}); });
}, },
child: Row( child: Row(
@ -86,14 +86,14 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
toggleable: true, toggleable: true,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedProcedure = value; widget.selectedProcedure = value!;
print(widget.selectedProcedure.procedureName); print(widget.selectedProcedure.procedureName);
getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID!);
}); });
}, },
), ),
Text( Text(
projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName, projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN! : widget.proceduresList[index].procedureName!,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -137,7 +137,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
], ],
), ),
), ),
mDivider(Colors.grey[200]), mDivider(Colors.grey[200]!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3), padding: EdgeInsets.only(top: 3, bottom: 3),
@ -152,7 +152,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
], ],
), ),
), ),
mDivider(Colors.grey[200]), mDivider(Colors.grey[200]!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3), padding: EdgeInsets.only(top: 3, bottom: 3),
@ -248,8 +248,8 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: CustomColors.accentColor, backgroundColor: CustomColors.accentColor,
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: () {
cancel(); cancel();
@ -279,8 +279,8 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
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: isAgree ? next : null, onPressed: isAgree ? next : null,
child: Text( child: Text(
@ -313,7 +313,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
getPaymentInfo(BuildContext context, String projectID, String selectedProcedureID) { getPaymentInfo(BuildContext context, String projectID, String selectedProcedureID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidPaymentInformation(context, int.parse(projectID), selectedProcedureID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { service.getCovidPaymentInformation(context, int.parse(projectID), selectedProcedureID, widget.selectedProject.testTypeEnum!, widget.selectedProject.testProcedureEnum!).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -24,25 +24,24 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget { class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse? patientShareResponse;
String selectedPaymentMethod; String selectedPaymentMethod;
String selectedInstallmentPlan; String? selectedInstallmentPlan;
MyInAppBrowser browser; MyInAppBrowser? browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser? authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = ""; String transID = "";
CovidPaymentSummary({@required this.patientShareResponse, this.selectedPaymentMethod}); CovidPaymentSummary({required this.patientShareResponse, required this.selectedPaymentMethod});
@override @override
_CovidPaymentSummaryState createState() => _CovidPaymentSummaryState(); _CovidPaymentSummaryState createState() => _CovidPaymentSummaryState();
} }
class _CovidPaymentSummaryState extends State<CovidPaymentSummary> { class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
String tamaraPaymentStatus; late String tamaraPaymentStatus;
String tamaraOrderID; late String tamaraOrderID;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -81,7 +80,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
), ),
), ),
Text( Text(
'${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar, '${widget.patientShareResponse!.patientShareWithTax} ' + TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -103,7 +102,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
Container( Container(
height: 100.0, height: 100.0,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
child: Image.asset(getImagePath(widget.selectedPaymentMethod), width: 100, height: 100), child: Image.asset(getImagePath(widget.selectedPaymentMethod!), width: 100, height: 100),
), ),
mFlex(1), mFlex(1),
InkWell( InkWell(
@ -111,12 +110,12 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
showDraggableDialog( showDraggableDialog(
context, context,
PaymentMethod( PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
widget.selectedPaymentMethod = metohd; widget.selectedPaymentMethod = metohd;
widget.selectedInstallmentPlan = selectedInstallmentPlan; widget.selectedInstallmentPlan = selectedInstallmentPlan;
setState(() {}); setState(() {});
}, },
patientShare: widget.patientShareResponse.patientShareWithTax, patientShare: widget.patientShareResponse!.patientShareWithTax,
)); ));
}, },
child: Text( child: Text(
@ -135,7 +134,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
flex: 1, flex: 1,
child: showDetail( child: showDetail(
TranslationBase.of(context).fileNumber, TranslationBase.of(context).fileNumber,
projectViewModel.user.patientID.toString(), projectViewModel.user!.patientID.toString(),
), ),
), ),
mWidth(6), mWidth(6),
@ -143,7 +142,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
flex: 1, flex: 1,
child: showDetail( child: showDetail(
TranslationBase.of(context).name, TranslationBase.of(context).name,
projectViewModel.user.firstName.toString(), projectViewModel.user!.firstName.toString(),
), ),
), ),
], ],
@ -151,13 +150,13 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
SizedBox( SizedBox(
height: 6, height: 6,
), ),
showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user.mobileNumber), showDetail(TranslationBase.of(context).mobileNumber, projectViewModel.user!.mobileNumber!),
SizedBox( SizedBox(
height: 6, height: 6,
), ),
showDetail( showDetail(
TranslationBase.of(context).depositorName, TranslationBase.of(context).depositorName,
projectViewModel.user.firstName + " " + projectViewModel.user.middleName + " " + projectViewModel.user.lastName, projectViewModel.user!.firstName! + " " + projectViewModel.user!.middleName! + " " + projectViewModel.user!.lastName!,
) )
], ],
), ),
@ -171,7 +170,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).confirm.toUpperCase(), TranslationBase.of(context).confirm.toUpperCase(),
() { () {
startPaymentProcess(projectViewModel.user); startPaymentProcess(projectViewModel.user!);
}, },
color: CustomColors.green, color: CustomColors.green,
), ),
@ -207,36 +206,37 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
startPaymentProcess(AuthenticatedUser authenticatedUser) { startPaymentProcess(AuthenticatedUser authenticatedUser) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID; appo.projectID = widget.patientShareResponse!.projectID;
appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicID = widget.patientShareResponse!.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse!.appointmentNo;
openPayment(widget.selectedPaymentMethod, authenticatedUser, double.parse(widget.patientShareResponse.patientShareWithTax.toString()), widget.patientShareResponse, appo); openPayment(widget.selectedPaymentMethod, authenticatedUser, double.parse(widget.patientShareResponse!.patientShareWithTax.toString()), widget.patientShareResponse!, appo);
} }
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser( widget.browser!.openPaymentBrowser(
amount, amount,
"Covid appointment payment", "Covid appointment payment",
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, paymentMethod,
authenticatedUser.patientType, authenticatedUser.patientType,
authenticatedUser.firstName, authenticatedUser.firstName!,
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
widget.browser, widget.browser!,
widget.patientShareResponse.isLiveCareAppointment, widget.patientShareResponse!.isLiveCareAppointment!,
"2", "2",
"", "",
widget.patientShareResponse.appointmentDate, widget.patientShareResponse!.appointmentDate,
widget.patientShareResponse.appointmentNo, widget.patientShareResponse!.appointmentNo!,
widget.patientShareResponse.clinicID, widget.patientShareResponse!.clinicID!,
widget.patientShareResponse.doctorID, widget.patientShareResponse!.doctorID!,
widget.selectedInstallmentPlan); widget.selectedInstallmentPlan,
);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -246,18 +246,18 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
if (widget.selectedPaymentMethod == "TAMARA") { if (widget.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']!;
} }
} }
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser!.isOpened()) widget.browser!.close();
MyInAppBrowser.isPaymentDone = true; MyInAppBrowser.isPaymentDone = true;
return; return;
} }
@ -265,7 +265,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser!.isOpened()) widget.browser!.close();
MyInAppBrowser.isPaymentDone = false; MyInAppBrowser.isPaymentDone = false;
return; return;
} }
@ -276,7 +276,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
try { try {
if (widget.selectedPaymentMethod == "TAMARA") { if (widget.selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
// } else { // } else {
@ -297,10 +297,10 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
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, tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, int.parse(widget.selectedInstallmentPlan!), appo);
} else { } else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "",
num.parse(widget.selectedInstallmentPlan), appo); int.parse(widget.selectedInstallmentPlan!), appo);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -341,7 +341,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
markAppointmentForTamara(AppoitmentAllHistoryResultList appo) { markAppointmentForTamara(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
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);
getAppoQR(context); getAppoQR(context);
// autoGenerateInvoiceTamara(appo); // autoGenerateInvoiceTamara(appo);
@ -363,7 +363,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
"AppointmentDate": appo.appointmentDate.toString(), "AppointmentDate": appo.appointmentDate.toString(),
}; };
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.autoGenerateInvoiceTamara(appo.projectID, appo.appointmentNo.toString(), projectViewModel.user.mobileNumber).then((res) { service.autoGenerateInvoiceTamara(appo.projectID!, appo.appointmentNo.toString(), projectViewModel.user!.mobileNumber!).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
getAppoQR(context); getAppoQR(context);
}).catchError((err) { }).catchError((err) {
@ -376,7 +376,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
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) {
print("Printing Payment Status Reponse!!!!"); print("Printing Payment Status Reponse!!!!");
print(res); print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
@ -403,7 +403,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
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) {
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,
@ -429,7 +429,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
getAppoQR(context) { getAppoQR(context) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(widget.patientShareResponse, context).then((res) { service.generateAppointmentQR(widget.patientShareResponse!, context).then((res) {
print(res); print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR']); navigateToQR(context, res['AppointmentQR']);

@ -30,7 +30,7 @@ class _AddMember extends State<AddMember> {
final util = Utils(); final util = Utils();
final nationalIDorFile = TextEditingController(); final nationalIDorFile = TextEditingController();
final int loginType = AddFamilyMemberType.loginType; final int loginType = AddFamilyMemberType.loginType;
String mobileNo; String? mobileNo;
String countryCode = '966'; String countryCode = '966';
bool isButtonDisabled = true; bool isButtonDisabled = true;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
@ -58,7 +58,7 @@ class _AddMember extends State<AddMember> {
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(21.0), padding: EdgeInsets.all(21.0),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight! * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -117,7 +117,7 @@ class _AddMember extends State<AddMember> {
} }
void validateForm() { void validateForm() {
if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { if (util.validateIDBox(nationalIDorFile.text, loginType) == true && mobileNo!.length >= 9 && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
setState(() { setState(() {
isButtonDisabled = false; isButtonDisabled = false;
}); });
@ -250,7 +250,7 @@ class _AddMember extends State<AddMember> {
}); });
} }
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,

@ -39,7 +39,7 @@ import 'package:provider/provider.dart';
class MyFamily extends StatefulWidget { class MyFamily extends StatefulWidget {
final bool isAppbarVisible; final bool isAppbarVisible;
Function onBackClick; VoidCallbackAction? onBackClick;
MyFamily({this.isAppbarVisible = true, this.onBackClick}); MyFamily({this.isAppbarVisible = true, this.onBackClick});
@ -52,15 +52,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
final familyFileProvider = FamilyFilesProvider(); final familyFileProvider = FamilyFilesProvider();
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
var userID; var userID;
TabController _tabController; late TabController _tabController;
int _tabIndex = 0; int _tabIndex = 0;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
AuthenticatedUser user; late AuthenticatedUser user;
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
var isVaiable = false; var isVaiable = false;
bool isSwitchUser = false; bool isSwitchUser = false;
@ -173,7 +173,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
familySharedRecordsList[index].patientName.toLowerCase().capitalizeFirstofEach, familySharedRecordsList[index].patientName!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.42), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.42),
), ),
Text( Text(
@ -181,7 +181,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.4, height: 16 / 10),
), ),
Text( Text(
familySharedRecordsList[index].age.toString() + ' ' + TranslationBase.of(context).years + ', ' + familySharedRecordsList[index].genderDescription, familySharedRecordsList[index].age.toString() + ' ' + TranslationBase.of(context).years + ', ' + familySharedRecordsList[index].genderDescription!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: isFemale ? Color(0xff5A282E) : Colors.white, letterSpacing: -0.4, height: 16 / 10),
), ),
], ],
@ -308,7 +308,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget pendingItemView(GetAllSharedRecordsByStatusList result) { Widget pendingItemView(GetAllSharedRecordsByStatusList result) {
return Row( return Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: rowText(result.patientName)), Expanded(flex: 3, child: rowText(result.patientName!)),
Expanded( Expanded(
flex: 1, flex: 1,
child: Align( child: Align(
@ -352,7 +352,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget sentItemView(GetAllSharedRecordsByStatusList result) { Widget sentItemView(GetAllSharedRecordsByStatusList result) {
return Row( return Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 2, child: rowText(result.patientName)), Expanded(flex: 2, child: rowText(result.patientName!)),
Expanded( Expanded(
flex: 1, flex: 1,
child: Row( child: Row(
@ -364,7 +364,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
), ),
child: Text( child: Text(
result.statusDescription != null ? result.statusDescription : "", result.statusDescription != null ? result.statusDescription! : "",
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
color: Colors.white, color: Colors.white,
@ -395,7 +395,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget approvedItemView(GetAllSharedRecordsByStatusList result) { Widget approvedItemView(GetAllSharedRecordsByStatusList result) {
return Row( return Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 4, child: rowText(result.patientName)), Expanded(flex: 4, child: rowText(result.patientName!)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Align( child: Align(
@ -555,7 +555,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
List<GetAllSharedRecordsByStatusList> sentRecordsList = []; List<GetAllSharedRecordsByStatusList> sentRecordsList = [];
Future getFamilyFiles() async { Future getFamilyFiles() async {
GetAllSharedRecordsByStatusResponse familySharedRecords; late GetAllSharedRecordsByStatusResponse familySharedRecords;
if (await sharedPref.getObject(FAMILY_FILE) != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) {
familySharedRecords = GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE)); familySharedRecords = GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE));
} }
@ -567,7 +567,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
sentRecordsList =[]; sentRecordsList =[];
familySharedRecordsList =[]; familySharedRecordsList =[];
familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) { familySharedRecords.getAllSharedRecordsByStatusList!.forEach((element) {
if (element.status == 3) { if (element.status == 3) {
familySharedRecordsList.add(element); familySharedRecordsList.add(element);
} }
@ -577,7 +577,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
pendingRecordsList =[]; pendingRecordsList =[];
GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest();
pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) { pendingAndApprovedRecords.getAllSharedRecordsByStatusList!.forEach((element) {
print(element.toJson()); print(element.toJson());
if (element.status == 2) { if (element.status == 2) {
pendingRecordsList.add(element); pendingRecordsList.add(element);

@ -9,19 +9,19 @@ import 'package:youtube_player_flutter/youtube_player_flutter.dart';
class NotificationsDetailsPage extends StatefulWidget { class NotificationsDetailsPage extends StatefulWidget {
final GetNotificationsResponseModel notification; final GetNotificationsResponseModel notification;
NotificationsDetailsPage({this.notification}); NotificationsDetailsPage({required this.notification});
@override @override
State<NotificationsDetailsPage> createState() => _NotificationsDetailsPageState(); State<NotificationsDetailsPage> createState() => _NotificationsDetailsPageState();
} }
class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> { class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
YoutubePlayerController _controller; late YoutubePlayerController _controller;
@override @override
void initState() { void initState() {
_controller = YoutubePlayerController( _controller = YoutubePlayerController(
initialVideoId: getVideoURL(), initialVideoId: getVideoURL()!,
flags: YoutubePlayerFlags( flags: YoutubePlayerFlags(
autoPlay: true, autoPlay: true,
mute: false, mute: false,
@ -47,10 +47,10 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
return monthName + ',${d.day},${d.year}, $hour'; return monthName + ',${d.day},${d.year}, $hour';
} }
String getVideoURL() { String? getVideoURL() {
if (widget.notification.videoURL != null && widget.notification.notificationType == "2") { if (widget.notification.videoURL != null && widget.notification.notificationType == "2") {
String videoId; String videoId;
videoId = YoutubePlayer.convertUrlToId(widget.notification.videoURL); videoId = YoutubePlayer.convertUrlToId(widget.notification.videoURL)!;
print(videoId); // BBAyRBTfsOU print(videoId); // BBAyRBTfsOU
return videoId; return videoId;
} }
@ -69,9 +69,9 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.notification.createdOn)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.notification.createdOn!)) +
" " + " " +
DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.notification.createdOn), false), DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.notification.createdOn!), false),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -88,10 +88,10 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
), ),
), ),
if (widget.notification.messageTypeData != null) if (widget.notification.messageTypeData != null)
if (widget.notification.messageTypeData.length != 0 && widget.notification.notificationType != "2") if (widget.notification.messageTypeData!.length != 0 && widget.notification.notificationType != "2")
Padding( Padding(
padding: const EdgeInsets.only(top: 18), padding: const EdgeInsets.only(top: 18),
child: Image.network(widget.notification.messageTypeData, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) { child: Image.network(widget.notification.messageTypeData!, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent? loadingProgress) {
if (loadingProgress == null) return child; if (loadingProgress == null) return child;
return Center( return Center(
child: SizedBox( child: SizedBox(
@ -104,7 +104,7 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
), ),
SizedBox(height: 18), SizedBox(height: 18),
Text( Text(
widget.notification.message.trim(), widget.notification.message!.trim(),
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -67,7 +67,7 @@ class NotificationsPage extends StatelessWidget {
} }
return InkWell( return InkWell(
onTap: () async { onTap: () async {
if (!model.notifications[index].isRead) { if (!model.notifications[index].isRead!) {
model.markAsRead(model.notifications[index].id); model.markAsRead(model.notifications[index].id);
} }
Navigator.push( Navigator.push(
@ -83,17 +83,17 @@ class NotificationsPage extends StatelessWidget {
width: double.infinity, width: double.infinity,
padding: EdgeInsets.fromLTRB(15.0, 14, 21, 12), padding: EdgeInsets.fromLTRB(15.0, 14, 21, 12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), color: model.notifications[index].isRead! ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05),
border: projectViewModel.isArabic border: projectViewModel.isArabic
? Border( ? Border(
right: BorderSide( right: BorderSide(
color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, color: model.notifications[index].isRead! ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor,
width: 6.0, width: 6.0,
), ),
) )
: Border( : Border(
left: BorderSide( left: BorderSide(
color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, color: model.notifications[index].isRead! ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor,
width: 6.0, width: 6.0,
), ),
), ),
@ -105,9 +105,9 @@ class NotificationsPage extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn!)) +
" " + " " +
DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false), DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn!), false),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -125,7 +125,7 @@ class NotificationsPage extends StatelessWidget {
), ),
SizedBox(height: 4), SizedBox(height: 4),
Text( Text(
model.notifications[index].message.trim(), model.notifications[index].message!.trim(),
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -19,7 +19,7 @@ class AmbulanceReq extends StatefulWidget {
} }
class _AmbulanceReqState extends State<AmbulanceReq> with SingleTickerProviderStateMixin { class _AmbulanceReqState extends State<AmbulanceReq> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
@override @override

@ -25,7 +25,7 @@ import 'Summary.dart';
class AmbulanceRequestIndexPage extends StatefulWidget { class AmbulanceRequestIndexPage extends StatefulWidget {
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); AmbulanceRequestIndexPage({Key? key, required this.amRequestViewModel});
@override @override
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState(); _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
@ -33,16 +33,16 @@ class AmbulanceRequestIndexPage extends StatefulWidget {
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> { class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
int currentIndex = 0; int currentIndex = 0;
PageController pageController; late PageController pageController;
PatientER _patientER = PatientER(); PatientER _patientER = PatientER();
PatientER_RC _patientER_RC = PatientER_RC(); PatientER_RC _patientER_RC = PatientER_RC();
TransportationDetails transportationDetails = new TransportationDetails(); TransportationDetails transportationDetails = new TransportationDetails();
int status; late int status;
String _statusDisp; late String _statusDisp;
Color _color; late Color _color;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {
@ -65,8 +65,8 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder; AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder;
if(widget.amRequestViewModel.pendingAmbulanceRequestOrder != null) { if(widget.amRequestViewModel.pendingAmbulanceRequestOrder != null) {
int status = order.statusId; int status = order.statusId!;
_statusDisp = order.statusText; _statusDisp = order.statusText!;
if (status == 1) { if (status == 1) {
//pending //pending
_color = Color(0xffCC9B14); _color = Color(0xffCC9B14);
@ -147,7 +147,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
), ),
), ),
@ -162,7 +162,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
order.serviceText, order.serviceText!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
), ),
), ),
@ -182,7 +182,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
if (order.statusId == 1 || order.statusId == 2) if (order.statusId == 1 || order.statusId == 2)
InkWell( InkWell(
onTap: () { onTap: () {
showConfirmMessage(widget.amRequestViewModel, order.iD, context); showConfirmMessage(widget.amRequestViewModel, order.iD!, context);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -220,7 +220,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
Text( Text(
order.pickupLocation.trim().toString(), order.pickupLocation!.trim().toString(),
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),
), ),
], ],
@ -252,7 +252,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
Text( Text(
order.dropOffLocation.trim().toString(), order.dropOffLocation!.trim().toString(),
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),
), ),
], ],

@ -15,7 +15,7 @@ class BillAmount extends StatefulWidget {
final PatientER_RC patientER_RC; final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
BillAmount({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); BillAmount({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel});
@override @override
_BillAmountState createState() => _BillAmountState(); _BillAmountState createState() => _BillAmountState();
@ -68,12 +68,12 @@ class _BillAmountState extends State<BillAmount> {
child: _getNormalText(TranslationBase.of(context).patientShareToDo), child: _getNormalText(TranslationBase.of(context).patientShareToDo),
), ),
Expanded( Expanded(
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}', isBold: true), child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.price}', isBold: true),
) )
], ],
), ),
), ),
mDivider(Colors.grey[200]), mDivider(Colors.grey[200]!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3), padding: EdgeInsets.only(top: 3, bottom: 3),
@ -83,12 +83,12 @@ class _BillAmountState extends State<BillAmount> {
child: _getNormalText(TranslationBase.of(context).patientTaxToDo), child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
), ),
Expanded( Expanded(
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}', isBold: true), child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.priceVAT}', isBold: true),
) )
], ],
), ),
), ),
mDivider(Colors.grey[200]), mDivider(Colors.grey[200]!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3), padding: EdgeInsets.only(top: 3, bottom: 3),
@ -98,7 +98,7 @@ class _BillAmountState extends State<BillAmount> {
child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo), child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
), ),
Expanded( Expanded(
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true), child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}', isBold: true, isTotal: true),
) )
], ],
), ),
@ -133,7 +133,7 @@ class _BillAmountState extends State<BillAmount> {
groupValue: _ambulate, groupValue: _ambulate,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value!;
}); });
}, },
), ),
@ -171,7 +171,7 @@ class _BillAmountState extends State<BillAmount> {
groupValue: _ambulate, groupValue: _ambulate,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value!;
}); });
}, },
), ),
@ -209,7 +209,7 @@ class _BillAmountState extends State<BillAmount> {
groupValue: _ambulate, groupValue: _ambulate,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value!;
}); });
}, },
), ),
@ -247,7 +247,7 @@ class _BillAmountState extends State<BillAmount> {
groupValue: _ambulate, groupValue: _ambulate,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value!;
}); });
}, },
), ),
@ -299,9 +299,9 @@ class _BillAmountState extends State<BillAmount> {
TranslationBase.of(context).next, TranslationBase.of(context).next,
() { () {
setState(() { setState(() {
widget.patientER_RC.transportationDetails.ambulate = _ambulate.selectAmbulateNumber(); widget.patientER_RC.transportationDetails!.ambulate = _ambulate.selectAmbulateNumber();
widget.patientER_RC.transportationDetails.ambulateTitle = _ambulate.getAmbulateTitle(context); widget.patientER_RC.transportationDetails!.ambulateTitle = _ambulate.getAmbulateTitle(context);
widget.patientER_RC.transportationDetails.notes = note; widget.patientER_RC.transportationDetails!.notes = note;
// widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); // widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3); widget.changeCurrentTab(3);
}); });

@ -32,7 +32,7 @@ class PickupLocation extends StatefulWidget {
final PatientER_RC patientER_RC; final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
PickupLocation({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); PickupLocation({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel});
@override @override
_PickupLocationState createState() => _PickupLocationState(); _PickupLocationState createState() => _PickupLocationState();
@ -44,11 +44,11 @@ class _PickupLocationState extends State<PickupLocation> {
// double _latitude; // double _latitude;
// double _longitude; // double _longitude;
AppoitmentAllHistoryResultList myAppointment; late AppoitmentAllHistoryResultList myAppointment;
HospitalsModel _selectedHospital; late HospitalsModel _selectedHospital;
LocationDetails _result; late LocationDetails _result;
LocationUtils locationUtils; late LocationUtils locationUtils;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -81,7 +81,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (widget.patientER_RC.transportationDetails.direction == 0) if (widget.patientER_RC.transportationDetails!.direction == 0)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -175,7 +175,7 @@ class _PickupLocationState extends State<PickupLocation> {
value: _isInsideHome, value: _isInsideHome,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_isInsideHome = value; _isInsideHome = value!;
}); });
}, },
), ),
@ -223,7 +223,7 @@ class _PickupLocationState extends State<PickupLocation> {
if (myAppointment == null) { if (myAppointment == null) {
getAppointment(); getAppointment();
setState(() { setState(() {
_haveAppointment = value; _haveAppointment = value!;
}); });
} }
}, },
@ -247,7 +247,7 @@ class _PickupLocationState extends State<PickupLocation> {
onTap: () { onTap: () {
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
myAppointment = null; myAppointment = AppoitmentAllHistoryResultList();
}); });
}, },
child: Container( child: Container(
@ -260,8 +260,8 @@ class _PickupLocationState extends State<PickupLocation> {
groupValue: _haveAppointment, groupValue: _haveAppointment,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_haveAppointment = value; _haveAppointment = value!;
myAppointment = null; myAppointment = AppoitmentAllHistoryResultList();
}); });
}, },
), ),
@ -290,16 +290,16 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
DoctorCard( DoctorCard(
isInOutPatient: myAppointment.isInOutPatient, isInOutPatient: myAppointment.isInOutPatient,
name: myAppointment.doctorTitle + " " + myAppointment.doctorNameObj, name: myAppointment.doctorTitle! + " " + myAppointment.doctorNameObj!,
profileUrl: myAppointment.doctorImageURL, profileUrl: myAppointment.doctorImageURL,
subName: myAppointment.clinicName, subName: myAppointment.clinicName,
isLiveCareAppointment: myAppointment.isLiveCareAppointment, isLiveCareAppointment: myAppointment.isLiveCareAppointment,
date: DateUtil.convertStringToDate(myAppointment.appointmentDate), date: DateUtil.convertStringToDate(myAppointment.appointmentDate!),
isSortByClinic: false, isSortByClinic: false,
rating: myAppointment.actualDoctorRate + 0.0, rating: myAppointment.actualDoctorRate! + 0.0,
appointmentTime: myAppointment.isLiveCareAppointment appointmentTime: myAppointment.isLiveCareAppointment!
? DateUtil.convertStringToDate(myAppointment.appointmentDate).toString().split(" ")[1].substring(0, 5) ? DateUtil.convertStringToDate(myAppointment.appointmentDate!).toString().split(" ")[1].substring(0, 5)
: myAppointment.startTime.substring(0, 5), : myAppointment.startTime!.substring(0, 5),
remainingTimeInMinutes: null), remainingTimeInMinutes: null),
], ],
), ),
@ -361,7 +361,7 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
], ],
), ),
if (widget.patientER_RC.transportationDetails.direction == 1) if (widget.patientER_RC.transportationDetails!.direction == 1)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -517,52 +517,52 @@ class _PickupLocationState extends State<PickupLocation> {
AppToast.showErrorToast(message: TranslationBase.of(context).selectAll); AppToast.showErrorToast(message: TranslationBase.of(context).selectAll);
else else
setState(() { setState(() {
widget.patientER_RC.transportationDetails.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER_RC.transportationDetails.direction == 0) { if (widget.patientER_RC.transportationDetails!.direction == 0) {
// To Hospital // To Hospital
widget.patientER_RC.transportationDetails.dropoffLatitude = _result.lat.toStringAsFixed(6); widget.patientER_RC.transportationDetails!.dropoffLatitude = _result.lat.toStringAsFixed(6);
widget.patientER_RC.transportationDetails.dropoffLongitude = _result.long.toStringAsFixed(6); widget.patientER_RC.transportationDetails!.dropoffLongitude = _result.long.toStringAsFixed(6);
widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude; widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital.latitude;
widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude; widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital.longitude;
} else { } else {
// From Hospital // From Hospital
widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude; widget.patientER_RC.transportationDetails!.pickupLatitude = _selectedHospital.latitude;
widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude; widget.patientER_RC.transportationDetails!.pickupLongitude = _selectedHospital.longitude;
widget.patientER_RC.transportationDetails.dropoffLatitude = _result.lat.toStringAsFixed(6); widget.patientER_RC.transportationDetails!.dropoffLatitude = _result.lat.toStringAsFixed(6);
widget.patientER_RC.transportationDetails.dropoffLongitude = _result.long.toStringAsFixed(6); widget.patientER_RC.transportationDetails!.dropoffLongitude = _result.long.toStringAsFixed(6);
} }
widget.patientER_RC.transportationDetails.dropoffLocationName = widget.patientER_RC.transportationDetails.direction == 1 ? _result.formattedAddress : _selectedHospital.name; widget.patientER_RC.transportationDetails!.dropoffLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _result.formattedAddress : _selectedHospital.name;
widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user!.patientIdentificationNo;
widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); widget.patientER_RC.transportationDetails!.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER_RC.transportationDetails.direction == 1 ? _selectedHospital.name : _result.formattedAddress; widget.patientER_RC.transportationDetails!.pickupLocationName = widget.patientER_RC.transportationDetails!.direction == 1 ? _selectedHospital.name : _result.formattedAddress;
widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID; widget.patientER_RC.projectID = widget.amRequestViewModel.user!.projectID;
widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID; widget.patientER_RC.patientID = widget.amRequestViewModel.user!.patientID;
widget.patientER_RC.transportationDetails.requesterIsOutSA = false; widget.patientER_RC.transportationDetails!.requesterIsOutSA = false;
widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; widget.patientER_RC.transportationDetails!.requesterMobileNo = widget.amRequestViewModel.user!.mobileNumber;
widget.patientER_RC.transportationDetails.requesterFileNo = widget.amRequestViewModel.user.patientID; widget.patientER_RC.transportationDetails!.requesterFileNo = widget.amRequestViewModel.user!.patientID;
if (_haveAppointment == HaveAppointment.YES) { if (_haveAppointment == HaveAppointment.YES) {
widget.patientER_RC.transportationDetails.appointmentNo = myAppointment.appointmentNo.toString(); widget.patientER_RC.transportationDetails!.appointmentNo = myAppointment.appointmentNo.toString();
widget.patientER_RC.transportationDetails.appointmentClinicName = myAppointment.clinicName; widget.patientER_RC.transportationDetails!.appointmentClinicName = myAppointment.clinicName;
widget.patientER_RC.transportationDetails.appointmentDoctorName = myAppointment.doctorNameObj; widget.patientER_RC.transportationDetails!.appointmentDoctorName = myAppointment.doctorNameObj;
widget.patientER_RC.transportationDetails.appointmentBranch = myAppointment.projectName; widget.patientER_RC.transportationDetails!.appointmentBranch = myAppointment.projectName;
widget.patientER_RC.transportationDetails.appointmentTime = myAppointment.appointmentDate; widget.patientER_RC.transportationDetails!.appointmentTime = myAppointment.appointmentDate;
widget.patientER_RC.transportationDetails.haveAppointment = 1; widget.patientER_RC.transportationDetails!.haveAppointment = 1;
widget.patientER_RC.transportationDetails.dropoffLatitude = myAppointment.latitude; widget.patientER_RC.transportationDetails!.dropoffLatitude = myAppointment.latitude;
widget.patientER_RC.transportationDetails.dropoffLongitude = myAppointment.longitude; widget.patientER_RC.transportationDetails!.dropoffLongitude = myAppointment.longitude;
widget.patientER_RC.transportationDetails.dropoffLocationName = myAppointment.projectName; widget.patientER_RC.transportationDetails!.dropoffLocationName = myAppointment.projectName;
} else { } else {
widget.patientER_RC.transportationDetails.appointmentNo = "0"; widget.patientER_RC.transportationDetails!.appointmentNo = "0";
widget.patientER_RC.transportationDetails.appointmentClinicName = ""; widget.patientER_RC.transportationDetails!.appointmentClinicName = "";
widget.patientER_RC.transportationDetails.appointmentDoctorName = ""; widget.patientER_RC.transportationDetails!.appointmentDoctorName = "";
widget.patientER_RC.transportationDetails.appointmentBranch = ""; widget.patientER_RC.transportationDetails!.appointmentBranch = "";
widget.patientER_RC.transportationDetails.appointmentTime = ""; widget.patientER_RC.transportationDetails!.appointmentTime = "";
widget.patientER_RC.transportationDetails.haveAppointment = 0; widget.patientER_RC.transportationDetails!.haveAppointment = 0;
} }
widget.patientER_RC.transportationDetails.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER_RC.transportationDetails!.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2); widget.changeCurrentTab(2);
}); });
}, },
@ -575,7 +575,7 @@ class _PickupLocationState extends State<PickupLocation> {
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,
@ -593,7 +593,7 @@ class _PickupLocationState extends State<PickupLocation> {
} }
String getHospitalName(String title) { String getHospitalName(String title) {
return _selectedHospital == null ? title : _selectedHospital.name; return _selectedHospital == null ? title : _selectedHospital.name!;
} }
String getSelectFromMapName(context) { String getSelectFromMapName(context) {

@ -21,7 +21,7 @@ class SelectTransportationMethod extends StatefulWidget {
final PatientER_RC patientER_RC; final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
SelectTransportationMethod({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); SelectTransportationMethod({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel});
@override @override
_SelectTransportationMethodState createState() => _SelectTransportationMethodState(); _SelectTransportationMethodState createState() => _SelectTransportationMethodState();
@ -46,10 +46,10 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
// } // }
//RC API Revamp //RC API Revamp
if (widget.patientER_RC.transportationDetails.direction != null) { if (widget.patientER_RC.transportationDetails!.direction != null) {
_direction = widget.patientER_RC.transportationDetails.direction == 0 ? Direction.ToHospital : Direction.FromHospital; _direction = widget.patientER_RC.transportationDetails!.direction == 0 ? Direction.ToHospital : Direction.FromHospital;
_way = widget.patientER_RC.transportationDetails.tripType == 1 ? Way.OneWay : Way.TwoWays; _way = widget.patientER_RC.transportationDetails!.tripType == 1 ? Way.OneWay : Way.TwoWays;
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER_RC.transportationDetails.ambulate - 1)]; _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER_RC.transportationDetails!.ambulate! - 1)];
} else { } else {
if (widget.amRequestViewModel.amRequestModeList.length != 0) _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[widget.amRequestViewModel.amRequestModeList.length - 1]; if (widget.amRequestViewModel.amRequestModeList.length != 0) _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[widget.amRequestViewModel.amRequestModeList.length - 1];
} }
@ -101,13 +101,13 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _erTransportationMethod, groupValue: _erTransportationMethod,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_erTransportationMethod = value; _erTransportationMethod = value!;
}); });
}, },
), ),
Flexible( Flexible(
child: Text( child: Text(
projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text, projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN! : widget.amRequestViewModel.amRequestModeList[index].text!,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -166,7 +166,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _direction, groupValue: _direction,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_direction = value; _direction = value!;
}); });
}, },
), ),
@ -200,7 +200,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _direction, groupValue: _direction,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_direction = value; _direction = value!;
}); });
}, },
), ),
@ -251,7 +251,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _way, groupValue: _way,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_way = value; _way = value!;
}); });
}, },
), ),
@ -284,7 +284,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _way, groupValue: _way,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_way = value; _way = value!;
}); });
}, },
), ),
@ -336,12 +336,12 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
// widget.changeCurrentTab(1); // widget.changeCurrentTab(1);
// widget.patientER_RC.transportationDetails.id = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); // widget.patientER_RC.transportationDetails.id = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 0 : 1; widget.patientER_RC.transportationDetails!.direction = _direction == Direction.ToHospital ? 0 : 1;
widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1; widget.patientER_RC.transportationDetails!.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); widget.patientER_RC.transportationDetails!.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.iD.toString(); widget.patientER_RC.transportationDetails!.transportationType = _erTransportationMethod.iD.toString();
widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod; widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod;
widget.patientER_RC.transportationDetails.pickupUrgency = 1; widget.patientER_RC.transportationDetails!.pickupUrgency = 1;
// widget.patientER.orderServiceID = _orderService.getIdOrderService(); // widget.patientER.orderServiceID = _orderService.getIdOrderService();
// widget.patientER.lineItemNo = 1; // widget.patientER.lineItemNo = 1;
// widget.patientER.cost = _erTransportationMethod.price.toDouble(); // widget.patientER.cost = _erTransportationMethod.price.toDouble();

@ -16,7 +16,7 @@ class Summary extends StatefulWidget {
final PatientER_RC patientER_RC; final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
Summary({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel}); Summary({Key? key, required this.changeCurrentTab, required this.patientER, required this.patientER_RC, required this.amRequestViewModel});
@override @override
_SummaryState createState() => _SummaryState(); _SummaryState createState() => _SummaryState();
@ -50,11 +50,11 @@ class _SummaryState extends State<Summary> {
_getNormalText(TranslationBase.of(context).transportMethod), _getNormalText(TranslationBase.of(context).transportMethod),
projectViewModel.isArabic projectViewModel.isArabic
? _getNormalText( ? _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.textN}', '${widget.patientER_RC.patientERTransportationMethod!.textN}',
isBold: true, isBold: true,
) )
: _getNormalText( : _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.text}', '${widget.patientER_RC.patientERTransportationMethod!.text}',
isBold: true, isBold: true,
), ),
SizedBox( SizedBox(
@ -62,7 +62,7 @@ class _SummaryState extends State<Summary> {
), ),
_getNormalText(TranslationBase.of(context).directions), _getNormalText(TranslationBase.of(context).directions),
_getNormalText( _getNormalText(
widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital, widget.patientER_RC.transportationDetails!.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital,
isBold: true, isBold: true,
), ),
SizedBox( SizedBox(
@ -72,7 +72,7 @@ class _SummaryState extends State<Summary> {
TranslationBase.of(context).pickupLocation, TranslationBase.of(context).pickupLocation,
), ),
_getNormalText( _getNormalText(
'${widget.patientER_RC.transportationDetails.pickupLocationName}', '${widget.patientER_RC.transportationDetails!.pickupLocationName}',
isBold: true, isBold: true,
), ),
SizedBox( SizedBox(
@ -80,7 +80,7 @@ class _SummaryState extends State<Summary> {
), ),
_getNormalText(TranslationBase.of(context).dropoffLocation), _getNormalText(TranslationBase.of(context).dropoffLocation),
_getNormalText( _getNormalText(
'${widget.patientER_RC.transportationDetails.dropoffLocationName}', '${widget.patientER_RC.transportationDetails!.dropoffLocationName}',
isBold: true, isBold: true,
), ),
SizedBox( SizedBox(
@ -88,7 +88,7 @@ class _SummaryState extends State<Summary> {
), ),
_getNormalText(TranslationBase.of(context).selectAmbulate), _getNormalText(TranslationBase.of(context).selectAmbulate),
_getNormalText( _getNormalText(
'${widget.patientER_RC.transportationDetails.ambulateTitle}', '${widget.patientER_RC.transportationDetails!.ambulateTitle}',
isBold: true, isBold: true,
), ),
SizedBox( SizedBox(
@ -96,7 +96,7 @@ class _SummaryState extends State<Summary> {
), ),
_getNormalText(TranslationBase.of(context).notes), _getNormalText(TranslationBase.of(context).notes),
_getNormalText( _getNormalText(
'${widget.patientER_RC.transportationDetails.notes ?? '---'}', '${widget.patientER_RC.transportationDetails!.notes ?? '---'}',
isBold: true, isBold: true,
), ),
SizedBox( SizedBox(
@ -122,7 +122,7 @@ class _SummaryState extends State<Summary> {
_getNormalText(TranslationBase.of(context).patientShareTotal + ':'), _getNormalText(TranslationBase.of(context).patientShareTotal + ':'),
Container( Container(
padding: EdgeInsets.only(left: 20.0, right: 20.0), padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true) child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}', isBold: true, isTotal: true)
), ),
], ],
), ),

@ -9,7 +9,7 @@ import 'package:flutter/material.dart';
class AvailableAppointmentsPage extends StatelessWidget { class AvailableAppointmentsPage extends StatelessWidget {
final List<AppoitmentAllHistoryResultList> appointmentsAllHistoryList; final List<AppoitmentAllHistoryResultList> appointmentsAllHistoryList;
const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList}) : super(key: key); const AvailableAppointmentsPage({Key? key, required this.appointmentsAllHistoryList}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,16 +36,16 @@ class AvailableAppointmentsPage extends StatelessWidget {
}, },
child: DoctorCard( child: DoctorCard(
isInOutPatient: appointmentsAllHistoryList[index].isInOutPatient, isInOutPatient: appointmentsAllHistoryList[index].isInOutPatient,
name: appointmentsAllHistoryList[index].doctorTitle + " " + appointmentsAllHistoryList[index].doctorNameObj, name: appointmentsAllHistoryList[index].doctorTitle! + " " + appointmentsAllHistoryList[index].doctorNameObj!,
profileUrl: appointmentsAllHistoryList[index].doctorImageURL, profileUrl: appointmentsAllHistoryList[index].doctorImageURL,
subName: appointmentsAllHistoryList[index].clinicName, subName: appointmentsAllHistoryList[index].clinicName,
isLiveCareAppointment: appointmentsAllHistoryList[index].isLiveCareAppointment, isLiveCareAppointment: appointmentsAllHistoryList[index].isLiveCareAppointment,
date: DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate), date: DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate!),
isSortByClinic: false, isSortByClinic: false,
rating: appointmentsAllHistoryList[index].actualDoctorRate + 0.0, rating: appointmentsAllHistoryList[index].actualDoctorRate! + 0.0,
appointmentTime: appointmentsAllHistoryList[index].isLiveCareAppointment appointmentTime: appointmentsAllHistoryList[index].isLiveCareAppointment!
? DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate).toString().split(" ")[1].substring(0, 5) ? DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate!).toString().split(" ")[1].substring(0, 5)
: appointmentsAllHistoryList[index].startTime.substring(0, 5), : appointmentsAllHistoryList[index].startTime!.substring(0, 5),
remainingTimeInMinutes: null), remainingTimeInMinutes: null),
), ),
) )

@ -17,7 +17,7 @@ class DdServicesPage extends StatefulWidget {
} }
class _DdServicesPageState extends State<DdServicesPage> { class _DdServicesPageState extends State<DdServicesPage> {
PageController pageController; late PageController pageController;
bool isAgree = false; bool isAgree = false;
TriageInformationRequest triageInformationRequest = new TriageInformationRequest(); TriageInformationRequest triageInformationRequest = new TriageInformationRequest();
@ -62,7 +62,7 @@ class _DdServicesPageState extends State<DdServicesPage> {
EdOnlineQuestionsPage( EdOnlineQuestionsPage(
changePageViewIndex: _changePageViewIndex, changePageViewIndex: _changePageViewIndex,
selectedQuestions: selectedQuestions, selectedQuestions: selectedQuestions,
selectedHospital: triageInformationRequest.selectedHospital, selectedHospital: triageInformationRequest.selectedHospital!,
), ),
EdOnlineNotesPage( EdOnlineNotesPage(
changePageViewIndex: _changePageViewIndex, changePageViewIndex: _changePageViewIndex,
@ -70,7 +70,7 @@ class _DdServicesPageState extends State<DdServicesPage> {
triageInformationRequest: triageInformationRequest, triageInformationRequest: triageInformationRequest,
), ),
EdPaymentInformationPage( EdPaymentInformationPage(
selectedHospital: triageInformationRequest.selectedHospital, selectedHospital: triageInformationRequest.selectedHospital!,
) )
], ],
), ),

@ -7,10 +7,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class EdOnlineAgreementPage extends StatefulWidget { class EdOnlineAgreementPage extends StatefulWidget {
final HospitalsModel selectedHospital; final HospitalsModel? selectedHospital;
final Function changePageViewIndex; final Function? changePageViewIndex;
bool isAgree; bool isAgree;
EdOnlineAgreementPage({Key key, this.selectedHospital, this.changePageViewIndex,this.isAgree}) : super(key: key); EdOnlineAgreementPage({Key? key, this.selectedHospital, this.changePageViewIndex,required this.isAgree}) : super(key: key);
@override @override
_EdOnlineAgreementPageState createState() => _EdOnlineAgreementPageState(); _EdOnlineAgreementPageState createState() => _EdOnlineAgreementPageState();
@ -38,7 +38,7 @@ class _EdOnlineAgreementPageState extends State<EdOnlineAgreementPage> {
Checkbox( Checkbox(
value: widget.isAgree, value: widget.isAgree,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
widget.isAgree = !widget.isAgree; widget.isAgree = !widget.isAgree;
}); });
@ -72,7 +72,7 @@ class _EdOnlineAgreementPageState extends State<EdOnlineAgreementPage> {
textColor: Colors.white, textColor: Colors.white,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).back.toUpperCase(), label: TranslationBase.of(context).back.toUpperCase(),
onTap: () => widget.changePageViewIndex(0), onTap: () => widget.changePageViewIndex!(0),
), ),
), ),
), ),
@ -85,7 +85,7 @@ class _EdOnlineAgreementPageState extends State<EdOnlineAgreementPage> {
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).next.toUpperCase(), label: TranslationBase.of(context).next.toUpperCase(),
disabled: !widget.isAgree, disabled: !widget.isAgree,
onTap: () => widget.changePageViewIndex(2), onTap: () => widget.changePageViewIndex!(2),
), ),
), ),
), ),

@ -17,11 +17,11 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class EdOnlineNotesPage extends StatefulWidget { class EdOnlineNotesPage extends StatefulWidget {
final List<TriageQuestionsModel> selectedQuestions; final List<TriageQuestionsModel>? selectedQuestions;
final Function changePageViewIndex; final Function? changePageViewIndex;
TriageInformationRequest triageInformationRequest; TriageInformationRequest? triageInformationRequest;
EdOnlineNotesPage({Key key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest}); EdOnlineNotesPage({Key? key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest});
@override @override
_EdOnlineNotesPageState createState() => _EdOnlineNotesPageState(); _EdOnlineNotesPageState createState() => _EdOnlineNotesPageState();
@ -30,7 +30,7 @@ class EdOnlineNotesPage extends StatefulWidget {
class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> { class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
TextEditingController _chiefComplaintsTextController = TextEditingController(); TextEditingController _chiefComplaintsTextController = TextEditingController();
TextEditingController _noteTextController = TextEditingController(); TextEditingController _noteTextController = TextEditingController();
DateTime selectedTime; late DateTime selectedTime;
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
@override @override
@ -117,7 +117,7 @@ class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
textColor: Colors.white, textColor: Colors.white,
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).back.toUpperCase(), label: TranslationBase.of(context).back.toUpperCase(),
onTap: () => widget.changePageViewIndex(2), onTap: () => widget.changePageViewIndex!(2),
), ),
), ),
), ),
@ -133,21 +133,21 @@ class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
label: TranslationBase.of(context).save.toUpperCase(), label: TranslationBase.of(context).save.toUpperCase(),
disabled: selectedTime == null, disabled: selectedTime == null,
onTap: () async { onTap: () async {
if (_formKey.currentState.validate()) { if (_formKey.currentState!.validate()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model
.saveQuestionsInformation( .saveQuestionsInformation(
chiefComplaint: _chiefComplaintsTextController.text.toString(), chiefComplaint: _chiefComplaintsTextController.text.toString(),
notes: _noteTextController.text.toString(), notes: _noteTextController.text.toString(),
selectedQuestions: widget.selectedQuestions, selectedQuestions: widget.selectedQuestions,
projectId: widget.triageInformationRequest.projectID, projectId: widget.triageInformationRequest!.projectID!,
selectedTime: selectedTime) selectedTime: selectedTime)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) if (model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
else { else {
widget.changePageViewIndex(4); widget.changePageViewIndex!(4);
} }
}).catchError((onError) { }).catchError((onError) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -15,11 +15,11 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class EdOnlineQuestionsPage extends StatefulWidget { class EdOnlineQuestionsPage extends StatefulWidget {
final HospitalsModel selectedHospital; final HospitalsModel? selectedHospital;
final Function changePageViewIndex; final Function? changePageViewIndex;
List<TriageQuestionsModel> selectedQuestions; List<TriageQuestionsModel>? selectedQuestions;
EdOnlineQuestionsPage({Key key, this.selectedHospital, this.selectedQuestions, this.changePageViewIndex}); EdOnlineQuestionsPage({Key? key, this.selectedHospital, this.selectedQuestions, this.changePageViewIndex});
@override @override
_EdOnlineQuestionsPageState createState() => _EdOnlineQuestionsPageState(); _EdOnlineQuestionsPageState createState() => _EdOnlineQuestionsPageState();
@ -41,10 +41,10 @@ class _EdOnlineQuestionsPageState extends State<EdOnlineQuestionsPage> {
(index) => InkWell( (index) => InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) { if (widget.selectedQuestions!.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions.remove(model.triageQuestionsModelList[index]); widget.selectedQuestions!.remove(model.triageQuestionsModelList[index]);
} else { } else {
widget.selectedQuestions.add(model.triageQuestionsModelList[index]); widget.selectedQuestions!.add(model.triageQuestionsModelList[index]);
} }
}); });
}, },
@ -53,23 +53,23 @@ class _EdOnlineQuestionsPageState extends State<EdOnlineQuestionsPage> {
child: Row( child: Row(
children: [ children: [
Checkbox( Checkbox(
value: widget.selectedQuestions.contains(model.triageQuestionsModelList[index]), value: widget.selectedQuestions!.contains(model.triageQuestionsModelList[index]),
activeColor: Color(0xffD02127), activeColor: Color(0xffD02127),
tristate: false, tristate: false,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: (bool newValue) { onChanged: (bool? newValue) {
setState(() { setState(() {
if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) { if (widget.selectedQuestions!.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions.remove(model.triageQuestionsModelList[index]); widget.selectedQuestions!.remove(model.triageQuestionsModelList[index]);
} else { } else {
widget.selectedQuestions.add(model.triageQuestionsModelList[index]); widget.selectedQuestions!.add(model.triageQuestionsModelList[index]);
} }
}); });
}), }),
SizedBox(width: 6), SizedBox(width: 6),
Expanded( Expanded(
child: Text( child: Text(
model.triageQuestionsModelList[index].question, model.triageQuestionsModelList[index].question!,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
), ),
@ -107,7 +107,7 @@ class _EdOnlineQuestionsPageState extends State<EdOnlineQuestionsPage> {
disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12),
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
widget.changePageViewIndex(0); widget.changePageViewIndex!(0);
}, },
child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 16.0, color: Colors.white)), child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 16.0, color: Colors.white)),
), ),
@ -126,19 +126,19 @@ class _EdOnlineQuestionsPageState extends State<EdOnlineQuestionsPage> {
disabledForegroundColor: Color(0xFFbcc2c4).withOpacity(0.38), disabledForegroundColor: Color(0xFFbcc2c4).withOpacity(0.38),
disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12),
elevation: 0, elevation: 0,
onPressed: widget.selectedQuestions.isEmpty onPressed: widget.selectedQuestions!.isEmpty
? null ? null
: () { : () {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model
.saveQuestionsInformation( .saveQuestionsInformation(
chiefComplaint: "", notes: "", selectedQuestions: widget.selectedQuestions, projectId: widget.selectedHospital.iD, selectedTime: DateTime.now()) chiefComplaint: "", notes: "", selectedQuestions: widget.selectedQuestions, projectId: widget.selectedHospital!.iD, selectedTime: DateTime.now())
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) if (model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
else { else {
widget.changePageViewIndex(4); widget.changePageViewIndex!(4);
} }
}).catchError((onError) { }).catchError((onError) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -17,16 +17,16 @@ class EdOnlineSelectedHospitalPage extends StatefulWidget {
final Function changePageViewIndex; final Function changePageViewIndex;
TriageInformationRequest triageInformationRequest; TriageInformationRequest triageInformationRequest;
EdOnlineSelectedHospitalPage({Key key, this.changePageViewIndex, this.triageInformationRequest}) : super(key: key); EdOnlineSelectedHospitalPage({Key? key, required this.changePageViewIndex, required this.triageInformationRequest}) : super(key: key);
@override @override
_EdOnlineSelectedHospitalPageState createState() => _EdOnlineSelectedHospitalPageState(); _EdOnlineSelectedHospitalPageState createState() => _EdOnlineSelectedHospitalPageState();
} }
class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalPage> { class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalPage> {
HospitalsModel selectedProject; late HospitalsModel selectedProject;
final GlobalKey locationDropdownKey = GlobalKey(); final GlobalKey locationDropdownKey = GlobalKey();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
int _selected = 0; int _selected = 0;
@override @override
@ -83,13 +83,13 @@ class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalP
value: item, value: item,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(item.name + " - " + item.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_)], children: [Text(item.name! + " - " + item.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_)],
), ),
); );
}).toList(), }).toList(),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
selectedProject = newValue; selectedProject = newValue!;
widget.triageInformationRequest.selectedHospital = selectedProject; widget.triageInformationRequest.selectedHospital = selectedProject;
}); });
}, },
@ -160,9 +160,9 @@ class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalP
); );
} }
void onRadioChanged(int value) { void onRadioChanged(int? value) {
setState(() { setState(() {
_selected = value; _selected = value!;
}); });
} }
} }

@ -24,15 +24,15 @@ import 'package:provider/provider.dart';
class EdPaymentInformationPage extends StatefulWidget { class EdPaymentInformationPage extends StatefulWidget {
final HospitalsModel selectedHospital; final HospitalsModel selectedHospital;
const EdPaymentInformationPage({Key key, this.selectedHospital}) : super(key: key); const EdPaymentInformationPage({Key? key, required this.selectedHospital}) : super(key: key);
@override @override
_EdPaymentInformationPageState createState() => _EdPaymentInformationPageState(); _EdPaymentInformationPageState createState() => _EdPaymentInformationPageState();
} }
class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> { class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
MyInAppBrowser browser; late MyInAppBrowser browser;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
String transID = ""; String transID = "";
@override @override
@ -70,12 +70,12 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
child: _getNormalText(TranslationBase.of(context).patientShareToDo), child: _getNormalText(TranslationBase.of(context).patientShareToDo),
), ),
Expanded( Expanded(
child: _getNormalText(model.erPatientShareModel.patientShare.toStringAsFixed(2) ?? "0", isBold: true), child: _getNormalText(model.erPatientShareModel.patientShare!.toStringAsFixed(2) ?? "0", isBold: true),
) )
], ],
), ),
), ),
mDivider(Colors.grey[200]), mDivider(Colors.grey[200]!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3), padding: EdgeInsets.only(top: 3, bottom: 3),
@ -85,12 +85,12 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
child: _getNormalText(TranslationBase.of(context).patientTaxToDo), child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
), ),
Expanded( Expanded(
child: _getNormalText(model.erPatientShareModel.patientTaxAmount.toStringAsFixed(2) ?? "0", isBold: true), child: _getNormalText(model.erPatientShareModel.patientTaxAmount!.toStringAsFixed(2) ?? "0", isBold: true),
) )
], ],
), ),
), ),
mDivider(Colors.grey[200]), mDivider(Colors.grey[200]!),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3), padding: EdgeInsets.only(top: 3, bottom: 3),
@ -100,7 +100,7 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo), child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
), ),
Expanded( Expanded(
child: _getNormalText(model.erPatientShareModel.patientShareWithTax.toStringAsFixed(2) ?? "0", isBold: true), child: _getNormalText(model.erPatientShareModel.patientShareWithTax!.toStringAsFixed(2) ?? "0", isBold: true),
) )
], ],
), ),
@ -130,16 +130,16 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
TranslationBase.of(context).payNow.toUpperCase(), TranslationBase.of(context).payNow.toUpperCase(),
() { () {
Navigator.push(context, FadePage(page: PaymentMethod( Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {}); setState(() {});
}, patientShare: model.erPatientShareModel.patientShareWithTax, isFromAdvancePayment: true, }, patientShare: model.erPatientShareModel.patientShareWithTax!, isFromAdvancePayment: true,
))).then( ))).then(
(value) { (value) {
print(value); print(value);
if (value != null) { if (value != null) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.selectedHospital.iD; appo.projectID = widget.selectedHospital.iD;
openPayment(value[0], projectViewModel.user, model.erPatientShareModel.patientShareWithTax, appo); openPayment(value[0], projectViewModel.user!, model.erPatientShareModel.patientShareWithTax!, appo);
} }
}, },
); );
@ -166,9 +166,9 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user.patientID); transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user!.patientID!);
browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress!, paymentMethod, authenticatedUser.patientType,
authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context); authenticatedUser.firstName!, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {

@ -15,15 +15,15 @@ import 'NearestEr.dart';
class ErOptions extends StatefulWidget { class ErOptions extends StatefulWidget {
final bool isAppbar; final bool isAppbar;
const ErOptions({Key key, this.isAppbar}) : super(key: key); const ErOptions({Key? key, required this.isAppbar}) : super(key: key);
@override @override
_ErOptionsState createState() => _ErOptionsState(); _ErOptionsState createState() => _ErOptionsState();
} }
class _ErOptionsState extends State<ErOptions> { class _ErOptionsState extends State<ErOptions> {
LocationUtils locationUtils; late LocationUtils locationUtils;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {

@ -15,8 +15,8 @@ import '../../uitl/translations_delegate_base.dart';
class NearestEr extends StatefulWidget { class NearestEr extends StatefulWidget {
static const String _url = "assets/images/"; static const String _url = "assets/images/";
int appointmentNo; int? appointmentNo;
int projectID; int? projectID;
NearestEr({ this.appointmentNo, this.projectID}); NearestEr({ this.appointmentNo, this.projectID});
@ -27,8 +27,8 @@ class NearestEr extends StatefulWidget {
class _NearestErState extends State<NearestEr> { class _NearestErState extends State<NearestEr> {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList =[]; List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList =[];
bool isDataLoaded; late bool isDataLoaded;
LocationUtils locationUtils; late LocationUtils locationUtils;
@override @override
void initState() { void initState() {
@ -73,7 +73,7 @@ class _NearestErState extends State<NearestEr> {
location.locationName = projectAvgERWaitingTimeModelList[index].projectName; location.locationName = projectAvgERWaitingTimeModelList[index].projectName;
location.cityName = projectAvgERWaitingTimeModelList[index].projectName; location.cityName = projectAvgERWaitingTimeModelList[index].projectName;
location.projectImageURL = projectAvgERWaitingTimeModelList[index].projectImageURL; location.projectImageURL = projectAvgERWaitingTimeModelList[index].projectImageURL;
location.phoneNumber = projectAvgERWaitingTimeModelList[index].phoneNumber; location.phoneNumber = projectAvgERWaitingTimeModelList[index].phonenumber;
location.latitude = projectAvgERWaitingTimeModelList[index].latitude; location.latitude = projectAvgERWaitingTimeModelList[index].latitude;
location.longitude = projectAvgERWaitingTimeModelList[index].longitude; location.longitude = projectAvgERWaitingTimeModelList[index].longitude;
location.distanceInKilometers = projectAvgERWaitingTimeModelList[index].distanceInKilometers; location.distanceInKilometers = projectAvgERWaitingTimeModelList[index].distanceInKilometers;

@ -17,7 +17,7 @@ import 'package:provider/provider.dart';
class OrderLogPage extends StatelessWidget { class OrderLogPage extends StatelessWidget {
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
OrderLogPage({Key key, @required this.amRequestViewModel}); OrderLogPage({Key? key, required this.amRequestViewModel});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -56,9 +56,9 @@ class OrderLogPage extends StatelessWidget {
itemBuilder: (context, index) { itemBuilder: (context, index) {
AmbulanceRequestOrdersModel order = amRequestViewModel.patientAmbulanceRequestOrdersList.reversed.toList()[index]; AmbulanceRequestOrdersModel order = amRequestViewModel.patientAmbulanceRequestOrdersList.reversed.toList()[index];
int status = order.statusId; int status = order.statusId!;
String _statusDisp = order.statusText; String _statusDisp = order.statusText!;
Color _color; Color? _color;
if (status == 1) { if (status == 1) {
//pending //pending
_color = Color(0xffCC9B14); _color = Color(0xffCC9B14);
@ -130,7 +130,7 @@ class OrderLogPage extends StatelessWidget {
), ),
Expanded( Expanded(
child: Text( child: Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
), ),
), ),
@ -145,7 +145,7 @@ class OrderLogPage extends StatelessWidget {
), ),
Expanded( Expanded(
child: Text( child: Text(
order.serviceText, order.serviceText!,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
), ),
), ),
@ -165,7 +165,7 @@ class OrderLogPage extends StatelessWidget {
if (order.statusId == 1 || order.statusId == 2) if (order.statusId == 1 || order.statusId == 2)
InkWell( InkWell(
onTap: () { onTap: () {
showConfirmMessage(amRequestViewModel, order.iD, context); showConfirmMessage(amRequestViewModel, order.iD!, context);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -203,7 +203,7 @@ class OrderLogPage extends StatelessWidget {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
Text( Text(
order.pickupLocation.trim().toString(), order.pickupLocation!.trim().toString(),
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),
), ),
], ],
@ -235,7 +235,7 @@ class OrderLogPage extends StatelessWidget {
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
Text( Text(
order.dropOffLocation.trim().toString(), order.dropOffLocation!.trim().toString(),
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),
), ),
], ],

@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RRTAgreementPage extends StatelessWidget{ class RRTAgreementPage extends StatelessWidget{
TranslationBase localize; late TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -14,14 +14,14 @@ import 'package:flutter/material.dart';
class RRTLogPage extends StatefulWidget { class RRTLogPage extends StatefulWidget {
final List<GetCMCAllOrdersResponseModel> orders; final List<GetCMCAllOrdersResponseModel> orders;
const RRTLogPage({this.orders}); const RRTLogPage({required this.orders});
@override @override
State<StatefulWidget> createState() => RRTLogPageState(); State<StatefulWidget> createState() => RRTLogPageState();
} }
class RRTLogPageState extends State<RRTLogPage> { class RRTLogPageState extends State<RRTLogPage> {
RRTViewModel viewModel; late RRTViewModel viewModel;
@override @override
void initState() { void initState() {

@ -21,15 +21,15 @@ class RRTMainScreen extends StatefulWidget {
class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderStateMixin { class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderStateMixin {
int currentIndex = 0; int currentIndex = 0;
TabController tabController; late TabController tabController;
PageController pageController = PageController(initialPage: 0, keepPage: true); PageController pageController = PageController(initialPage: 0, keepPage: true);
RRTViewModel viewModel; late RRTViewModel viewModel;
bool loadingData; late bool loadingData;
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -38,7 +38,7 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderS
tabController = TabController(length: 2, vsync: this); tabController = TabController(length: 2, vsync: this);
} }
TranslationBase localize; late TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -127,7 +127,7 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderS
onPageChanged: onPageChanged, onPageChanged: onPageChanged,
controller: pageController, controller: pageController,
children: [ children: [
RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders, viewModel: viewModel), RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice!, pendingOrders: viewModel.rrtServiceData.pendingOrders, viewModel: viewModel),
RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), RRTLogPage(orders: viewModel.rrtServiceData.completedOrders),
], ],
); );

@ -17,27 +17,28 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5));
class RRTLogListItem extends StatefulWidget { class RRTLogListItem extends StatefulWidget {
final GetCMCAllOrdersResponseModel order; final GetCMCAllOrdersResponseModel? order;
final Function(GetCMCAllOrdersResponseModel) onCancel; final Function(GetCMCAllOrdersResponseModel)? onCancel;
RRTLogListItem(this.order, {this.onCancel}); RRTLogListItem(this.order, {this.onCancel});
@override @override
State<StatefulWidget> createState() => RRTLogListItemState(); State<StatefulWidget> createState() => RRTLogListItemState();
BuildContext _context; late BuildContext _context;
} }
class RRTLogListItemState extends State<RRTLogListItem> { class RRTLogListItemState extends State<RRTLogListItem> {
RRTViewModel viewModel; late RRTViewModel viewModel;
TranslationBase localize; late TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
int status = widget.order.statusId; int status = widget.order!.statusId!;
String _statusDisp = widget.order.statusText; String _statusDisp = widget.order!.statusText!;
Color _color; Color? _color;
if (status == 1) { if (status == 1) {
//pending //pending
_color = Color(0xffCC9B14); _color = Color(0xffCC9B14);
@ -100,7 +101,7 @@ class RRTLogListItemState extends State<RRTLogListItem> {
), ),
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
'${TranslationBase.of(context).requestID}: ${widget.order.iD}', '${TranslationBase.of(context).requestID}: ${widget.order!.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
// Row( // Row(
@ -127,7 +128,7 @@ class RRTLogListItemState extends State<RRTLogListItem> {
), ),
Expanded( Expanded(
child: Text( child: Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order!.created!)!),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
), ),
@ -141,11 +142,11 @@ class RRTLogListItemState extends State<RRTLogListItem> {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order.created)), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.order!.created!)!),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (widget.order.statusId == 1 || widget.order.statusId == 2) if (widget.order!.statusId == 1 || widget.order!.statusId == 2)
InkWell( InkWell(
onTap: () { onTap: () {
//onCancel(order); //onCancel(order);

@ -32,7 +32,7 @@ class RRTRequestPickupAddressPage extends StatefulWidget {
final ServicePrice servicePrice; final ServicePrice servicePrice;
final VidaProcedureList selectedProcedure; final VidaProcedureList selectedProcedure;
RRTRequestPickupAddressPage({@required this.servicePrice, @required this.selectedProcedure}); RRTRequestPickupAddressPage({required this.servicePrice, required this.selectedProcedure});
@override @override
State<StatefulWidget> createState() => RRTRequestPickupAddressPageState(); State<StatefulWidget> createState() => RRTRequestPickupAddressPageState();
@ -49,21 +49,21 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
zoom: 17, zoom: 17,
); );
LatLng currentPostion; late LatLng currentPostion;
List<AddressInfo> myAddresses = []; List<AddressInfo> myAddresses = [];
AddressInfo selectedAddress = new AddressInfo(); AddressInfo selectedAddress = new AddressInfo();
StreamController<int> addressStreamController = StreamController(); StreamController<int> addressStreamController = StreamController();
Stream<int> addressStream; late Stream<int> addressStream;
StreamController<int> addressLoadingStreamController = StreamController(); StreamController<int> addressLoadingStreamController = StreamController();
Stream<int> addressLoadingStream; late Stream<int> addressLoadingStream;
// AddressInfo _selectedAddress; // AddressInfo _selectedAddress;
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AppMap appMap; late AppMap appMap;
bool showCurrentLocation = false; bool showCurrentLocation = false;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
LocationUtils locationUtils; late LocationUtils locationUtils;
@override @override
void initState() { void initState() {
@ -72,9 +72,10 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
appMap = AppMap( appMap = AppMap(
cameraPosition.toMap(), cameraPosition.toMap() as Map<dynamic, dynamic>,
//Changed by Aamir
onCameraMove: (camera) { onCameraMove: (camera) {
_updatePosition(camera); _updatePosition(camera as CameraPosition);
}, },
onMapCreated: () { onMapCreated: () {
_getUserLocation(); _getUserLocation();
@ -83,7 +84,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
); );
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async { setLatitudeAndLongitude({bool isSetState = false, String? latLong}) async {
if (latLong == null) { if (latLong == null) {
if (myAddresses.isEmpty) { if (myAddresses.isEmpty) {
setState(() { setState(() {
@ -95,7 +96,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
} }
if (!showCurrentLocation) { if (!showCurrentLocation) {
List latLongArr = latLong.split(','); List latLongArr = latLong!.split(',');
latitude = double.parse(latLongArr[0]); latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]); longitude = double.parse(latLongArr[1]);
@ -121,8 +122,8 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
if (viewModel.addressesList.isNotEmpty) setState(() {}); if (viewModel.addressesList.isNotEmpty) setState(() {});
} }
TranslationBase localize; late TranslationBase localize;
RRTViewModel viewModel; late RRTViewModel viewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -245,7 +246,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
child: Container( child: Container(
width: size, width: size,
height: size, height: size,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), border: Border.all(width: 2, color: Theme.of(context).appBarTheme.color)), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20), border: Border.all(width: 2, color: Theme.of(context).appBarTheme.color!)),
child: Container(margin: EdgeInsets.all(margin), decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.circular(20))), child: Container(margin: EdgeInsets.all(margin), decoration: BoxDecoration(color: Theme.of(context).appBarTheme.color, borderRadius: BorderRadius.circular(20))),
), ),
); );
@ -287,7 +288,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
String getAddressName() { String getAddressName() {
if (selectedAddress != null && selectedAddress.address1 != null) if (selectedAddress != null && selectedAddress.address1 != null)
return selectedAddress.address1; return selectedAddress.address1!;
else else
return TranslationBase.of(context).selectAddress; return TranslationBase.of(context).selectAddress;
} }
@ -331,7 +332,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
} else { } else {
requestPermissions().then( requestPermissions().then(
(value) async { (value) async {
if (value[Permission.location].isGranted) { if (value[Permission.location]!.isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(locationSettings: locationSettings); var position = await GeolocatorPlatform.instance.getCurrentPosition(locationSettings: locationSettings);
currentPostion = LatLng(position.latitude, position.longitude); currentPostion = LatLng(position.latitude, position.longitude);
latitude = position.latitude; latitude = position.latitude;

@ -21,26 +21,26 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class RRTPlaceOrderPage extends StatelessWidget { class RRTPlaceOrderPage extends StatelessWidget {
TranslationBase localize; late TranslationBase localize;
RRTViewModel viewModel; RRTViewModel? viewModel;
AddressInfo selectedAddress; AddressInfo selectedAddress;
final ServicePrice servicePrice; final ServicePrice servicePrice;
final VidaProcedureList selectedProcedure; final VidaProcedureList selectedProcedure;
RRTPlaceOrderPage({@required this.selectedAddress, @required this.servicePrice, @required this.selectedProcedure}); RRTPlaceOrderPage({required this.selectedAddress, required this.servicePrice, required this.selectedProcedure});
TextEditingController noteController = TextEditingController(text: ''); TextEditingController noteController = TextEditingController(text: '');
BuildContext _context; late BuildContext _context;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
_context = context; _context = context;
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
var lat = selectedAddress.latLong.split(',').first; var lat = selectedAddress.latLong!.split(',').first;
var lng = selectedAddress.latLong.split(',').last; var lng = selectedAddress.latLong!.split(',').last;
return BaseView<RRTViewModel>( return BaseView<RRTViewModel>(
onModelReady: (vm) => viewModel = vm, onModelReady: (vm) => viewModel = vm,
@ -171,7 +171,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
} }
placeOrder() async { placeOrder() async {
if (selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong.isNotEmpty && selectedAddress.latLong.split(',').length > 1) { if (selectedAddress != null && selectedAddress.latLong != null && selectedAddress.latLong!.isNotEmpty && selectedAddress.latLong!.split(',').length > 1) {
GifLoaderDialogUtils.showMyDialog(_context); GifLoaderDialogUtils.showMyDialog(_context);
RRTRequestModel rrtRequestModel = new RRTRequestModel(); RRTRequestModel rrtRequestModel = new RRTRequestModel();
@ -179,7 +179,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
rrtRequestModel.procedures = []; rrtRequestModel.procedures = [];
Map<String, dynamic> params = {}; Map<String, dynamic> params = {};
var cordinates = selectedAddress.latLong.split(','); var cordinates = selectedAddress.latLong!.split(',');
var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last)); var latlng = LatLng(double.parse(cordinates.first), double.parse(cordinates.last));
procedures.serviceID = selectedProcedure.procedureID; procedures.serviceID = selectedProcedure.procedureID;
@ -187,12 +187,12 @@ class RRTPlaceOrderPage extends StatelessWidget {
rrtRequestModel.latitude = latlng.latitude; rrtRequestModel.latitude = latlng.latitude;
rrtRequestModel.longitude = latlng.longitude; rrtRequestModel.longitude = latlng.longitude;
rrtRequestModel.additionalDetails = noteController.text; rrtRequestModel.additionalDetails = noteController.text;
rrtRequestModel.nationality = projectViewModel.user.nationalityID; rrtRequestModel.nationality = projectViewModel.user!.nationalityID;
rrtRequestModel.paymentAmount = selectedProcedure.patientShareWithTax; rrtRequestModel.paymentAmount = selectedProcedure.patientShareWithTax;
rrtRequestModel.nearestProjectId = 0; rrtRequestModel.nearestProjectId = 0;
rrtRequestModel.patientId = projectViewModel.user.patientID; rrtRequestModel.patientId = projectViewModel.user!.patientID;
rrtRequestModel.patientOutSa = projectViewModel.user.outSA; rrtRequestModel.patientOutSa = projectViewModel.user!.outSA;
rrtRequestModel.procedures.add(procedures); rrtRequestModel.procedures!.add(procedures);
// params['latitude'] = latlng.latitude; // params['latitude'] = latlng.latitude;
// params['longitude'] = latlng.longitude; // params['longitude'] = latlng.longitude;
@ -201,7 +201,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
// params['paymentAmount'] = selectedProcedure.patientShareWithTax; // params['paymentAmount'] = selectedProcedure.patientShareWithTax;
// params['procedureId'] = selectedProcedure.procedureID; // params['procedureId'] = selectedProcedure.procedureID;
var requestId = await viewModel.createOrderRC(rrtRequestModel.toJson()); var requestId = await viewModel!.createOrderRC(rrtRequestModel.toJson());
GifLoaderDialogUtils.hideDialog(_context); GifLoaderDialogUtils.hideDialog(_context);
@ -234,9 +234,9 @@ class RRTPlaceOrderPage extends StatelessWidget {
} }
gotoRRTRoot() async { gotoRRTRoot() async {
viewModel.setState(ViewState.Busy); viewModel!.setState(ViewState.Busy);
await viewModel.getAllOrdersRC(); await viewModel!.getAllOrdersRC();
viewModel.setState(ViewState.Idle); viewModel!.setState(ViewState.Idle);
Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen));
Navigator.push(_context, FadePage(page: RRTMainScreen())); Navigator.push(_context, FadePage(page: RRTMainScreen()));
} }

@ -22,7 +22,7 @@ class RRTRequestPage extends StatefulWidget {
final ServicePrice servicePrice; final ServicePrice servicePrice;
RRTViewModel viewModel; RRTViewModel viewModel;
RRTRequestPage({this.pendingOrders, this.servicePrice, this.viewModel}); RRTRequestPage({required this.pendingOrders, required this.servicePrice, required this.viewModel});
@override @override
State<StatefulWidget> createState() => RRTRequestPageState(); State<StatefulWidget> createState() => RRTRequestPageState();
@ -30,7 +30,7 @@ class RRTRequestPage extends StatefulWidget {
class RRTRequestPageState extends State<RRTRequestPage> { class RRTRequestPageState extends State<RRTRequestPage> {
bool acceptTerms = false; bool acceptTerms = false;
VidaProcedureList selectedProcedure; late VidaProcedureList selectedProcedure;
@override @override
void initState() { void initState() {
@ -95,7 +95,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
toggleable: true, toggleable: true,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
selectedProcedure = value; selectedProcedure = value!;
print(selectedProcedure.procedureName); print(selectedProcedure.procedureName);
// getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); // getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
}); });
@ -104,7 +104,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
Expanded( Expanded(
child: Text( child: Text(
// projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName, // projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
widget.viewModel.rrtProcedureList[index].procedureName, widget.viewModel.rrtProcedureList[index].procedureName!,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -186,7 +186,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
); );
} }
Widget pricingRow({@required String label, @required String value, bool labelBold = false, bool valueBold = false}) { Widget pricingRow({required String label, required String value, bool labelBold = false, bool valueBold = false}) {
return Container( return Container(
height: 35, height: 35,
margin: EdgeInsets.symmetric(horizontal: 10), margin: EdgeInsets.symmetric(horizontal: 10),
@ -216,7 +216,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
Checkbox( Checkbox(
value: acceptTerms, value: acceptTerms,
onChanged: (v) { onChanged: (v) {
setState(() => acceptTerms = v); setState(() => acceptTerms = v!);
}), }),
SizedBox(width: 10), SizedBox(width: 10),
Expanded(child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 12, color: CustomColors.textColor), maxLines: 2)), Expanded(child: Text(TranslationBase.of(context).iAcceptTermsConditions, style: TextStyle(fontSize: 12, color: CustomColors.textColor), maxLines: 2)),

@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
class AppointmentCard extends StatelessWidget { class AppointmentCard extends StatelessWidget {
final AppoitmentAllHistoryResultList appointment; final AppoitmentAllHistoryResultList appointment;
const AppointmentCard({Key key, this.appointment}) : super(key: key); const AppointmentCard({Key? key, required this.appointment}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -22,8 +22,8 @@ class AppointmentCard extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
LargeAvatar( LargeAvatar(
url: appointment.doctorImageURL, url: appointment.doctorImageURL!,
name: appointment.doctorNameObj, name: appointment.doctorNameObj!,
), ),
Expanded( Expanded(
child: Padding( child: Padding(
@ -35,7 +35,7 @@ class AppointmentCard extends StatelessWidget {
SizedBox(height: 4,), SizedBox(height: 4,),
Texts(appointment.projectName), Texts(appointment.projectName),
Texts(appointment.clinicName), Texts(appointment.clinicName),
Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate))), Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate!))),
], ],
), ),
), ),

@ -10,7 +10,7 @@ class StepsWidget extends StatelessWidget {
final int index; final int index;
final Function changeCurrentTab; final Function changeCurrentTab;
StepsWidget({Key key, this.index, this.changeCurrentTab}); StepsWidget({Key? key, required this.index, required this.changeCurrentTab});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -287,7 +287,7 @@ class StepsWidget extends StatelessWidget {
// ); // );
} }
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) { Widget showProgress({required String title, required String status, required Color color, bool isNeedBorder = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -6,10 +6,10 @@ class ClippedVideo extends StatefulWidget {
final Widget child; final Widget child;
const ClippedVideo({ const ClippedVideo({
Key key, Key? key,
@required this.width, required this.width,
@required this.height, required this.height,
@required this.child, required this.child,
}) : super(key: key); }) : super(key: key);
@override @override

@ -5,28 +5,28 @@ import 'package:diplomaticquarterapp/pages/conference/widgets/circle_button.dart
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ConferenceButtonBar extends StatefulWidget { class ConferenceButtonBar extends StatefulWidget {
final VoidCallback onVideoEnabled; final VoidCallback? onVideoEnabled;
final VoidCallback onAudioEnabled; final VoidCallback? onAudioEnabled;
final VoidCallback onHangup; final VoidCallback? onHangup;
final VoidCallback onSwitchCamera; final VoidCallback? onSwitchCamera;
final VoidCallback onPersonAdd; final VoidCallback? onPersonAdd;
final VoidCallback onPersonRemove; final VoidCallback? onPersonRemove;
final void Function(double) onHeight; final void Function(double)? onHeight;
final VoidCallback onHide; final VoidCallback? onHide;
final VoidCallback onShow; final VoidCallback? onShow;
final Stream<bool> videoEnabled; final Stream<bool> videoEnabled;
final Stream<bool> audioEnabled; final Stream<bool> audioEnabled;
const ConferenceButtonBar({ const ConferenceButtonBar({
Key key, Key? key,
this.onVideoEnabled, this.onVideoEnabled,
this.onAudioEnabled, this.onAudioEnabled,
this.onHangup, this.onHangup,
this.onSwitchCamera, this.onSwitchCamera,
this.onPersonAdd, this.onPersonAdd,
this.onPersonRemove, this.onPersonRemove,
@required this.videoEnabled, required this.videoEnabled,
@required this.audioEnabled, required this.audioEnabled,
this.onHeight, this.onHeight,
this.onHide, this.onHide,
this.onShow, this.onShow,
@ -40,19 +40,19 @@ class ConferenceButtonBar extends StatefulWidget {
class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLayoutMixin<ConferenceButtonBar> { class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLayoutMixin<ConferenceButtonBar> {
var _bottom = -100.0; var _bottom = -100.0;
Timer _timer; late Timer _timer;
int _remaining; late int _remaining;
var _videoEnabled = true; var _videoEnabled = true;
var _audioEnabled = true; var _audioEnabled = true;
double _hidden; late double _hidden;
double _visible; late double _visible;
final _keyButtonBarHeight = GlobalKey(); final _keyButtonBarHeight = GlobalKey();
final Duration timeout = const Duration(seconds: 5); final Duration timeout = const Duration(seconds: 5);
final Duration ms = const Duration(milliseconds: 1); final Duration ms = const Duration(milliseconds: 1);
final Duration periodicDuration = const Duration(milliseconds: 100); final Duration periodicDuration = const Duration(milliseconds: 100);
Timer startTimeout([int milliseconds]) { Timer startTimeout([int? milliseconds]) {
final duration = milliseconds == null ? timeout : ms * milliseconds; final duration = milliseconds == null ? timeout : ms * milliseconds;
_remaining = duration.inMilliseconds; _remaining = duration.inMilliseconds;
return Timer.periodic(periodicDuration, (Timer timer) { return Timer.periodic(periodicDuration, (Timer timer) {
@ -69,7 +69,7 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
return; return;
} }
_timer.cancel(); _timer.cancel();
_timer = null; // _timer = null;
} }
void _resumeTimer() { void _resumeTimer() {
@ -85,10 +85,10 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
setState(() { setState(() {
_bottom = _bottom == _visible ? _hidden : _visible; _bottom = _bottom == _visible ? _hidden : _visible;
if (_bottom == _visible && widget.onShow != null) { if (_bottom == _visible && widget.onShow != null) {
widget.onShow(); widget.onShow!();
} }
if (_bottom == _hidden && widget.onHide != null) { if (_bottom == _hidden && widget.onHide != null) {
widget.onHide(); widget.onHide!();
} }
}); });
} }
@ -98,7 +98,7 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
if (_timer.isActive) { if (_timer.isActive) {
_timer.cancel(); _timer.cancel();
} }
_timer = null; // _timer = null;
} }
if (_bottom == 0) { if (_bottom == 0) {
_timer = startTimeout(); _timer = startTimeout();
@ -119,11 +119,11 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
@override @override
void afterFirstLayout(BuildContext context) { void afterFirstLayout(BuildContext context) {
final RenderBox renderBoxButtonBar = _keyButtonBarHeight.currentContext.findRenderObject(); final heightButtonBar = _keyButtonBarHeight.currentContext!.size!.height;
final heightButtonBar = renderBoxButtonBar.size.height; //Changed by Aamir
// Because the `didChangeDependencies` fires before the `afterFirstLayout`, we can use the `_visible` property here. // Because the `didChangeDependencies` fires before the `afterFirstLayout`, we can use the `_visible` property here.
_hidden = -(heightButtonBar + _visible); _hidden = -(heightButtonBar + _visible);
widget.onHeight(heightButtonBar); widget.onHeight!(heightButtonBar);
_toggleBar(); _toggleBar();
} }
@ -132,7 +132,7 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
super.dispose(); super.dispose();
if (_timer != null && _timer.isActive) { if (_timer != null && _timer.isActive) {
_timer.cancel(); _timer.cancel();
_timer = null;
} }
} }
@ -189,33 +189,33 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
stream: widget.videoEnabled, stream: widget.videoEnabled,
initialData: _videoEnabled, initialData: _videoEnabled,
builder: (context, snapshot) { builder: (context, snapshot) {
_videoEnabled = snapshot.data; _videoEnabled = snapshot.data!;
return Icon( return Icon(
_videoEnabled ? Icons.videocam : Icons.videocam_off, _videoEnabled ? Icons.videocam : Icons.videocam_off,
color: Colors.white, color: Colors.white,
); );
}), }),
key: Key('camera-button'), key: Key('camera-button'),
onPressed: () => _onPressed(widget.onVideoEnabled), onPressed: () => _onPressed(widget.onVideoEnabled!),
), ),
CircleButton( CircleButton(
child: StreamBuilder<bool>( child: StreamBuilder<bool>(
stream: widget.audioEnabled, stream: widget.audioEnabled,
initialData: _audioEnabled, initialData: _audioEnabled,
builder: (context, snapshot) { builder: (context, snapshot) {
_audioEnabled = snapshot.data; _audioEnabled = snapshot.data!;
return Icon( return Icon(
_audioEnabled ? Icons.mic : Icons.mic_off, _audioEnabled ? Icons.mic : Icons.mic_off,
color: Colors.white, color: Colors.white,
); );
}), }),
key: Key('microphone-button'), key: Key('microphone-button'),
onPressed: () => _onPressed(widget.onAudioEnabled), onPressed: () => _onPressed(widget.onAudioEnabled!),
), ),
CircleButton( CircleButton(
child: const Icon(Icons.switch_camera, color: Colors.white), child: const Icon(Icons.switch_camera, color: Colors.white),
key: Key('switch-camera-button'), key: Key('switch-camera-button'),
onPressed: () => _onPressed(widget.onSwitchCamera), onPressed: () => _onPressed(widget.onSwitchCamera!),
), ),
CircleButton( CircleButton(
radius: 35, radius: 35,
@ -229,7 +229,7 @@ class _ConferenceButtonBarState extends State<ConferenceButtonBar> with AfterLay
), ),
color: Colors.red.withAlpha(200), color: Colors.red.withAlpha(200),
key: Key('hangup-button'), key: Key('hangup-button'),
onPressed: () => _onPressed(widget.onHangup), onPressed: () => _onPressed(widget.onHangup!),
), ),
], ],
), ),

@ -12,11 +12,11 @@ class DraggablePublisher extends StatefulWidget {
final Stream<double> onButtonBarHeight; final Stream<double> onButtonBarHeight;
const DraggablePublisher({ const DraggablePublisher({
Key key, Key? key,
@required this.availableScreenSize, required this.availableScreenSize,
this.child, required this.child,
@required this.onButtonBarVisible, required this.onButtonBarVisible,
@required this.onButtonBarHeight, required this.onButtonBarHeight,
/// The portion of the screen the DraggableWidget should use. /// The portion of the screen the DraggableWidget should use.
this.scaleFactor = .25, this.scaleFactor = .25,
@ -33,18 +33,18 @@ class DraggablePublisher extends StatefulWidget {
class _DraggablePublisherState extends State<DraggablePublisher> { class _DraggablePublisherState extends State<DraggablePublisher> {
bool _isButtonBarVisible = true; bool _isButtonBarVisible = true;
double _buttonBarHeight = 0; double _buttonBarHeight = 0;
double _width; late double _width;
double _height; late double _height;
double _top; late double _top;
double _left; late double _left;
double _viewPaddingTop; late double _viewPaddingTop;
double _viewPaddingBottom; late double _viewPaddingBottom;
final double _padding = 8.0; final double _padding = 8.0;
final Duration _duration300ms = const Duration(milliseconds: 300); final Duration _duration300ms = const Duration(milliseconds: 300);
final Duration _duration0ms = const Duration(milliseconds: 0); final Duration _duration0ms = const Duration(milliseconds: 0);
Duration _duration; late Duration _duration;
StreamSubscription _streamSubscription; late StreamSubscription _streamSubscription;
StreamSubscription _streamHeightSubscription; late StreamSubscription _streamHeightSubscription;
@override @override
void initState() { void initState() {

@ -7,8 +7,8 @@ class ParticipantBuffer {
final String id; final String id;
ParticipantBuffer({ ParticipantBuffer({
@required this.audioEnabled, required this.audioEnabled,
@required this.id, required this.id,
}) : assert(audioEnabled != null), }) : assert(audioEnabled != null),
assert(id != null); assert(id != null);
} }
@ -23,12 +23,12 @@ class ParticipantWidget extends StatelessWidget {
final bool isDominant; final bool isDominant;
const ParticipantWidget({ const ParticipantWidget({
Key key, Key? key,
@required this.child, required this.child,
@required this.audioEnabled, required this.audioEnabled,
@required this.videoEnabled, required this.videoEnabled,
@required this.id, required this.id,
@required this.isRemote, required this.isRemote,
this.isDominant = false, this.isDominant = false,
this.isDummy = false, this.isDummy = false,
}) : assert(child != null), }) : assert(child != null),
@ -40,10 +40,10 @@ class ParticipantWidget extends StatelessWidget {
super(key: key); super(key: key);
ParticipantWidget copyWith({ ParticipantWidget copyWith({
Widget child, Widget? child,
bool audioEnabled, bool? audioEnabled,
bool videoEnabled, bool? videoEnabled,
bool isDominant, bool? isDominant,
}) { }) {
return ParticipantWidget( return ParticipantWidget(
id: id, id: id,

@ -8,12 +8,12 @@ import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'draggable_cam.dart'; import 'draggable_cam.dart';
class CamViewWidget extends StatefulWidget { class CamViewWidget extends StatefulWidget {
RTCVideoRenderer localRenderer; RTCVideoRenderer? localRenderer;
RTCVideoRenderer remoteRenderer; RTCVideoRenderer? remoteRenderer;
MediaStream localStream; MediaStream? localStream;
BoxConstraints constraints; BoxConstraints? constraints;
StreamController<bool> onButtonBarVisibleStreamController; StreamController<bool>? onButtonBarVisibleStreamController;
StreamController<double> onButtonBarHeightStreamController; StreamController<double>? onButtonBarHeightStreamController;
CamViewWidget({this.localRenderer, this.remoteRenderer, this.constraints, this.onButtonBarVisibleStreamController, this.onButtonBarHeightStreamController}); CamViewWidget({this.localRenderer, this.remoteRenderer, this.constraints, this.onButtonBarVisibleStreamController, this.onButtonBarHeightStreamController});
@ -38,26 +38,26 @@ class _CamViewWidgetState extends State<CamViewWidget> {
heightFactor: 1, widthFactor: 1, heightFactor: 1, widthFactor: 1,
child: Container( child: Container(
color: Colors.black87, color: Colors.black87,
child: RTCVideoView(widget.remoteRenderer, mirror: true,filterQuality: FilterQuality.medium,), child: RTCVideoView(widget.remoteRenderer!, mirror: true,filterQuality: FilterQuality.medium,),
), ),
), ),
if(widget.remoteRenderer.srcObject == null) if(widget.remoteRenderer!.srcObject == null)
Positioned.fill(child: _buildNoiseBox()), Positioned.fill(child: _buildNoiseBox()),
Positioned.fill( Positioned.fill(
child: RTCVideoView(widget.remoteRenderer) child: RTCVideoView(widget.remoteRenderer!)
), ),
DraggableCam( DraggableCam(
key: Key('publisher'), key: Key('publisher'),
onButtonBarHeight: widget.onButtonBarHeightStreamController.stream, onButtonBarHeight: widget.onButtonBarHeightStreamController!.stream,
onButtonBarVisible: widget.onButtonBarVisibleStreamController.stream, onButtonBarVisible: widget.onButtonBarVisibleStreamController!.stream,
availableScreenSize: widget.constraints.biggest, availableScreenSize: widget.constraints!.biggest,
child: RTCVideoView(widget.localRenderer) child: RTCVideoView(widget.localRenderer!)
), ),
if(widget.remoteRenderer.srcObject == null) if(widget.remoteRenderer!.srcObject == null)
Container( Container(
margin: EdgeInsets.all(MediaQuery.of(context).size.width/8), margin: EdgeInsets.all(MediaQuery.of(context).size.width/8),
child: Text( child: Text(

@ -12,11 +12,11 @@ class DraggableCam extends StatefulWidget {
final Stream<double> onButtonBarHeight; final Stream<double> onButtonBarHeight;
const DraggableCam({ const DraggableCam({
Key key, Key? key,
@required this.availableScreenSize, required this.availableScreenSize,
this.child, required this.child,
@required this.onButtonBarVisible, required this.onButtonBarVisible,
@required this.onButtonBarHeight, required this.onButtonBarHeight,
/// The portion of the screen the DraggableWidget should use. /// The portion of the screen the DraggableWidget should use.
this.scaleFactor = .25, this.scaleFactor = .25,
@ -33,27 +33,27 @@ class DraggableCam extends StatefulWidget {
class _DraggablePublisherState extends State<DraggableCam> { class _DraggablePublisherState extends State<DraggableCam> {
bool _isButtonBarVisible = true; bool _isButtonBarVisible = true;
double _buttonBarHeight = 0; double _buttonBarHeight = 0;
double _width; double? _width;
double _height; double? _height;
double _top; double? _top;
double _left; double? _left;
double _viewPaddingTop; double? _viewPaddingTop;
double _viewPaddingBottom; double? _viewPaddingBottom;
final double _padding = 8.0; final double _padding = 8.0;
final Duration _duration300ms = const Duration(milliseconds: 300); final Duration _duration300ms = const Duration(milliseconds: 300);
final Duration _duration0ms = const Duration(milliseconds: 0); final Duration _duration0ms = const Duration(milliseconds: 0);
Duration _duration; Duration? _duration;
StreamSubscription _streamSubscription; StreamSubscription? _streamSubscription;
StreamSubscription _streamHeightSubscription; StreamSubscription? _streamHeightSubscription;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_duration = _duration300ms; _duration = _duration300ms;
_width = widget.availableScreenSize.width * widget.scaleFactor; _width = widget.availableScreenSize.width * widget.scaleFactor;
_height = _width * (widget.availableScreenSize.height / widget.availableScreenSize.width); _height = _width! * (widget.availableScreenSize.height / widget.availableScreenSize.width);
_top = widget.availableScreenSize.height - (_buttonBarHeight + _padding) - _height; _top = widget.availableScreenSize.height - (_buttonBarHeight + _padding) - _height!;
_left = widget.availableScreenSize.width - _padding - _width; _left = widget.availableScreenSize.width - _padding - _width!;
_streamSubscription = widget.onButtonBarVisible.listen(_buttonBarVisible); _streamSubscription = widget.onButtonBarVisible.listen(_buttonBarVisible);
_streamHeightSubscription = widget.onButtonBarHeight.listen(_getButtonBarHeight); _streamHeightSubscription = widget.onButtonBarHeight.listen(_getButtonBarHeight);
@ -69,8 +69,8 @@ class _DraggablePublisherState extends State<DraggableCam> {
@override @override
void dispose() { void dispose() {
_streamSubscription.cancel(); _streamSubscription!.cancel();
_streamHeightSubscription.cancel(); _streamHeightSubscription!.cancel();
super.dispose(); super.dispose();
} }
@ -101,20 +101,20 @@ class _DraggablePublisherState extends State<DraggableCam> {
left: _left, left: _left,
width: _width, width: _width,
height: _height, height: _height,
duration: _duration, duration: _duration!,
child: Listener( child: Listener(
onPointerDown: (_) => _duration = _duration0ms, onPointerDown: (_) => _duration = _duration0ms,
onPointerMove: (PointerMoveEvent event) { onPointerMove: (PointerMoveEvent event) {
setState(() { setState(() {
_left = (_left + event.delta.dx).roundToDouble(); _left = (_left! + event.delta.dx).roundToDouble();
_top = (_top + event.delta.dy).roundToDouble(); _top = (_top! + event.delta.dy).roundToDouble();
}); });
}, },
onPointerUp: (_) => _positionWidget(), onPointerUp: (_) => _positionWidget(),
onPointerCancel: (_) => _positionWidget(), onPointerCancel: (_) => _positionWidget(),
child: ClippedVideo( child: ClippedVideo(
height: _height, height: _height!,
width: _width, width: _width!,
child: widget.child, child: widget.child,
), ),
), ),
@ -123,29 +123,29 @@ class _DraggablePublisherState extends State<DraggableCam> {
double _getCurrentStatusBarHeight() { double _getCurrentStatusBarHeight() {
if (_isButtonBarVisible) { if (_isButtonBarVisible) {
return _viewPaddingTop; return _viewPaddingTop!;
} }
final _defaultViewPaddingTop = Platform.isIOS ? 20.0 : Platform.isAndroid ? 24.0 : 0.0; final _defaultViewPaddingTop = Platform.isIOS ? 20.0 : Platform.isAndroid ? 24.0 : 0.0;
if (_viewPaddingTop > _defaultViewPaddingTop) { if (_viewPaddingTop! > _defaultViewPaddingTop) {
// There must be a hardware notch in the display. // There must be a hardware notch in the display.
return _viewPaddingTop; return _viewPaddingTop!;
} }
return 0.0; return 0.0;
} }
double _getCurrentButtonBarHeight() { double _getCurrentButtonBarHeight() {
if (_isButtonBarVisible) { if (_isButtonBarVisible) {
return _buttonBarHeight + _viewPaddingBottom; return _buttonBarHeight + _viewPaddingBottom!;
} }
return _viewPaddingBottom; return _viewPaddingBottom!;
} }
void _positionWidget() { void _positionWidget() {
// Determine the center of the object being dragged so we can decide // Determine the center of the object being dragged so we can decide
// in which corner the object should be placed. // in which corner the object should be placed.
var dx = (_width / 2) + _left; var dx = (_width! / 2) + _left!;
dx = dx < 0 ? 0 : dx >= widget.availableScreenSize.width ? widget.availableScreenSize.width - 1 : dx; dx = dx < 0 ? 0 : dx >= widget.availableScreenSize.width ? widget.availableScreenSize.width - 1 : dx;
var dy = (_height / 2) + _top; var dy = (_height! / 2) + _top!;
dy = dy < 0 ? 0 : dy >= widget.availableScreenSize.height ? widget.availableScreenSize.height - 1 : dy; dy = dy < 0 ? 0 : dy >= widget.availableScreenSize.height ? widget.availableScreenSize.height - 1 : dy;
final draggableCenter = Offset(dx, dy); final draggableCenter = Offset(dx, dy);
@ -158,15 +158,15 @@ class _DraggablePublisherState extends State<DraggableCam> {
} else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, 0, widget.availableScreenSize.width, widget.availableScreenSize.height / 2).contains(draggableCenter)) { } else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, 0, widget.availableScreenSize.width, widget.availableScreenSize.height / 2).contains(draggableCenter)) {
// Top-right // Top-right
_top = _getCurrentStatusBarHeight() + _padding; _top = _getCurrentStatusBarHeight() + _padding;
_left = widget.availableScreenSize.width - _padding - _width; _left = widget.availableScreenSize.width - _padding - _width!;
} else if (Rect.fromLTRB(0, widget.availableScreenSize.height / 2, widget.availableScreenSize.width / 2, widget.availableScreenSize.height).contains(draggableCenter)) { } else if (Rect.fromLTRB(0, widget.availableScreenSize.height / 2, widget.availableScreenSize.width / 2, widget.availableScreenSize.height).contains(draggableCenter)) {
// Bottom-left // Bottom-left
_top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height; _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height!;
_left = _padding; _left = _padding;
} else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, widget.availableScreenSize.height / 2, widget.availableScreenSize.width, widget.availableScreenSize.height).contains(draggableCenter)) { } else if (Rect.fromLTRB(widget.availableScreenSize.width / 2, widget.availableScreenSize.height / 2, widget.availableScreenSize.width, widget.availableScreenSize.height).contains(draggableCenter)) {
// Bottom-right // Bottom-right
_top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height; _top = widget.availableScreenSize.height - (_getCurrentButtonBarHeight() + _padding) - _height!;
_left = widget.availableScreenSize.width - _padding - _width; _left = widget.availableScreenSize.width - _padding - _width!;
} }
}); });
} }

@ -6,15 +6,15 @@ import 'package:flutter/material.dart';
class ButtonToProgress extends StatefulWidget { class ButtonToProgress extends StatefulWidget {
final double height; final double height;
final double progressHeight; final double progressHeight;
final String loadingText; final String? loadingText;
final Duration duration; final Duration duration;
final TextStyle loadingTextStyle; final TextStyle? loadingTextStyle;
final VoidCallback onPressed; final VoidCallback? onPressed;
final Stream<bool> onLoading; final Stream<bool>? onLoading;
final Widget child; final Widget child;
const ButtonToProgress({ const ButtonToProgress({
Key key, Key? key,
this.height = 40.0, this.height = 40.0,
this.progressHeight = 5.0, this.progressHeight = 5.0,
this.loadingText, this.loadingText,
@ -22,7 +22,7 @@ class ButtonToProgress extends StatefulWidget {
this.loadingTextStyle, this.loadingTextStyle,
this.onPressed, this.onPressed,
this.onLoading, this.onLoading,
@required this.child, required this.child,
}) : assert(child != null), }) : assert(child != null),
assert(height != null && height > 0), assert(height != null && height > 0),
assert(progressHeight != null && progressHeight > 0 && progressHeight <= height), assert(progressHeight != null && progressHeight > 0 && progressHeight <= height),
@ -33,18 +33,18 @@ class ButtonToProgress extends StatefulWidget {
} }
class _ButtonToProgressState extends State<ButtonToProgress> { class _ButtonToProgressState extends State<ButtonToProgress> {
double _height; double? _height;
double _opacity = 0; double _opacity = 0;
bool _isLoading = false; bool _isLoading = false;
StreamSubscription<bool> _subscription; StreamSubscription<bool>? _subscription;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_height = widget.height; _height = widget.height;
if (widget.onLoading != null) { if (widget.onLoading != null) {
_subscription = widget.onLoading.listen((bool isLoading) { _subscription = widget.onLoading!.listen((bool isLoading) {
setState(() { setState(() {
_isLoading = isLoading; _isLoading = isLoading;
_height = isLoading ? widget.progressHeight : widget.height; _height = isLoading ? widget.progressHeight : widget.height;
@ -57,7 +57,7 @@ class _ButtonToProgressState extends State<ButtonToProgress> {
@override @override
void dispose() { void dispose() {
if (_subscription != null) { if (_subscription != null) {
_subscription.cancel(); _subscription!.cancel();
} }
super.dispose(); super.dispose();
} }
@ -77,7 +77,7 @@ class _ButtonToProgressState extends State<ButtonToProgress> {
child: Center( child: Center(
child: FittedBox( child: FittedBox(
child: Text( child: Text(
widget.loadingText, widget.loadingText!,
style: widget.loadingTextStyle, style: widget.loadingTextStyle,
), ),
), ),
@ -90,7 +90,7 @@ class _ButtonToProgressState extends State<ButtonToProgress> {
AnimatedPadding( AnimatedPadding(
duration: widget.duration, duration: widget.duration,
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: math.max(widget.height - _height, 0), top: math.max(widget.height - _height!, 0),
), ),
child: AnimatedContainer( child: AnimatedContainer(
duration: widget.duration, duration: widget.duration,

@ -4,16 +4,16 @@ import 'package:flutter/material.dart';
import 'package:native_device_orientation/native_device_orientation.dart'; import 'package:native_device_orientation/native_device_orientation.dart';
class CircleButton extends StatefulWidget { class CircleButton extends StatefulWidget {
final VoidCallback onLongPress; final VoidCallback? onLongPress;
final VoidCallback onPressed; final VoidCallback? onPressed;
final GestureTapDownCallback onTapDown; final GestureTapDownCallback? onTapDown;
final VoidCallback onTapCancel; final VoidCallback? onTapCancel;
final Widget child; final Widget? child;
final Color color; final Color? color;
final double radius; final double? radius;
const CircleButton({ const CircleButton({
Key key, Key? key,
this.onLongPress, this.onLongPress,
this.onPressed, this.onPressed,
this.child, this.child,
@ -32,7 +32,7 @@ class _CircleButtonState extends State<CircleButton> {
double _rotationAngle = 0.0; double _rotationAngle = 0.0;
final Stream<NativeDeviceOrientation> _orientationStream = NativeDeviceOrientationCommunicator().onOrientationChanged(useSensor: true); final Stream<NativeDeviceOrientation> _orientationStream = NativeDeviceOrientationCommunicator().onOrientationChanged(useSensor: true);
StreamSubscription<NativeDeviceOrientation> _orientationSubscription; late StreamSubscription<NativeDeviceOrientation> _orientationSubscription;
void _handleOrientationChange(NativeDeviceOrientation orientation) { void _handleOrientationChange(NativeDeviceOrientation orientation) {
var targetAngle = 0.0; var targetAngle = 0.0;
@ -73,7 +73,7 @@ class _CircleButtonState extends State<CircleButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final size = 2 * widget.radius; final size = 2 * widget.radius!;
return Container( return Container(
width: size, width: size,
@ -81,7 +81,7 @@ class _CircleButtonState extends State<CircleButton> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: (widget.color ?? Colors.blue).withAlpha(200), color: (widget.color ?? Colors.blue).withAlpha(200),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(widget.radius), Radius.circular(widget.radius!),
), ),
), ),
child: GestureDetector( child: GestureDetector(

@ -13,11 +13,11 @@ enum NoiseBoxDensity {
class NoiseBox extends StatefulWidget { class NoiseBox extends StatefulWidget {
final NoiseBoxDensity density; final NoiseBoxDensity density;
final Color backgroundColor; final Color? backgroundColor;
final Widget child; final Widget? child;
const NoiseBox({ const NoiseBox({
Key key, Key? key,
this.backgroundColor, this.backgroundColor,
this.child, this.child,
this.density = NoiseBoxDensity.medium, this.density = NoiseBoxDensity.medium,
@ -29,8 +29,8 @@ class NoiseBox extends StatefulWidget {
} }
class _NoiseBoxState extends State<NoiseBox> with TickerProviderStateMixin { class _NoiseBoxState extends State<NoiseBox> with TickerProviderStateMixin {
AnimationController _animationController; late AnimationController _animationController;
int _density; late int _density;
@override @override
void initState() { void initState() {
@ -74,7 +74,7 @@ class _NoiseBoxState extends State<NoiseBox> with TickerProviderStateMixin {
height: constraints.biggest.height, height: constraints.biggest.height,
child: AnimatedBuilder( child: AnimatedBuilder(
animation: _animationController, animation: _animationController,
builder: (BuildContext context, Widget w) { builder: (BuildContext context, Widget? w) {
final children = <Widget>[ final children = <Widget>[
CustomPaint( CustomPaint(
painter: NoisePainter( painter: NoisePainter(
@ -85,7 +85,7 @@ class _NoiseBoxState extends State<NoiseBox> with TickerProviderStateMixin {
), ),
]; ];
if (widget.child != null) { if (widget.child != null) {
children.add(widget.child); children.add(widget.child!);
} }
return Stack( return Stack(
children: children, children: children,
@ -103,9 +103,9 @@ class NoisePainter extends CustomPainter {
final int density; final int density;
NoisePainter({ NoisePainter({
@required this.width, required this.width,
@required this.height, required this.height,
@required this.density, required this.density,
}) : assert(width != null), }) : assert(width != null),
assert(height != null), assert(height != null),
assert(density != null && assert(density != null &&

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import './platform_widget.dart'; import './platform_widget.dart';
class PlatformAlertDialog extends PlatformWidget { class PlatformAlertDialog extends PlatformWidget {
PlatformAlertDialog({@required this.title, @required this.content, @required this.defaultActionText, this.cancelActionText}) PlatformAlertDialog({required this.title, required this.content, required this.defaultActionText, this.cancelActionText})
: assert(title != null), : assert(title != null),
assert(content != null), assert(content != null),
assert(defaultActionText != null); assert(defaultActionText != null);
@ -14,9 +14,9 @@ class PlatformAlertDialog extends PlatformWidget {
final String title; final String title;
final String content; final String content;
final String defaultActionText; final String defaultActionText;
final String cancelActionText; final String? cancelActionText;
Future<bool> show(BuildContext context) async { Future<bool?> show(BuildContext context) async {
return Platform.isIOS return Platform.isIOS
? await showCupertinoDialog<bool>( ? await showCupertinoDialog<bool>(
context: context, context: context,
@ -52,7 +52,7 @@ class PlatformAlertDialog extends PlatformWidget {
if (cancelActionText != null) { if (cancelActionText != null) {
actions.add( actions.add(
PlatformAlertDialogAction( PlatformAlertDialogAction(
child: Text(cancelActionText), child: Text(cancelActionText!),
onPressed: () { onPressed: () {
Navigator.of(context).pop(false); Navigator.of(context).pop(false);
}, },
@ -73,8 +73,8 @@ class PlatformAlertDialog extends PlatformWidget {
class PlatformAlertDialogAction extends PlatformWidget { class PlatformAlertDialogAction extends PlatformWidget {
PlatformAlertDialogAction({ PlatformAlertDialogAction({
this.child, required this.child,
this.onPressed, required this.onPressed,
}); });
final Widget child; final Widget child;

@ -6,7 +6,7 @@ import './platform_alert_dialog.dart';
class PlatformExceptionAlertDialog extends PlatformAlertDialog { class PlatformExceptionAlertDialog extends PlatformAlertDialog {
PlatformExceptionAlertDialog({ PlatformExceptionAlertDialog({
String title = 'An error occurred', String title = 'An error occurred',
@required Exception exception, required Exception exception,
}) : super( }) : super(
title: title, title: title,
content: exception is PlatformException ? _message(exception) : exception.toString(), content: exception is PlatformException ? _message(exception) : exception.toString(),

@ -7,8 +7,8 @@ typedef ResponsiveBuilder = Widget Function(
class ResponsiveSafeArea extends StatelessWidget { class ResponsiveSafeArea extends StatelessWidget {
const ResponsiveSafeArea({ const ResponsiveSafeArea({
@required ResponsiveBuilder builder, required ResponsiveBuilder builder,
Key key, Key? key,
}) : responsiveBuilder = builder, }) : responsiveBuilder = builder,
assert(builder != null), assert(builder != null),
super(key: key); super(key: key);

@ -335,7 +335,7 @@ class DoctorsListService extends BaseService {
} }
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context, Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context,
[String? procedureID, num? testTypeEnum, num? testProcedureEnum, required ProjectViewModel projectViewModel]) async { [String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -1843,6 +1843,4 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -10,8 +10,8 @@ class CustomTextButton extends StatelessWidget {
final OutlinedBorder? shape; final OutlinedBorder? shape;
final double? elevation; final double? elevation;
final BorderSide? side; final BorderSide? side;
final Color disabledForegroundColor; final Color? disabledForegroundColor;
final Color disabledBackgroundColor; final Color? disabledBackgroundColor;
const CustomTextButton({ const CustomTextButton({
Key? key, Key? key,

@ -198,16 +198,21 @@ class DoctorCard extends StatelessWidget {
// ), // ),
RatingBar( RatingBar(
initialRating: rating!, initialRating: rating!,
// size: 18.0, ratingWidget: RatingWidget(
// filledColor: Color(0XFFD02127), full: Icon(
// emptyColor: Color(0XFFD02127), Icons.star,
// isHalfAllowed: true, color: Color(0XFFD02127),
// halfFilledIcon: Icons.star_half, ),
// filledIcon: Icons.star, half: Icon(
// emptyIcon: , Icons.star_half,
// color: Color(0XFFD02127),
ratingWidget: RatingWidget( full:Icon(Icons.star, color:Color(0XFFD02127)), half:Icon(Icons.star_half, color: Color(0XFFD02127)), empty: Icon(Icons.star_border,color: Color(0XFFD02127)) , ),
), onRatingUpdate: (double value) { }), empty: Icon(
Icons.star_border,
color: Color(0XFFD02127),
),
),
onRatingUpdate: (double value) {}),
], ],
), ),
if (remainingTimeInMinutes != null) if (remainingTimeInMinutes != null)

@ -12,9 +12,9 @@ import 'my_rich_text.dart';
class HospitalLocation extends StatelessWidget { class HospitalLocation extends StatelessWidget {
final GetHMGLocationsModel location; final GetHMGLocationsModel location;
final bool showCity; final bool showCity;
final String waitingTime; final String? waitingTime;
HospitalLocation(this.location, {Key? key, this.showCity = false, required this.waitingTime}) : super(key: key); HospitalLocation(this.location, {Key? key, this.showCity = false, this.waitingTime}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -62,7 +62,7 @@ class HospitalLocation extends StatelessWidget {
children: [ children: [
if (showCity) MyRichText(TranslationBase.of(context).city + ":", location.cityName!.trim().toString(), projectViewModel.isArabic), if (showCity) MyRichText(TranslationBase.of(context).city + ":", location.cityName!.trim().toString(), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).distance + ":", location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).distance + ":", location.distanceInKilometers.toString() + " " + TranslationBase.of(context).km_ ?? "", projectViewModel.isArabic),
if (waitingTime != null) MyRichText(TranslationBase.of(context).waitingTime, waitingTime, projectViewModel.isArabic), if (waitingTime != null) MyRichText(TranslationBase.of(context).waitingTime, waitingTime!, projectViewModel.isArabic),
], ],
), ),
) )

@ -487,7 +487,7 @@ class _SearchBot extends State<BottomBarSearch> {
page: DoctorProfile( page: DoctorProfile(
doctor: docObject, doctor: docObject,
docProfileList: docProfile, docProfileList: docProfile,
isOpenAppt: isAppo, isOpenAppt: isAppo, isLiveCareAppointment: false,
))); )));
} }

@ -809,7 +809,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
page: DoctorProfile( page: DoctorProfile(
doctor: docObject, doctor: docObject,
docProfileList: docProfile, docProfileList: docProfile,
isOpenAppt: isAppo, isOpenAppt: isAppo, isLiveCareAppointment: false,
))); )));
} }

Loading…
Cancel
Save