models updates -> 3.13.6

dev_v3.13.6_voipcall
devamirsaleemahmad 2 years ago
parent b26f535749
commit 1c19b36d2d

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

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

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

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

@ -24,10 +24,10 @@ import 'package:provider/provider.dart';
class DentalComplaints extends StatefulWidget {
SearchInfo searchInfo;
Function onSelectedMethod;
Function? onSelectedMethod;
bool isDoctorNameSearch;
DentalComplaints({required this.searchInfo, required this.onSelectedMethod, this.isDoctorNameSearch = false});
DentalComplaints({required this.searchInfo, this.onSelectedMethod, this.isDoctorNameSearch = false});
@override
_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/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'BookConfirm.dart';
import 'components/DocAvailableAppointments.dart';
@ -40,22 +40,22 @@ class DoctorProfile extends StatefulWidget {
bool isLiveCareAppointment;
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
_DoctorProfileState createState() => _DoctorProfileState();
}
class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateMixin {
TabController _tabController;
late TabController _tabController;
bool showFooterButton = false;
var event = RobotProvider();
dynamic doctorSchedule;
AppSharedPreferences sharedPref = AppSharedPreferences();
List<DoctorRateDetails> doctorDetailsList =[];
List<DoctorRateDetails> doctorDetailsList = [];
@override
void initState() {
@ -67,13 +67,13 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
super.initState();
}
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
appBarTitle: widget.doctor.doctorTitle! + " " + widget.doctor.name!,
isShowAppBar: true,
isShowDecPage: false,
showNewAppBar: true,
@ -111,18 +111,18 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
children: <Widget>[
DoctorHeader(
headerModel: HeaderModel(
widget.doctor.name,
widget.doctor.doctorID,
widget.doctor.doctorImageURL,
widget.doctor.speciality,
widget.doctor.name!,
widget.doctor.doctorID!,
widget.doctor.doctorImageURL!,
widget.doctor.speciality!,
"",
widget.doctor.projectName,
widget.doctor.projectName!,
null,
null,
widget.doctor.nationalityFlagURL,
widget.doctor.nationalityFlagURL!,
widget.doctor.doctorRate,
widget.doctor.actualDoctorRate,
widget.docProfileList.noOfPatientsRate,
widget.doctor.actualDoctorRate!,
widget.docProfileList.noOfPatientsRate!,
"",
decimalDoctorRate: widget.docProfileList.decimalDoctorRate.toString(),
),
@ -151,7 +151,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
},
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)),
TabBar(
onTap: (index) {
@ -234,7 +234,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatings() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getDoctorsRating(widget.doctor.doctorID, context).then((res) {
service.getDoctorsRating(widget.doctor.doctorID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['NotesDoctorRatingList']);
@ -251,7 +251,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) {
service.getDoctorsRatingDetails(widget.doctor.doctorID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
@ -319,19 +319,37 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
padding: EdgeInsets.all(10.0),
child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))),
Container(
margin: EdgeInsets.only(top: 0.0), child: Text(this.widget.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(
margin: EdgeInsets.only(top: 5.0),
alignment: Alignment.center,
child: RatingBar.readOnly(
initialRating: this.widget.doctor.actualDoctorRate.toDouble(),
size: 35.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
// child: RatingBar.readOnly(
// initialRating: this.widget.doctor.actualDoctorRate!.toDouble(),
// size: 35.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
child: RatingBar(
initialRating: this.widget.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(
@ -473,11 +491,13 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
pageBuilder: (context, animation1, animation2){
return SizedBox();
});
}
double getRatingWidth(int patientNumber) {
var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100;
var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate!) * 100;
return width;
}
@ -497,12 +517,12 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
// } else {
if (DocAvailableAppointments.areSlotsAvailable) {
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);
} else {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
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 {
ConfirmDialog dialog = new ConfirmDialog(
@ -558,9 +578,9 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
page: BookConfirm(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime,
initialSlotDuration: DocAvailableAppointments.initialSlotDuration,
selectedDate: DocAvailableAppointments.selectedDate!,
selectedTime: DocAvailableAppointments.selectedTime!,
initialSlotDuration: DocAvailableAppointments.initialSlotDuration!,
),
),
);

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

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

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

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

@ -19,19 +19,19 @@ enum Gender { Male, Female, NON }
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
class AddNewChildPage extends StatefulWidget {
final int frequency;
final int days;
final String itemDescription;
String dateAdd;
final int? frequency;
final int? days;
final String? itemDescription;
String? dateAdd;
List<DateTime> _scheduleList =[];
List<DayOfWeek> daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday];
DateTime startDay;
DateTime endDay;
DateTime? startDay;
DateTime? endDay;
//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();
endDay = DateTime.now(); //endDay = DateTime.now().add(Duration(days: days));
int hour = 24; //(24 / frequency).round();
@ -46,8 +46,8 @@ class AddNewChildPage extends StatefulWidget {
}
class _AddNewChildPageState extends State<AddNewChildPage> {
int tappedIndex;
int checkedValue;
late int tappedIndex;
late int checkedValue;
@override
void initState() {
@ -278,11 +278,11 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
}
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() {
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) {
@ -313,7 +313,7 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
{VoidCallback? suffixTap, bool isEnable = true, bool hasSelection = false, int? lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

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

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

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

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

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

@ -58,7 +58,7 @@ class VaccinationTablePage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
babyInfo.babyName,
babyInfo.babyName!,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -100,7 +100,7 @@ class VaccinationTablePage extends StatelessWidget {
),
),
Text(
DateUtil.getFormattedDate(babyInfo.dOB, "MMM dd,yyyy"),
DateUtil.getFormattedDate(babyInfo.dOB!, "MMM dd,yyyy"),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
@ -183,13 +183,13 @@ class VaccinationTablePage extends StatelessWidget {
tableRow.add(
TableRow(
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),
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: 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> {
int tappedIndex;
String chat;
int? tappedIndex;
String? chat;
@override
void initState() {
@ -63,7 +63,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
setState(() {
tappedIndex = index;
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(
@ -108,9 +108,10 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).start,
chat.isEmpty ? null : () => {launch(chat)},
//Changed By Aamir URL
chat!.isEmpty ? null : () => {launch(chat!)},
color: Color(0xffD02127),
textColor: chat.isEmpty ? Color(0xff000000) : Colors.white,
textColor: chat!.isEmpty ? Color(0xff000000) : Colors.white,
disabledColor: Color(0xffEAEAEA),
),
),

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

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

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

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

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

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

@ -24,7 +24,7 @@ class CardCommonContact extends StatelessWidget {
final ProjectViewModel projectViewModel;
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
Widget build(BuildContext context) {

@ -29,31 +29,31 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
class CovidTimeSlots extends StatefulWidget {
int projectID;
int? projectID;
static bool areSlotsAvailable = false;
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
CovidTestProceduresResponse selectedProcedure;
DriveThroughTestingCenterModel selectedProject;
static DateTime? selectedAppoDateTime;
static String? selectedDate;
static String? selectedTime;
CovidTestProceduresResponse? selectedProcedure;
DriveThroughTestingCenterModel? selectedProject;
int selectedClinicID;
int selectedDoctorID;
int? selectedClinicID;
int? selectedDoctorID;
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
_CovidTimeSlotsState createState() => _CovidTimeSlotsState();
}
class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStateMixin {
Map<DateTime, List> _events;
AnimationController _animationController;
CalendarController _calendarController;
late Map<DateTime, List> _events;
late AnimationController _animationController;
late CalendarController _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -68,10 +68,10 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
dynamic freeSlotsResponse;
ScrollController _scrollController;
late ScrollController _scrollController;
ToDoCountProviderModel toDoProvider;
ProjectViewModel projectViewModel;
late ToDoCountProviderModel toDoProvider;
late ProjectViewModel projectViewModel;
@override
void initState() {
@ -85,7 +85,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
_selectedDay: ['Event A0']
};
WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID));
WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID!));
_calendarController = CalendarController();
_animationController = AnimationController(
@ -217,18 +217,14 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
bookCovidTestAppointment();
},
child: Text(
TranslationBase.of(context).bookAppo,
style: TextStyle(
fontSize: 16.0,
letterSpacing: -0.64,
color: Colors.white
),
style: TextStyle(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),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date, projectViewModel);
_onDaySelected(details.date!, projectViewModel);
},
);
}
@ -345,8 +341,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
Widget getNormalButton(int index) {
return CustomTextButton(
backgroundColor: Colors.white,
elevation: 0,
backgroundColor: Colors.white,
elevation: 0,
onPressed: () {
setState(() {
selectedButtonIndex = index;
@ -354,14 +350,14 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
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))),
);
}
Widget getSelectedButton(int index) {
return CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
setState(() {
selectedButtonIndex = index;
@ -369,25 +365,25 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
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() {
if (CovidTimeSlots.areSlotsAvailable) {
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 " +
projectViewModel.authenticatedUserObject.user.patientID.toString() +
projectViewModel.authenticatedUserObject.user!.patientID.toString() +
". Please confirm!";
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(
context: context,
@ -412,7 +408,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
insertCovidQuestionnaire(context, DoctorList docObject) async {
DoctorsListService service = new DoctorsListService();
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);
}).catchError((err) {
print(err);
@ -421,7 +417,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
updateCovidQuestionnaire(context, String appoNo) async {
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);
});
}
@ -430,13 +426,13 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo;
service
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID,
widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum)
.insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, CovidTimeSlots.selectedTime!, CovidTimeSlots.selectedDate!, 0, context,
widget.selectedProcedure!.procedureID, widget.selectedProject!.testTypeEnum, widget.selectedProject!.testProcedureEnum)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject);
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
@ -516,7 +512,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
Navigator.push(
context,
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) {
CovidDriveThruService service = new CovidDriveThruService();
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);
if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) {
@ -552,32 +548,32 @@ class MeetingDataSource extends CalendarDataSource {
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
return _getMeetingData(index)!.from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
return _getMeetingData(index)!.to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
return _getMeetingData(index)!.eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
return _getMeetingData(index)!.background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
return _getMeetingData(index)!.isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index];
Meeting meetingData;
Meeting? _getMeetingData(int index) {
final dynamic meeting = appointments![index];
Meeting? meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}

@ -26,14 +26,14 @@ class CovidDirveThruQuestions extends StatefulWidget {
final List<CovidTestProceduresResponse> proceduresList;
DriveThroughTestingCenterModel selectedProject;
CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList, @required this.selectedProject});
CovidDirveThruQuestions({required this.projectId, required this.proceduresList, required this.selectedProject});
@override
CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState();
}
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa;
late List qa;
@override
void initState() {
@ -41,8 +41,8 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
qa = getQuestionsFromJson();
}
TranslationBase localize;
ProjectViewModel projectViewModel;
late TranslationBase localize;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -96,7 +96,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -118,7 +118,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
projectViewModel.user!.patientIdentificationNo!,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -235,7 +235,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
height: 50,
elevation: 0,
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)),
child: Text(
localize.next,
@ -303,7 +303,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
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);
if (res['MessageStatus'] == 1) {
covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);

@ -27,7 +27,7 @@ class CovidDrivethruLocation extends StatefulWidget {
}
class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectDropdownValue;
late String projectDropdownValue;
List<DriveThroughTestingCenterModel> projectsList = [];
List<CovidTestProceduresResponse> proceduresList = [];
bool isLocationSelected = false;
@ -35,12 +35,12 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectLong = "";
String projectName = "";
String projectID = "";
List<ImagesInfo> imagesInfo =[];
List<ImagesInfo> imagesInfo = [];
DriveThroughTestingCenterModel selectedProject;
late DriveThroughTestingCenterModel selectedProject;
final GlobalKey locationDropdownKey = GlobalKey();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
void initState() {
@ -132,7 +132,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
}).toList(),
onChanged: (newValue) {
setState(() {
selectedProject = newValue;
selectedProject = 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)),
],
);
} else {
return SizedBox();
}
}
@ -300,7 +302,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
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);
if (res['MessageStatus'] == 1) {
setState(() {
@ -325,7 +327,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService();
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) {
setState(() {
res['COVID19_TestProceduresList'].forEach((v) {

@ -15,7 +15,7 @@ import 'package:flutter/material.dart';
class CovidPaymentAlert extends StatefulWidget {
PatientShareResponse patientShareResponse;
CovidPaymentAlert({@required this.patientShareResponse});
CovidPaymentAlert({required this.patientShareResponse});
@override
_CovidPaymentAlertState createState() => _CovidPaymentAlertState();
@ -23,7 +23,7 @@ class CovidPaymentAlert extends StatefulWidget {
class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
late AuthenticatedUser authUser;
@override
Widget build(BuildContext context) {
@ -182,8 +182,8 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.accentColor,
disabledForegroundColor: Colors.grey[500].withOpacity(0.38),
disabledBackgroundColor: Colors.grey[500].withOpacity(0.12),
disabledForegroundColor: Colors.grey[500]!.withOpacity(0.38),
disabledBackgroundColor: Colors.grey[500]!.withOpacity(0.12),
elevation: 0,
onPressed: () {
startPaymentProcess();

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

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

@ -30,7 +30,7 @@ class _AddMember extends State<AddMember> {
final util = Utils();
final nationalIDorFile = TextEditingController();
final int loginType = AddFamilyMemberType.loginType;
String mobileNo;
String? mobileNo;
String countryCode = '966';
bool isButtonDisabled = true;
var sharedPref = new AppSharedPreferences();
@ -58,7 +58,7 @@ class _AddMember extends State<AddMember> {
: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(21.0),
height: SizeConfig.realScreenHeight * .9,
height: SizeConfig.realScreenHeight! * .9,
width: SizeConfig.realScreenWidth,
child: Column(
children: <Widget>[
@ -117,7 +117,7 @@ class _AddMember extends State<AddMember> {
}
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(() {
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

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

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

@ -67,7 +67,7 @@ class NotificationsPage extends StatelessWidget {
}
return InkWell(
onTap: () async {
if (!model.notifications[index].isRead) {
if (!model.notifications[index].isRead!) {
model.markAsRead(model.notifications[index].id);
}
Navigator.push(
@ -83,17 +83,17 @@ class NotificationsPage extends StatelessWidget {
width: double.infinity,
padding: EdgeInsets.fromLTRB(15.0, 14, 21, 12),
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(
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,
),
)
: Border(
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,
),
),
@ -105,9 +105,9 @@ class NotificationsPage extends StatelessWidget {
children: [
Expanded(
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(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -125,7 +125,7 @@ class NotificationsPage extends StatelessWidget {
),
SizedBox(height: 4),
Text(
model.notifications[index].message.trim(),
model.notifications[index].message!.trim(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,

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

@ -25,7 +25,7 @@ import 'Summary.dart';
class AmbulanceRequestIndexPage extends StatefulWidget {
final AmRequestViewModel amRequestViewModel;
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
AmbulanceRequestIndexPage({Key? key, required this.amRequestViewModel});
@override
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
@ -33,16 +33,16 @@ class AmbulanceRequestIndexPage extends StatefulWidget {
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
int currentIndex = 0;
PageController pageController;
late PageController pageController;
PatientER _patientER = PatientER();
PatientER_RC _patientER_RC = PatientER_RC();
TransportationDetails transportationDetails = new TransportationDetails();
int status;
String _statusDisp;
Color _color;
late int status;
late String _statusDisp;
late Color _color;
_changeCurrentTab(int tab) {
setState(() {
@ -65,8 +65,8 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder;
if(widget.amRequestViewModel.pendingAmbulanceRequestOrder != null) {
int status = order.statusId;
_statusDisp = order.statusText;
int status = order.statusId!;
_statusDisp = order.statusText!;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -147,7 +147,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
),
Expanded(
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),
),
),
@ -162,7 +162,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
),
Expanded(
child: Text(
order.serviceText,
order.serviceText!,
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)
InkWell(
onTap: () {
showConfirmMessage(widget.amRequestViewModel, order.iD, context);
showConfirmMessage(widget.amRequestViewModel, order.iD!, context);
},
child: Container(
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),
),
Text(
order.pickupLocation.trim().toString(),
order.pickupLocation!.trim().toString(),
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),
),
Text(
order.dropOffLocation.trim().toString(),
order.dropOffLocation!.trim().toString(),
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 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
_BillAmountState createState() => _BillAmountState();
@ -68,12 +68,12 @@ class _BillAmountState extends State<BillAmount> {
child: _getNormalText(TranslationBase.of(context).patientShareToDo),
),
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(
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
@ -83,12 +83,12 @@ class _BillAmountState extends State<BillAmount> {
child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
),
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(
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
@ -98,7 +98,7 @@ class _BillAmountState extends State<BillAmount> {
child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
),
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,
onChanged: (value) {
setState(() {
_ambulate = value;
_ambulate = value!;
});
},
),
@ -171,7 +171,7 @@ class _BillAmountState extends State<BillAmount> {
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
_ambulate = value!;
});
},
),
@ -209,7 +209,7 @@ class _BillAmountState extends State<BillAmount> {
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
_ambulate = value!;
});
},
),
@ -247,7 +247,7 @@ class _BillAmountState extends State<BillAmount> {
groupValue: _ambulate,
onChanged: (value) {
setState(() {
_ambulate = value;
_ambulate = value!;
});
},
),
@ -299,9 +299,9 @@ class _BillAmountState extends State<BillAmount> {
TranslationBase.of(context).next,
() {
setState(() {
widget.patientER_RC.transportationDetails.ambulate = _ambulate.selectAmbulateNumber();
widget.patientER_RC.transportationDetails.ambulateTitle = _ambulate.getAmbulateTitle(context);
widget.patientER_RC.transportationDetails.notes = note;
widget.patientER_RC.transportationDetails!.ambulate = _ambulate.selectAmbulateNumber();
widget.patientER_RC.transportationDetails!.ambulateTitle = _ambulate.getAmbulateTitle(context);
widget.patientER_RC.transportationDetails!.notes = note;
// widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
});

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

@ -21,7 +21,7 @@ class SelectTransportationMethod extends StatefulWidget {
final PatientER_RC patientER_RC;
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
_SelectTransportationMethodState createState() => _SelectTransportationMethodState();
@ -46,10 +46,10 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
// }
//RC API Revamp
if (widget.patientER_RC.transportationDetails.direction != null) {
_direction = widget.patientER_RC.transportationDetails.direction == 0 ? Direction.ToHospital : Direction.FromHospital;
_way = widget.patientER_RC.transportationDetails.tripType == 1 ? Way.OneWay : Way.TwoWays;
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER_RC.transportationDetails.ambulate - 1)];
if (widget.patientER_RC.transportationDetails!.direction != null) {
_direction = widget.patientER_RC.transportationDetails!.direction == 0 ? Direction.ToHospital : Direction.FromHospital;
_way = widget.patientER_RC.transportationDetails!.tripType == 1 ? Way.OneWay : Way.TwoWays;
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER_RC.transportationDetails!.ambulate! - 1)];
} else {
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,
onChanged: (value) {
setState(() {
_erTransportationMethod = value;
_erTransportationMethod = value!;
});
},
),
Flexible(
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(
fontSize: 12.0,
letterSpacing: -0.48,
@ -166,7 +166,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _direction,
onChanged: (value) {
setState(() {
_direction = value;
_direction = value!;
});
},
),
@ -200,7 +200,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _direction,
onChanged: (value) {
setState(() {
_direction = value;
_direction = value!;
});
},
),
@ -251,7 +251,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
_way = value!;
});
},
),
@ -284,7 +284,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
groupValue: _way,
onChanged: (value) {
setState(() {
_way = value;
_way = value!;
});
},
),
@ -336,12 +336,12 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
// widget.changeCurrentTab(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.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.iD.toString();
widget.patientER_RC.transportationDetails!.direction = _direction == Direction.ToHospital ? 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!.transportationType = _erTransportationMethod.iD.toString();
widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod;
widget.patientER_RC.transportationDetails.pickupUrgency = 1;
widget.patientER_RC.transportationDetails!.pickupUrgency = 1;
// widget.patientER.orderServiceID = _orderService.getIdOrderService();
// widget.patientER.lineItemNo = 1;
// widget.patientER.cost = _erTransportationMethod.price.toDouble();

@ -16,7 +16,7 @@ class Summary extends StatefulWidget {
final PatientER_RC patientER_RC;
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
_SummaryState createState() => _SummaryState();
@ -50,11 +50,11 @@ class _SummaryState extends State<Summary> {
_getNormalText(TranslationBase.of(context).transportMethod),
projectViewModel.isArabic
? _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.textN}',
'${widget.patientER_RC.patientERTransportationMethod!.textN}',
isBold: true,
)
: _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.text}',
'${widget.patientER_RC.patientERTransportationMethod!.text}',
isBold: true,
),
SizedBox(
@ -62,7 +62,7 @@ class _SummaryState extends State<Summary> {
),
_getNormalText(TranslationBase.of(context).directions),
_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,
),
SizedBox(
@ -72,7 +72,7 @@ class _SummaryState extends State<Summary> {
TranslationBase.of(context).pickupLocation,
),
_getNormalText(
'${widget.patientER_RC.transportationDetails.pickupLocationName}',
'${widget.patientER_RC.transportationDetails!.pickupLocationName}',
isBold: true,
),
SizedBox(
@ -80,7 +80,7 @@ class _SummaryState extends State<Summary> {
),
_getNormalText(TranslationBase.of(context).dropoffLocation),
_getNormalText(
'${widget.patientER_RC.transportationDetails.dropoffLocationName}',
'${widget.patientER_RC.transportationDetails!.dropoffLocationName}',
isBold: true,
),
SizedBox(
@ -88,7 +88,7 @@ class _SummaryState extends State<Summary> {
),
_getNormalText(TranslationBase.of(context).selectAmbulate),
_getNormalText(
'${widget.patientER_RC.transportationDetails.ambulateTitle}',
'${widget.patientER_RC.transportationDetails!.ambulateTitle}',
isBold: true,
),
SizedBox(
@ -96,7 +96,7 @@ class _SummaryState extends State<Summary> {
),
_getNormalText(TranslationBase.of(context).notes),
_getNormalText(
'${widget.patientER_RC.transportationDetails.notes ?? '---'}',
'${widget.patientER_RC.transportationDetails!.notes ?? '---'}',
isBold: true,
),
SizedBox(
@ -122,7 +122,7 @@ class _SummaryState extends State<Summary> {
_getNormalText(TranslationBase.of(context).patientShareTotal + ':'),
Container(
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 {
final List<AppoitmentAllHistoryResultList> appointmentsAllHistoryList;
const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList}) : super(key: key);
const AvailableAppointmentsPage({Key? key, required this.appointmentsAllHistoryList}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -36,16 +36,16 @@ class AvailableAppointmentsPage extends StatelessWidget {
},
child: DoctorCard(
isInOutPatient: appointmentsAllHistoryList[index].isInOutPatient,
name: appointmentsAllHistoryList[index].doctorTitle + " " + appointmentsAllHistoryList[index].doctorNameObj,
name: appointmentsAllHistoryList[index].doctorTitle! + " " + appointmentsAllHistoryList[index].doctorNameObj!,
profileUrl: appointmentsAllHistoryList[index].doctorImageURL,
subName: appointmentsAllHistoryList[index].clinicName,
isLiveCareAppointment: appointmentsAllHistoryList[index].isLiveCareAppointment,
date: DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate),
date: DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate!),
isSortByClinic: false,
rating: appointmentsAllHistoryList[index].actualDoctorRate + 0.0,
appointmentTime: appointmentsAllHistoryList[index].isLiveCareAppointment
? DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate).toString().split(" ")[1].substring(0, 5)
: appointmentsAllHistoryList[index].startTime.substring(0, 5),
rating: appointmentsAllHistoryList[index].actualDoctorRate! + 0.0,
appointmentTime: appointmentsAllHistoryList[index].isLiveCareAppointment!
? DateUtil.convertStringToDate(appointmentsAllHistoryList[index].appointmentDate!).toString().split(" ")[1].substring(0, 5)
: appointmentsAllHistoryList[index].startTime!.substring(0, 5),
remainingTimeInMinutes: null),
),
)

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

@ -7,10 +7,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class EdOnlineAgreementPage extends StatefulWidget {
final HospitalsModel selectedHospital;
final Function changePageViewIndex;
final HospitalsModel? selectedHospital;
final Function? changePageViewIndex;
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
_EdOnlineAgreementPageState createState() => _EdOnlineAgreementPageState();
@ -38,7 +38,7 @@ class _EdOnlineAgreementPageState extends State<EdOnlineAgreementPage> {
Checkbox(
value: widget.isAgree,
activeColor: Colors.red[800],
onChanged: (bool newValue) {
onChanged: (bool? newValue) {
setState(() {
widget.isAgree = !widget.isAgree;
});
@ -72,7 +72,7 @@ class _EdOnlineAgreementPageState extends State<EdOnlineAgreementPage> {
textColor: Colors.white,
color: Theme.of(context).primaryColor,
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,
label: TranslationBase.of(context).next.toUpperCase(),
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';
class EdOnlineNotesPage extends StatefulWidget {
final List<TriageQuestionsModel> selectedQuestions;
final Function changePageViewIndex;
TriageInformationRequest triageInformationRequest;
final List<TriageQuestionsModel>? selectedQuestions;
final Function? changePageViewIndex;
TriageInformationRequest? triageInformationRequest;
EdOnlineNotesPage({Key key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest});
EdOnlineNotesPage({Key? key, this.selectedQuestions, this.changePageViewIndex, this.triageInformationRequest});
@override
_EdOnlineNotesPageState createState() => _EdOnlineNotesPageState();
@ -30,7 +30,7 @@ class EdOnlineNotesPage extends StatefulWidget {
class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
TextEditingController _chiefComplaintsTextController = TextEditingController();
TextEditingController _noteTextController = TextEditingController();
DateTime selectedTime;
late DateTime selectedTime;
final _formKey = GlobalKey<FormState>();
@override
@ -117,7 +117,7 @@ class _EdOnlineNotesPageState extends State<EdOnlineNotesPage> {
textColor: Colors.white,
color: Theme.of(context).primaryColor,
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(),
disabled: selectedTime == null,
onTap: () async {
if (_formKey.currentState.validate()) {
if (_formKey.currentState!.validate()) {
GifLoaderDialogUtils.showMyDialog(context);
model
.saveQuestionsInformation(
chiefComplaint: _chiefComplaintsTextController.text.toString(),
notes: _noteTextController.text.toString(),
selectedQuestions: widget.selectedQuestions,
projectId: widget.triageInformationRequest.projectID,
projectId: widget.triageInformationRequest!.projectID!,
selectedTime: selectedTime)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: model.error);
else {
widget.changePageViewIndex(4);
widget.changePageViewIndex!(4);
}
}).catchError((onError) {
GifLoaderDialogUtils.hideDialog(context);

@ -15,11 +15,11 @@ import 'package:flutter/material.dart';
// ignore: must_be_immutable
class EdOnlineQuestionsPage extends StatefulWidget {
final HospitalsModel selectedHospital;
final Function changePageViewIndex;
List<TriageQuestionsModel> selectedQuestions;
final HospitalsModel? selectedHospital;
final Function? changePageViewIndex;
List<TriageQuestionsModel>? selectedQuestions;
EdOnlineQuestionsPage({Key key, this.selectedHospital, this.selectedQuestions, this.changePageViewIndex});
EdOnlineQuestionsPage({Key? key, this.selectedHospital, this.selectedQuestions, this.changePageViewIndex});
@override
_EdOnlineQuestionsPageState createState() => _EdOnlineQuestionsPageState();
@ -41,10 +41,10 @@ class _EdOnlineQuestionsPageState extends State<EdOnlineQuestionsPage> {
(index) => InkWell(
onTap: () {
setState(() {
if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions.remove(model.triageQuestionsModelList[index]);
if (widget.selectedQuestions!.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions!.remove(model.triageQuestionsModelList[index]);
} else {
widget.selectedQuestions.add(model.triageQuestionsModelList[index]);
widget.selectedQuestions!.add(model.triageQuestionsModelList[index]);
}
});
},
@ -53,23 +53,23 @@ class _EdOnlineQuestionsPageState extends State<EdOnlineQuestionsPage> {
child: Row(
children: [
Checkbox(
value: widget.selectedQuestions.contains(model.triageQuestionsModelList[index]),
value: widget.selectedQuestions!.contains(model.triageQuestionsModelList[index]),
activeColor: Color(0xffD02127),
tristate: false,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: (bool newValue) {
onChanged: (bool? newValue) {
setState(() {
if (widget.selectedQuestions.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions.remove(model.triageQuestionsModelList[index]);
if (widget.selectedQuestions!.contains(model.triageQuestionsModelList[index])) {
widget.selectedQuestions!.remove(model.triageQuestionsModelList[index]);
} else {
widget.selectedQuestions.add(model.triageQuestionsModelList[index]);
widget.selectedQuestions!.add(model.triageQuestionsModelList[index]);
}
});
}),
SizedBox(width: 6),
Expanded(
child: Text(
model.triageQuestionsModelList[index].question,
model.triageQuestionsModelList[index].question!,
overflow: TextOverflow.clip,
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),
elevation: 0,
onPressed: () {
widget.changePageViewIndex(0);
widget.changePageViewIndex!(0);
},
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),
disabledBackgroundColor: Color(0xFFbcc2c4).withOpacity(0.12),
elevation: 0,
onPressed: widget.selectedQuestions.isEmpty
onPressed: widget.selectedQuestions!.isEmpty
? null
: () {
GifLoaderDialogUtils.showMyDialog(context);
model
.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) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: model.error);
else {
widget.changePageViewIndex(4);
widget.changePageViewIndex!(4);
}
}).catchError((onError) {
GifLoaderDialogUtils.hideDialog(context);

@ -17,16 +17,16 @@ class EdOnlineSelectedHospitalPage extends StatefulWidget {
final Function changePageViewIndex;
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
_EdOnlineSelectedHospitalPageState createState() => _EdOnlineSelectedHospitalPageState();
}
class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalPage> {
HospitalsModel selectedProject;
late HospitalsModel selectedProject;
final GlobalKey locationDropdownKey = GlobalKey();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
int _selected = 0;
@override
@ -83,13 +83,13 @@ class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalP
value: item,
child: Row(
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(),
onChanged: (newValue) {
setState(() {
selectedProject = newValue;
selectedProject = newValue!;
widget.triageInformationRequest.selectedHospital = selectedProject;
});
},
@ -160,9 +160,9 @@ class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalP
);
}
void onRadioChanged(int value) {
void onRadioChanged(int? value) {
setState(() {
_selected = value;
_selected = value!;
});
}
}

@ -24,15 +24,15 @@ import 'package:provider/provider.dart';
class EdPaymentInformationPage extends StatefulWidget {
final HospitalsModel selectedHospital;
const EdPaymentInformationPage({Key key, this.selectedHospital}) : super(key: key);
const EdPaymentInformationPage({Key? key, required this.selectedHospital}) : super(key: key);
@override
_EdPaymentInformationPageState createState() => _EdPaymentInformationPageState();
}
class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
MyInAppBrowser browser;
ProjectViewModel projectViewModel;
late MyInAppBrowser browser;
late ProjectViewModel projectViewModel;
String transID = "";
@override
@ -70,12 +70,12 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
child: _getNormalText(TranslationBase.of(context).patientShareToDo),
),
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(
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
@ -85,12 +85,12 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
),
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(
width: double.infinity,
padding: EdgeInsets.only(top: 3, bottom: 3),
@ -100,7 +100,7 @@ class _EdPaymentInformationPageState extends State<EdPaymentInformationPage> {
child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
),
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(),
() {
Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {});
}, patientShare: model.erPatientShareModel.patientShareWithTax, isFromAdvancePayment: true,
}, patientShare: model.erPatientShareModel.patientShareWithTax!, isFromAdvancePayment: true,
))).then(
(value) {
print(value);
if (value != null) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
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) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
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,
authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context);
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,
authenticatedUser.firstName!, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context);
}
onBrowserLoadStart(String url) {

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

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

@ -17,7 +17,7 @@ import 'package:provider/provider.dart';
class OrderLogPage extends StatelessWidget {
final AmRequestViewModel amRequestViewModel;
OrderLogPage({Key key, @required this.amRequestViewModel});
OrderLogPage({Key? key, required this.amRequestViewModel});
@override
Widget build(BuildContext context) {
@ -27,21 +27,21 @@ class OrderLogPage extends StatelessWidget {
showDialog(
context: context,
builder: (cxt) => ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
// GifLoaderDialogUtils.showMyDialog(context);
await model.updatePressOrder(presOrderID: presOrderID);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
// GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
// GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
// GifLoaderDialogUtils.showMyDialog(context);
await model.updatePressOrder(presOrderID: presOrderID);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
// GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
// GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
return;
}
@ -56,9 +56,9 @@ class OrderLogPage extends StatelessWidget {
itemBuilder: (context, index) {
AmbulanceRequestOrdersModel order = amRequestViewModel.patientAmbulanceRequestOrdersList.reversed.toList()[index];
int status = order.statusId;
String _statusDisp = order.statusText;
Color _color;
int status = order.statusId!;
String _statusDisp = order.statusText!;
Color? _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -130,7 +130,7 @@ class OrderLogPage extends StatelessWidget {
),
Expanded(
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),
),
),
@ -145,7 +145,7 @@ class OrderLogPage extends StatelessWidget {
),
Expanded(
child: Text(
order.serviceText,
order.serviceText!,
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)
InkWell(
onTap: () {
showConfirmMessage(amRequestViewModel, order.iD, context);
showConfirmMessage(amRequestViewModel, order.iD!, context);
},
child: Container(
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),
),
Text(
order.pickupLocation.trim().toString(),
order.pickupLocation!.trim().toString(),
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),
),
Text(
order.dropOffLocation.trim().toString(),
order.dropOffLocation!.trim().toString(),
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';
class RRTAgreementPage extends StatelessWidget{
TranslationBase localize;
late TranslationBase localize;
@override
Widget build(BuildContext context) {

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

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

@ -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));
class RRTLogListItem extends StatefulWidget {
final GetCMCAllOrdersResponseModel order;
final Function(GetCMCAllOrdersResponseModel) onCancel;
final GetCMCAllOrdersResponseModel? order;
final Function(GetCMCAllOrdersResponseModel)? onCancel;
RRTLogListItem(this.order, {this.onCancel});
@override
State<StatefulWidget> createState() => RRTLogListItemState();
BuildContext _context;
late BuildContext _context;
}
class RRTLogListItemState extends State<RRTLogListItem> {
RRTViewModel viewModel;
TranslationBase localize;
late RRTViewModel viewModel;
late TranslationBase localize;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
localize = TranslationBase.of(context);
int status = widget.order.statusId;
String _statusDisp = widget.order.statusText;
Color _color;
int status = widget.order!.statusId!;
String _statusDisp = widget.order!.statusText!;
Color? _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
@ -100,7 +101,7 @@ class RRTLogListItemState extends State<RRTLogListItem> {
),
SizedBox(height: 6),
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),
),
// Row(
@ -127,7 +128,7 @@ class RRTLogListItemState extends State<RRTLogListItem> {
),
Expanded(
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),
),
),
@ -141,11 +142,11 @@ class RRTLogListItemState extends State<RRTLogListItem> {
crossAxisAlignment: CrossAxisAlignment.end,
children: [
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),
),
SizedBox(height: 12),
if (widget.order.statusId == 1 || widget.order.statusId == 2)
if (widget.order!.statusId == 1 || widget.order!.statusId == 2)
InkWell(
onTap: () {
//onCancel(order);

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

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

@ -22,7 +22,7 @@ class RRTRequestPage extends StatefulWidget {
final ServicePrice servicePrice;
RRTViewModel viewModel;
RRTRequestPage({this.pendingOrders, this.servicePrice, this.viewModel});
RRTRequestPage({required this.pendingOrders, required this.servicePrice, required this.viewModel});
@override
State<StatefulWidget> createState() => RRTRequestPageState();
@ -30,7 +30,7 @@ class RRTRequestPage extends StatefulWidget {
class RRTRequestPageState extends State<RRTRequestPage> {
bool acceptTerms = false;
VidaProcedureList selectedProcedure;
late VidaProcedureList selectedProcedure;
@override
void initState() {
@ -95,7 +95,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
toggleable: true,
onChanged: (value) {
setState(() {
selectedProcedure = value;
selectedProcedure = value!;
print(selectedProcedure.procedureName);
// getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
});
@ -104,7 +104,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
Expanded(
child: Text(
// projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
widget.viewModel.rrtProcedureList[index].procedureName,
widget.viewModel.rrtProcedureList[index].procedureName!,
style: TextStyle(
fontSize: 12.0,
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(
height: 35,
margin: EdgeInsets.symmetric(horizontal: 10),
@ -216,7 +216,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
Checkbox(
value: acceptTerms,
onChanged: (v) {
setState(() => acceptTerms = v);
setState(() => acceptTerms = v!);
}),
SizedBox(width: 10),
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 {
final AppoitmentAllHistoryResultList appointment;
const AppointmentCard({Key key, this.appointment}) : super(key: key);
const AppointmentCard({Key? key, required this.appointment}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
@ -22,8 +22,8 @@ class AppointmentCard extends StatelessWidget {
child: Row(
children: [
LargeAvatar(
url: appointment.doctorImageURL,
name: appointment.doctorNameObj,
url: appointment.doctorImageURL!,
name: appointment.doctorNameObj!,
),
Expanded(
child: Padding(
@ -35,7 +35,7 @@ class AppointmentCard extends StatelessWidget {
SizedBox(height: 4,),
Texts(appointment.projectName),
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 Function changeCurrentTab;
StepsWidget({Key key, this.index, this.changeCurrentTab});
StepsWidget({Key? key, required this.index, required this.changeCurrentTab});
@override
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

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

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

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

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

@ -8,12 +8,12 @@ import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'draggable_cam.dart';
class CamViewWidget extends StatefulWidget {
RTCVideoRenderer localRenderer;
RTCVideoRenderer remoteRenderer;
MediaStream localStream;
BoxConstraints constraints;
StreamController<bool> onButtonBarVisibleStreamController;
StreamController<double> onButtonBarHeightStreamController;
RTCVideoRenderer? localRenderer;
RTCVideoRenderer? remoteRenderer;
MediaStream? localStream;
BoxConstraints? constraints;
StreamController<bool>? onButtonBarVisibleStreamController;
StreamController<double>? 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,
child: Container(
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: RTCVideoView(widget.remoteRenderer)
child: RTCVideoView(widget.remoteRenderer!)
),
DraggableCam(
key: Key('publisher'),
onButtonBarHeight: widget.onButtonBarHeightStreamController.stream,
onButtonBarVisible: widget.onButtonBarVisibleStreamController.stream,
availableScreenSize: widget.constraints.biggest,
child: RTCVideoView(widget.localRenderer)
onButtonBarHeight: widget.onButtonBarHeightStreamController!.stream,
onButtonBarVisible: widget.onButtonBarVisibleStreamController!.stream,
availableScreenSize: widget.constraints!.biggest,
child: RTCVideoView(widget.localRenderer!)
),
if(widget.remoteRenderer.srcObject == null)
if(widget.remoteRenderer!.srcObject == null)
Container(
margin: EdgeInsets.all(MediaQuery.of(context).size.width/8),
child: Text(

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

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

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

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

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

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

@ -7,8 +7,8 @@ typedef ResponsiveBuilder = Widget Function(
class ResponsiveSafeArea extends StatelessWidget {
const ResponsiveSafeArea({
@required ResponsiveBuilder builder,
Key key,
required ResponsiveBuilder builder,
Key? key,
}) : responsiveBuilder = builder,
assert(builder != null),
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,
[String? procedureID, num? testTypeEnum, num? testProcedureEnum, required ProjectViewModel projectViewModel]) async {
[String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -1843,6 +1843,4 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
}

@ -1,20 +1,20 @@
import 'package:flutter/material.dart';
class CustomTextButton extends StatelessWidget {
final Color backgroundColor;
final Color disabledColor;
final void Function() onPressed;
final void Function() onLongPress;
final void Function(bool) onHover;
final Widget child;
final OutlinedBorder shape;
final double elevation;
final BorderSide side;
final Color disabledForegroundColor;
final Color disabledBackgroundColor;
final Color? backgroundColor;
final Color? disabledColor;
final void Function()? onPressed;
final void Function()? onLongPress;
final void Function(bool)? onHover;
final Widget? child;
final OutlinedBorder? shape;
final double? elevation;
final BorderSide? side;
final Color? disabledForegroundColor;
final Color? disabledBackgroundColor;
const CustomTextButton({
Key key,
Key? key,
this.backgroundColor,
this.disabledColor,
this.onPressed,
@ -40,7 +40,7 @@ class CustomTextButton extends StatelessWidget {
side: side,
),
onPressed: onPressed,
child: child,
child: child!,
);
}
}

@ -198,16 +198,21 @@ class DoctorCard extends StatelessWidget {
// ),
RatingBar(
initialRating: rating!,
// size: 18.0,
// filledColor: Color(0XFFD02127),
// emptyColor: Color(0XFFD02127),
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: ,
//
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) { }),
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) {}),
],
),
if (remainingTimeInMinutes != null)

@ -12,9 +12,9 @@ import 'my_rich_text.dart';
class HospitalLocation extends StatelessWidget {
final GetHMGLocationsModel location;
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
Widget build(BuildContext context) {

Loading…
Cancel
Save