dev_v3.13.6_voipcall
devamirsaleemahmad 1 year ago
parent 6a6ac76973
commit c1fd6313b1

@ -10,7 +10,7 @@ class TodoList{
// R047.1 // R047.1
to_do_list_pay_now(AppoitmentAllHistoryResultList appointment){ to_do_list_pay_now(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_pay_now', parameters: { logger('to_do_list_pay_now', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,
@ -21,7 +21,7 @@ class TodoList{
// R047.2 // R047.2
to_do_list_more_details(AppoitmentAllHistoryResultList appointment){ to_do_list_more_details(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_more_details', parameters: { logger('to_do_list_more_details', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,
@ -32,7 +32,7 @@ class TodoList{
// R048 // R048
to_do_list_confirm_payment_details(AppoitmentAllHistoryResultList appointment){ to_do_list_confirm_payment_details(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_confirm_payment_details', parameters: { logger('to_do_list_confirm_payment_details', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,
@ -43,7 +43,7 @@ class TodoList{
// R048 // R048
to_do_list_cancel_payment_details(AppoitmentAllHistoryResultList appointment){ to_do_list_cancel_payment_details(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_cancel_payment_details', parameters: { logger('to_do_list_cancel_payment_details', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,
@ -56,7 +56,7 @@ class TodoList{
// R049.2 // R049.2
to_do_list_cancel_appointment(AppoitmentAllHistoryResultList appointment){ to_do_list_cancel_appointment(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_cancel_appointment', parameters: { logger('to_do_list_cancel_appointment', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,
@ -67,7 +67,7 @@ class TodoList{
// R049.3 // R049.3
to_do_list_confirm_appointment(AppoitmentAllHistoryResultList appointment){ to_do_list_confirm_appointment(AppoitmentAllHistoryResultList appointment){
logger('confirm_appointment', parameters: { logger('confirm_appointment', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'flow_type' : 'todo list', 'flow_type' : 'todo list',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
@ -79,7 +79,7 @@ class TodoList{
// R050 // R050
to_do_list_check_in(AppoitmentAllHistoryResultList appointment){ to_do_list_check_in(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_check_in', parameters: { logger('to_do_list_check_in', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,
@ -90,7 +90,7 @@ class TodoList{
// R051 // R051
to_do_list_nfc(AppoitmentAllHistoryResultList appointment){ to_do_list_nfc(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_nfc', parameters: { logger('to_do_list_nfc', parameters: {
'appointment_type' : appointment.isLiveCareAppointment ? 'livecare' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment! ? 'livecare' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,
@ -101,7 +101,7 @@ class TodoList{
// R052 // R052
to_do_list_nfc_cancel(AppoitmentAllHistoryResultList appointment){ to_do_list_nfc_cancel(AppoitmentAllHistoryResultList appointment){
logger('to_do_list_nfc_cancel', parameters: { logger('to_do_list_nfc_cancel', parameters: {
'appointment_type' : appointment.isLiveCareAppointment != null ? appointment.isLiveCareAppointment ? 'livecare' : 'regular' : 'regular', 'appointment_type' : appointment.isLiveCareAppointment != null ? appointment.isLiveCareAppointment! ? 'livecare' : 'regular' : 'regular',
'clinic_type_online' : appointment.clinicName, 'clinic_type_online' : appointment.clinicName,
'hospital_name' : appointment.projectName, 'hospital_name' : appointment.projectName,
'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName,

@ -108,7 +108,7 @@ class H2OViewModel extends BaseViewModel {
minValue = -1; minValue = -1;
} }
return [ return [
new charts.Series<ChartSeries, String>( new charts.series<ChartSeries, String>(
id: 'Global Revenue', id: 'Global Revenue',
domainFn: (ChartSeries sales, _) => sales.y, domainFn: (ChartSeries sales, _) => sales.y,
measureFn: (ChartSeries sales, _) => sales.x, measureFn: (ChartSeries sales, _) => sales.x,

@ -48,7 +48,10 @@ class QrViewModel extends BaseViewModel {
} else { } else {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).cameraPermissionDialog, () async { Utils.showPermissionConsentDialog(AppGlobal.context, TranslationBase.of(AppGlobal.context).cameraPermissionDialog, () async {
return (await BarcodeScanner.scan()).rawContent; await BarcodeScanner.scan().then((value) {
return value.rawContent;
//Chnanges by Aamir
});
}); });
} else { } else {
return (await BarcodeScanner.scan()).rawContent; return (await BarcodeScanner.scan()).rawContent;

@ -81,7 +81,7 @@ class _MyApp extends State<MyApp> {
PlatformBridge.init(context); PlatformBridge.init(context);
LocalNotification.init(onNotificationClick: (payload) { LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload); LocalNotification.getInstance()!.showNow(title: "Payload", subtitle: payload, payload: payload);
}); });
// SystemChrome.setPreferredOrientations([ // SystemChrome.setPreferredOrientations([

@ -35,7 +35,7 @@ class CMCLocationPage extends StatefulWidget {
final double longitude; final double longitude;
final dynamic model; final dynamic model;
const CMCLocationPage({ Key? key, required this.onPick, required this.latitude, required this.longitude, this.model}) : super(key: key); const CMCLocationPage({Key? key, required this.onPick, required this.latitude, required this.longitude, this.model}) : super(key: key);
@override @override
_CMCLocationPageState createState() => _CMCLocationPageState(); _CMCLocationPageState createState() => _CMCLocationPageState();
@ -65,8 +65,8 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
appMap = AppMap( appMap = AppMap(
_kGooglePlex.toMap() as Map<dynamic, dynamic>, _kGooglePlex.toMap() as Map<dynamic, dynamic>,
// changed by Aamir // changed by Aamir
onCameraMove: (cam) { onCameraMove: () {
_updatePosition(cam as gmaps.CameraPosition); _updatePosition(_kGooglePlex);
// changed by Aamir Huawei & Google Issue may Be // changed by Aamir Huawei & Google Issue may Be
}, },
onMapCreated: () { onMapCreated: () {

@ -97,10 +97,10 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
appMap = AppMap( appMap = AppMap(
cameraPosition.toMap() as Map<dynamic, dynamic>, cameraPosition.toMap() as Map<dynamic, dynamic>,
// Changed by Aamir // Changed by Aamir
onCameraMove: (camera) { onCameraMove: () {
setState(() {}); // setState(() {});
// Changed by Aamir // Changed by Aamir
_updatePosition(camera as gmaps.CameraPosition); _updatePosition(cameraPosition);
}, },
onMapCreated: () { onMapCreated: () {
print("_getUserLocation"); print("_getUserLocation");

@ -24,7 +24,7 @@ import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget { class DoctorView extends StatelessWidget {
final DoctorList doctor; final DoctorList doctor;
bool isLiveCareAppointment; bool? isLiveCareAppointment;
bool isObGyneAppointment; bool isObGyneAppointment;
bool isShowFlag; bool isShowFlag;
bool isDoctorNameSearch; bool isDoctorNameSearch;
@ -33,7 +33,7 @@ class DoctorView extends StatelessWidget {
DoctorView( DoctorView(
{required this.doctor, {required this.doctor,
required this.isLiveCareAppointment, this.isLiveCareAppointment,
this.isObGyneAppointment = false, this.isObGyneAppointment = false,
this.isDoctorNameSearch = false, this.isDoctorNameSearch = false,
this.isShowFlag = true, this.isShowFlag = true,
@ -263,7 +263,7 @@ class DoctorView extends StatelessWidget {
FadePage( FadePage(
page: DoctorProfile( page: DoctorProfile(
doctor: docObject, doctor: docObject,
isLiveCareAppointment: isLiveCareAppointment, isLiveCareAppointment: isLiveCareAppointment!,
docProfileList: docProfile, docProfileList: docProfile,
isOpenAppt: isAppo, isOpenAppt: isAppo,
isDoctorNameSearch: isDoctorNameSearch, isDoctorNameSearch: isDoctorNameSearch,

@ -17,9 +17,9 @@ import '../base/base_view.dart';
import 'insurance_approval_detail_screen.dart'; import 'insurance_approval_detail_screen.dart';
class InsuranceApproval extends StatefulWidget { class InsuranceApproval extends StatefulWidget {
int appointmentNo; int? appointmentNo;
InsuranceApproval({required this.appointmentNo}); InsuranceApproval({ this.appointmentNo});
@override @override
_InsuranceApprovalState createState() => _InsuranceApprovalState(); _InsuranceApprovalState createState() => _InsuranceApprovalState();

@ -19,9 +19,9 @@ import 'package:flutter/material.dart';
import '../base/base_view.dart'; import '../base/base_view.dart';
class InsuranceCard extends StatefulWidget { class InsuranceCard extends StatefulWidget {
int appointmentNo; int? appointmentNo;
InsuranceCard({required this.appointmentNo}); InsuranceCard({ this.appointmentNo});
@override @override
_InsuranceCardState createState() => _InsuranceCardState(); _InsuranceCardState createState() => _InsuranceCardState();

@ -469,9 +469,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
child: AppBar( child: AppBar(
elevation: 0, elevation: 0,
backgroundColor: CustomColors.backgroudGreyColor, backgroundColor: CustomColors.backgroudGreyColor,
textTheme: TextTheme( //Changed By Aamir
headline6: TextStyle(color: Theme.of(context).textTheme.headline1!.color, fontWeight: FontWeight.bold), // textTheme: TextTheme(
), // headline6: TextStyle(color: Theme.of(context).textTheme.headline1!.color, fontWeight: FontWeight.bold),
// ),
title: Text( title: Text(
getText(currentTab).toUpperCase(), getText(currentTab).toUpperCase(),
style: TextStyle( style: TextStyle(

@ -15,14 +15,14 @@ class ClinicTimingsPage extends StatefulWidget {
final clinicName; final clinicName;
final List<PatientERGetClinicsServiceTimingsList> patientERGetClinicsServiceTimingsList; final List<PatientERGetClinicsServiceTimingsList> patientERGetClinicsServiceTimingsList;
ClinicTimingsPage({@required this.clinicName, @required this.patientERGetClinicsServiceTimingsList}); ClinicTimingsPage({required this.clinicName, required this.patientERGetClinicsServiceTimingsList});
@override @override
_LiveCarePatmentPageState createState() => _LiveCarePatmentPageState(); _LiveCarePatmentPageState createState() => _LiveCarePatmentPageState();
} }
class _LiveCarePatmentPageState extends State<ClinicTimingsPage> { class _LiveCarePatmentPageState extends State<ClinicTimingsPage> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -80,7 +80,7 @@ class _LiveCarePatmentPageState extends State<ClinicTimingsPage> {
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
item.dayOfWeekStr, item.dayOfWeekStr!,
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
letterSpacing: -0.72, letterSpacing: -0.72,
@ -98,9 +98,9 @@ class _LiveCarePatmentPageState extends State<ClinicTimingsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
for (int i = 0; i < item.shiftTimings.length; i++) for (int i = 0; i < item.shiftTimings!.length; i++)
Text( Text(
TranslationBase.of(context).from + " " + item.shiftTimings[i].startTime + " " + TranslationBase.of(context).to + " " + item.shiftTimings[i].endTime, TranslationBase.of(context).from + " " + item.shiftTimings![i].startTime! + " " + TranslationBase.of(context).to + " " + item.shiftTimings![i].endTime!,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
letterSpacing: -0.42, letterSpacing: -0.42,

@ -20,19 +20,19 @@ import '../../config/config.dart';
class IncomingCall extends StatefulWidget { class IncomingCall extends StatefulWidget {
IncomingCallData incomingCallData; IncomingCallData incomingCallData;
IncomingCall({@required this.incomingCallData}); IncomingCall({required this.incomingCallData});
@override @override
_IncomingCallState createState() => _IncomingCallState(); _IncomingCallState createState() => _IncomingCallState();
} }
class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderStateMixin { class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderStateMixin {
AnimationController _animationController; late AnimationController _animationController;
bool openCallInWeb = true; bool openCallInWeb = true;
final player = AudioPlayer(); final player = AudioPlayer();
CameraController _controller; late CameraController _controller;
Future<void> _initializeControllerFuture; late Future<void> _initializeControllerFuture;
bool isCameraReady = false; bool isCameraReady = false;
// Signaling signaling = Signaling()..init(); // Signaling signaling = Signaling()..init();
@ -74,7 +74,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
// child: new BackdropFilter( // child: new BackdropFilter(
// filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), // filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
child: new Container( child: new Container(
decoration: new BoxDecoration(color: Colors.grey[800].withOpacity(0.8)), decoration: new BoxDecoration(color: Colors.grey[800]!.withOpacity(0.8)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -96,7 +96,7 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Text( Text(
widget.incomingCallData.doctorname, widget.incomingCallData.doctorname!,
style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white, letterSpacing: -1.26, height: 23 / 12), style: TextStyle(fontSize: 21, fontWeight: FontWeight.bold, color: Colors.white, letterSpacing: -1.26, height: 23 / 12),
), ),
Text( Text(
@ -128,14 +128,14 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
Container( Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0), padding: const EdgeInsets.only(left: 16.0, right: 16.0),
child: Text( child: Text(
widget.incomingCallData.appointmentdate + ", " + widget.incomingCallData.appointmenttime, widget.incomingCallData.appointmentdate! + ", " + widget.incomingCallData.appointmenttime!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600), style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
), ),
), ),
Container( Container(
padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 21.0), padding: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 21.0),
child: Text( child: Text(
widget.incomingCallData.clinicname, widget.incomingCallData.clinicname!,
style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600), style: TextStyle(fontSize: 12.0, letterSpacing: -0.48, color: Color(0xff8E8E8E), fontWeight: FontWeight.w600),
), ),
), ),
@ -232,8 +232,8 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
// }else{ // }else{
return OpenTokConnectCallPage( return OpenTokConnectCallPage(
apiKey: OPENTOK_API_KEY, apiKey: OPENTOK_API_KEY,
sessionId: widget.incomingCallData.sessionId, sessionId: widget.incomingCallData.sessionId!,
token: widget.incomingCallData.token token: widget.incomingCallData.token!
); );
// } // }
@ -247,14 +247,14 @@ class _IncomingCallState extends State<IncomingCall> with SingleTickerProviderSt
} catch (err) { } catch (err) {
print(err); print(err);
await PlatformExceptionAlertDialog( await PlatformExceptionAlertDialog(
exception: err, exception: Exception(err),
).show(context); ).show(context);
} }
} }
void changeCallStatusAPI(int sessionStatus) { void changeCallStatusAPI(int sessionStatus) {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
service.endCallAPI(widget.incomingCallData.sessionId, sessionStatus, context).then((res) { service.endCallAPI(widget.incomingCallData.sessionId!, sessionStatus, context).then((res) {
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}); });

@ -26,7 +26,7 @@ class LiveCarePatmentPage extends StatefulWidget {
bool isPharmaLiveCare; bool isPharmaLiveCare;
String pharmaLiveCareClientID; String pharmaLiveCareClientID;
LiveCarePatmentPage({@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName, this.isPharmaLiveCare = false, this.pharmaLiveCareClientID = ""}); LiveCarePatmentPage({required this.getERAppointmentFeesList, required this.waitingTime, required this.clinicName, this.isPharmaLiveCare = false, this.pharmaLiveCareClientID = ""});
@override @override
_LiveCarePatmentPageState createState() => _LiveCarePatmentPageState(); _LiveCarePatmentPageState createState() => _LiveCarePatmentPageState();
@ -35,8 +35,8 @@ class LiveCarePatmentPage extends StatefulWidget {
class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> { class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
int _selected = 0; int _selected = 0;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
LocationUtils locationUtils; late LocationUtils locationUtils;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -127,7 +127,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
widget.getERAppointmentFeesList.amount + " " + widget.getERAppointmentFeesList.currency, widget.getERAppointmentFeesList.amount! + " " + widget.getERAppointmentFeesList.currency!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -155,7 +155,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
widget.getERAppointmentFeesList.tax + " " + widget.getERAppointmentFeesList.currency, widget.getERAppointmentFeesList.tax! + " " + widget.getERAppointmentFeesList.currency!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -183,7 +183,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
), ),
Expanded( Expanded(
child: Text( child: Text(
widget.getERAppointmentFeesList.total + " " + widget.getERAppointmentFeesList.currency, widget.getERAppointmentFeesList.total! + " " + widget.getERAppointmentFeesList.currency!,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -229,7 +229,9 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
Radio( Radio(
value: 1, value: 1,
groupValue: _selected, groupValue: _selected,
onChanged: onRadioChanged, onChanged: (val) {
onRadioChanged(val!);
},
), ),
Text( Text(
TranslationBase.of(context).agreeTo, TranslationBase.of(context).agreeTo,
@ -243,7 +245,9 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
mWidth(4), mWidth(4),
InkWell( InkWell(
onTap: () { onTap: () {
launch("https://hmg.com/en/Pages/Privacy.aspx"); launchUrl(Uri.parse(
"https://hmg.com/en/Pages/Privacy.aspx",
));
}, },
child: Text( child: Text(
TranslationBase.of(context).termsConditoins, TranslationBase.of(context).termsConditoins,
@ -341,9 +345,10 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
} }
Future<bool> askVideoCallPermission() async { Future<bool> askVideoCallPermission() async {
bool result = false;
if (Platform.isIOS) { if (Platform.isIOS) {
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) {
return false; result = false;
} }
} else { } else {
await showDialog( await showDialog(
@ -357,12 +362,15 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
!(await Permission.camera.request().isGranted) || !(await Permission.camera.request().isGranted) ||
!(await Permission.microphone.request().isGranted) || !(await Permission.microphone.request().isGranted) ||
!(await Permission.location.request().isGranted)) { !(await Permission.location.request().isGranted)) {
return false; {
result = false;
}
} }
}, },
)); ));
} }
return true; result = true;
return result;
// if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { // if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) {
// return false; // return false;
// } // }
@ -415,7 +423,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
}); });
} }
void onRadioChanged(int value) { onRadioChanged(int value) {
setState(() { setState(() {
_selected = value; _selected = value;
}); });

@ -20,24 +20,24 @@ class LiveCareHome extends StatefulWidget {
final bool isPharmacyLiveCare; final bool isPharmacyLiveCare;
final String pharmacyLiveCareQRCode; final String pharmacyLiveCareQRCode;
const LiveCareHome({Key key, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""}) : super(key: key); const LiveCareHome({Key? key, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""}) : super(key: key);
@override @override
_LiveCareHomeState createState() => _LiveCareHomeState(); _LiveCareHomeState createState() => _LiveCareHomeState();
} }
class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderStateMixin { class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
bool isDataLoaded = false; bool isDataLoaded = false;
bool hasLiveCareRequest = false; bool hasLiveCareRequest = false;
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
List<ErRequestHistoryList> erRequestHistoryList; late List<ErRequestHistoryList> erRequestHistoryList;
ErRequestHistoryList pendingERRequestHistoryList; late ErRequestHistoryList pendingERRequestHistoryList;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
@ -157,11 +157,11 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
if (res['ErRequestHistoryList'].length != 0) { if (res['ErRequestHistoryList'].length != 0) {
patientERVirtualHistoryResponse = PatientERVirtualHistoryResponse.fromJson(res); patientERVirtualHistoryResponse = PatientERVirtualHistoryResponse.fromJson(res as Map<String, dynamic>);
erRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList; erRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList!;
if (patientERVirtualHistoryResponse.erRequestHistoryList[0].callStatus < 4) { if (patientERVirtualHistoryResponse.erRequestHistoryList![0].callStatus! < 4) {
pendingERRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList[0]; pendingERRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList![0];
hasLiveCareRequest = true; hasLiveCareRequest = true;
} else { } else {
hasLiveCareRequest = false; hasLiveCareRequest = false;

@ -22,7 +22,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
var languageID; var languageID;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
String pharmacyLiveCareQRCode = ""; String pharmacyLiveCareQRCode = "";
@override @override
@ -195,7 +195,10 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
} }
readQRCode() async { readQRCode() async {
pharmacyLiveCareQRCode = (await BarcodeScanner.scan())?.rawContent; //Changed By Aamir
pharmacyLiveCareQRCode = await BarcodeScanner.scan().then((value) {
return value.rawContent;
});
if (pharmacyLiveCareQRCode != "") { if (pharmacyLiveCareQRCode != "") {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();

@ -14,14 +14,14 @@ import 'package:provider/provider.dart';
import '../../uitl/utils.dart'; import '../../uitl/utils.dart';
class PharmaLiveCareIntroPage extends StatefulWidget { class PharmaLiveCareIntroPage extends StatefulWidget {
const PharmaLiveCareIntroPage({Key key}) : super(key: key); const PharmaLiveCareIntroPage({Key? key}) : super(key: key);
@override @override
State<PharmaLiveCareIntroPage> createState() => _PharmaLiveCareIntroPageState(); State<PharmaLiveCareIntroPage> createState() => _PharmaLiveCareIntroPageState();
} }
class _PharmaLiveCareIntroPageState extends State<PharmaLiveCareIntroPage> { class _PharmaLiveCareIntroPageState extends State<PharmaLiveCareIntroPage> {
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
String pharmacyLiveCareQRCode = ""; String pharmacyLiveCareQRCode = "";
@override @override
@ -186,7 +186,9 @@ class _PharmaLiveCareIntroPageState extends State<PharmaLiveCareIntroPage> {
} }
readQRCode() async { readQRCode() async {
pharmacyLiveCareQRCode = (await BarcodeScanner.scan())?.rawContent; pharmacyLiveCareQRCode = await BarcodeScanner.scan().then((value) {
return value.rawContent;
});
if (pharmacyLiveCareQRCode != "") { if (pharmacyLiveCareQRCode != "") {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();

@ -8,12 +8,12 @@ class VideoCallWebPage extends StatelessWidget{
final GlobalKey webViewKey = GlobalKey(); final GlobalKey webViewKey = GlobalKey();
// InAppWebViewController webViewController; // InAppWebViewController webViewController;
InAppWebViewController controller; InAppWebViewController? controller;
URLRequest request; URLRequest? request;
final String receiverId; final String receiverId;
final String callerId; final String callerId;
VideoCallWebPage({@required this.receiverId, @required this.callerId}){ VideoCallWebPage({required this.receiverId, required this.callerId}){
request = URLRequest(url: Uri.parse("https://vcallapi.hmg.com/Mobileindex.html?username=$receiverId&doctorid=$callerId")); request = URLRequest(url: Uri.parse("https://vcallapi.hmg.com/Mobileindex.html?username=$receiverId&doctorid=$callerId"));
} }
@ -92,18 +92,18 @@ class VideoCallWebPage extends StatelessWidget{
print(consoleMessage); print(consoleMessage);
} }
onError(InAppWebViewController controller, Uri url, int code, String message) { onError(InAppWebViewController? controller, Uri? url, int code, String message) {
} }
onLoadStart(InAppWebViewController controller, Uri url) { onLoadStart(InAppWebViewController? controller, Uri? url) {
print(url); print(url);
if(url.toString().toLowerCase().contains("endcallpage")){ if(url.toString().toLowerCase().contains("endcallpage")){
LandingPage.isOpenCallPage = false; LandingPage.isOpenCallPage = false;
if(LandingPage.isOpenCallPage == true) { if(LandingPage.isOpenCallPage == true) {
print("END CALL!!!"); print("END CALL!!!");
// controller.goBack(); // controller.goBack();
Navigator.pop(webViewKey.currentContext); Navigator.pop(webViewKey.currentContext!);
} }
} }
} }
@ -114,7 +114,7 @@ class VideoCallWebPage extends StatelessWidget{
// Navigator.pop(webViewKey.currentContext); // Navigator.pop(webViewKey.currentContext);
// } // }
if(uri.toString().toLowerCase().contains("endcallpage")){ if(uri.toString().toLowerCase().contains("endcallpage")){
Navigator.pop(webViewKey.currentContext); Navigator.pop(webViewKey.currentContext!);
} }
return NavigationActionPolicy.ALLOW; return NavigationActionPolicy.ALLOW;

@ -4,12 +4,9 @@ import 'package:flutter/material.dart';
class ClinicTimingsDialog extends StatefulWidget { class ClinicTimingsDialog extends StatefulWidget {
final clinicName; final clinicName;
final List<PatientERGetClinicsServiceTimingsList> final List<PatientERGetClinicsServiceTimingsList> patientERGetClinicsServiceTimingsList;
patientERGetClinicsServiceTimingsList;
ClinicTimingsDialog( ClinicTimingsDialog({required this.clinicName, required this.patientERGetClinicsServiceTimingsList});
{@required this.clinicName,
@required this.patientERGetClinicsServiceTimingsList});
@override @override
_ClinicTimingsDialogState createState() => _ClinicTimingsDialogState(); _ClinicTimingsDialogState createState() => _ClinicTimingsDialogState();
@ -29,8 +26,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
return Container( return Container(
child: Dialog( child: Dialog(
shape: shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container( child: Container(
height: 580.0, height: 580.0,
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
@ -42,10 +38,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
child: Text(TranslationBase.of(context).clinicSchedule, child: Text(TranslationBase.of(context).clinicSchedule, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
textAlign: TextAlign.center,
style:
TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), ),
Divider( Divider(
thickness: 1.0, thickness: 1.0,
@ -53,9 +46,7 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 20.0, top: 10.0), margin: EdgeInsets.only(bottom: 20.0, top: 10.0),
child: Text(widget.clinicName, child: Text(widget.clinicName, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
style:
TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), ),
CustomScrollView( CustomScrollView(
primary: false, primary: false,
@ -72,10 +63,8 @@ class _ClinicTimingsDialogState extends State<ClinicTimingsDialog> {
height: 10.0, height: 10.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Text(e.dayOfWeekStr), Text(e.dayOfWeekStr!),
Text(e.shiftTimings[0].startTime + Text(e.shiftTimings![0].startTime! + " - " + e.shiftTimings![0].endTime!),
" - " +
e.shiftTimings[0].endTime),
], ],
), ),
)) ))

@ -20,8 +20,8 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LiveCareHistoryCard extends StatefulWidget { class LiveCareHistoryCard extends StatefulWidget {
ErRequestHistoryList erRequestHistoryList; ErRequestHistoryList? erRequestHistoryList;
int isFirstOrLast; int? isFirstOrLast;
LiveCareHistoryCard({this.erRequestHistoryList, this.isFirstOrLast}); LiveCareHistoryCard({this.erRequestHistoryList, this.isFirstOrLast});
@ -33,7 +33,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -77,7 +77,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.erRequestHistoryList.stringCallStatus , widget.erRequestHistoryList!.stringCallStatus! ,
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -88,7 +88,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
), ),
mHeight(12), mHeight(12),
Text( Text(
TranslationBase.of(context).requestedDate + ": " + DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList.arrivalTime)), TranslationBase.of(context).requestedDate + ": " + DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList!.arrivalTime!)),
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -103,7 +103,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, letterSpacing: -0.4, color: CustomColors.textColor), style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, letterSpacing: -0.4, color: CustomColors.textColor),
), ),
Text( Text(
getCallTime(widget.erRequestHistoryList.callDuration), getCallTime(widget.erRequestHistoryList!.callDuration!),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
@ -215,7 +215,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
} }
rateLiveCareAppo() { rateLiveCareAppo() {
if (widget.erRequestHistoryList.isAppointmentHaveRating) { if (widget.erRequestHistoryList!.isAppointmentHaveRating!) {
AppToast.showErrorToast(message: TranslationBase.of(context).alreadyRated); AppToast.showErrorToast(message: TranslationBase.of(context).alreadyRated);
} else {} } else {}
} }
@ -224,7 +224,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
showDialog( showDialog(
context: context, context: context,
builder: (cxt) => ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: projectViewModel.user.emailAddress, email: projectViewModel.user!.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
sendInvoiceEmail(context); sendInvoiceEmail(context);
}, },
@ -239,7 +239,7 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
sendInvoiceEmail(context) { sendInvoiceEmail(context) {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList.appointmentNo.toString(), widget.erRequestHistoryList.projectID, authUser.emailAddress, context).then((res) { service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList!.appointmentNo.toString(), widget.erRequestHistoryList!.projectID!, authUser.emailAddress!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully); AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully);
}).catchError((err) { }).catchError((err) {

@ -11,10 +11,7 @@ class LiveCarePaymentDialog extends StatefulWidget {
int waitingTime; int waitingTime;
String clinicName; String clinicName;
LiveCarePaymentDialog( LiveCarePaymentDialog({required this.getERAppointmentFeesList, required this.waitingTime, required this.clinicName});
{@required this.getERAppointmentFeesList,
@required this.waitingTime,
@required this.clinicName});
@override @override
_LiveCarePaymentDialogState createState() => _LiveCarePaymentDialogState(); _LiveCarePaymentDialogState createState() => _LiveCarePaymentDialogState();
@ -23,7 +20,7 @@ class LiveCarePaymentDialog extends StatefulWidget {
class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> { class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
int _selected = 0; int _selected = 0;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,8 +31,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
return Container( return Container(
child: Dialog( child: Dialog(
shape: shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container( child: Container(
height: 600.0, height: 600.0,
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
@ -49,10 +45,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
child: Text(TranslationBase.of(context).onlineConsultation, child: Text(TranslationBase.of(context).onlineConsultation, textAlign: TextAlign.center, style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
textAlign: TextAlign.center,
style:
TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
), ),
Divider( Divider(
thickness: 1.0, thickness: 1.0,
@ -62,31 +55,22 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
direction: Axis.horizontal, direction: Axis.horizontal,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Text(TranslationBase.of(context).expectedWaiting, child: Text(TranslationBase.of(context).expectedWaiting, textAlign: TextAlign.end, style: TextStyle(fontSize: 13.0)),
textAlign: TextAlign.end,
style: TextStyle(fontSize: 13.0)),
), ),
Expanded( Expanded(
child: Container( child: Container(
child: Icon(Icons.access_time, child: Icon(Icons.access_time, size: 36.0, color: Colors.red[800]),
size: 36.0, color: Colors.red[800]),
), ),
), ),
Expanded( Expanded(
child: Text(widget.waitingTime.toString() + " " + TranslationBase.of(context).minute, child: Text(widget.waitingTime.toString() + " " + TranslationBase.of(context).minute,
textAlign: TextAlign.start, textAlign: TextAlign.start, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.red[900])),
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.red[900])),
), ),
], ],
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Text(widget.clinicName, child: Text(widget.clinicName, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
style:
TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold)),
), ),
Container( Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
@ -100,12 +84,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
padding: EdgeInsets.all(5.0), padding: EdgeInsets.all(5.0),
child: Text(TranslationBase.of(context).erConsultFee, child: Text(TranslationBase.of(context).erConsultFee, textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.white)),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.bold,
color: Colors.white)),
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -117,34 +96,16 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
child: Table( child: Table(
children: [ children: [
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
child: _getNormalText( TableCell(child: _getNormalText(widget.getERAppointmentFeesList.amount! + " " + widget.getERAppointmentFeesList.currency!)),
TranslationBase.of(context).patientShareToDo)),
TableCell(
child: _getNormalText(
widget.getERAppointmentFeesList.amount +
" " +
widget.getERAppointmentFeesList.currency)),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
child: _getNormalText( TableCell(child: _getNormalText(widget.getERAppointmentFeesList.tax! + " " + widget.getERAppointmentFeesList.currency!)),
TranslationBase.of(context).patientTaxToDo)),
TableCell(
child: _getNormalText(
widget.getERAppointmentFeesList.tax +
" " +
widget.getERAppointmentFeesList.currency)),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: _getMarginText(TranslationBase.of(context).patientShareTotalToDo)),
child: _getMarginText(TranslationBase.of(context) TableCell(child: _getMarginText(widget.getERAppointmentFeesList.total! + " " + widget.getERAppointmentFeesList.currency!)),
.patientShareTotalToDo)),
TableCell(
child: _getMarginText(
widget.getERAppointmentFeesList.total +
" " +
widget.getERAppointmentFeesList.currency)),
]), ]),
], ],
), ),
@ -155,7 +116,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
borderRadius: new BorderRadius.all( borderRadius: new BorderRadius.all(
const Radius.circular(5.0), const Radius.circular(5.0),
), ),
color: Colors.green[200].withOpacity(0.5)), color: Colors.green[200]!.withOpacity(0.5)),
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -163,8 +124,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
Container( Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0), margin: EdgeInsets.only(left: 10.0, right: 10.0),
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
child: Text(TranslationBase.of(context).insuredPatient, child: Text(TranslationBase.of(context).insuredPatient, style: TextStyle(fontSize: 13.0)),
style: TextStyle(fontSize: 13.0)),
), ),
], ],
), ),
@ -177,7 +137,9 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
child: new Radio( child: new Radio(
value: 1, value: 1,
groupValue: _selected, groupValue: _selected,
onChanged: onRadioChanged, onChanged:(val){
onRadioChanged(val!);
},
), ),
), ),
Container( Container(
@ -217,10 +179,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
Navigator.pop(context, false); Navigator.pop(context, false);
}, },
child: Container( child: Container(
child: Text(TranslationBase.of(context).cancel, child: Text(TranslationBase.of(context).cancel, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, color: Colors.red[700])),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 18.0, color: Colors.red[700])),
), ),
), ),
), ),
@ -228,9 +187,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (_selected == 0) { if (_selected == 0) {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
message: TranslationBase.of(context)
.pleaseAcceptTerms);
} else { } else {
Navigator.pop(context, true); Navigator.pop(context, true);
} }
@ -254,7 +211,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
); );
} }
void onRadioChanged(int value) { onRadioChanged(int value) {
setState(() { setState(() {
_selected = value; _selected = value;
}); });
@ -263,25 +220,14 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
_getNormalText(text) { _getNormalText(text) {
return Container( return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0), margin: EdgeInsets.only(top: 10.0, right: 10.0),
child: Text(text, child: Text(text, textAlign: TextAlign.start, style: TextStyle(fontSize: 14, letterSpacing: 0.5, color: Colors.black)),
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 14,
letterSpacing: 0.5,
color: Colors.black)),
); );
} }
_getMarginText(text) { _getMarginText(text) {
return Container( return Container(
margin: EdgeInsets.only(top: 10.0, right: 10.0, bottom: 10.0), margin: EdgeInsets.only(top: 10.0, right: 10.0, bottom: 10.0),
child: Text(text, child: Text(text, textAlign: TextAlign.start, style: TextStyle(fontSize: 14, letterSpacing: 0.5, fontWeight: FontWeight.bold, color: Colors.black)),
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 14,
letterSpacing: 0.5,
fontWeight: FontWeight.bold,
color: Colors.black)),
); );
} }
} }

@ -15,10 +15,10 @@ import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class LiveCarePendingRequest extends StatefulWidget { class LiveCarePendingRequest extends StatefulWidget {
ErRequestHistoryList pendingERRequestHistoryList; ErRequestHistoryList? pendingERRequestHistoryList;
final Function getLiveCareHistory; final Function getLiveCareHistory;
LiveCarePendingRequest({@required this.getLiveCareHistory, this.pendingERRequestHistoryList}); LiveCarePendingRequest({required this.getLiveCareHistory, this.pendingERRequestHistoryList});
@override @override
_LiveCarePendingRequestState createState() => _LiveCarePendingRequestState(); _LiveCarePendingRequestState createState() => _LiveCarePendingRequestState();
@ -56,7 +56,7 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
transform: Matrix4.translationValues(0.0, -10.0, 0.0), transform: Matrix4.translationValues(0.0, -10.0, 0.0),
alignment: Alignment.center, alignment: Alignment.center,
child: CircularCountDownTimer( child: CircularCountDownTimer(
duration: widget.pendingERRequestHistoryList.watingtimeInteger * 60, duration: widget.pendingERRequestHistoryList!.watingtimeInteger! * 60,
width: MediaQuery.of(context).size.width / 2, width: MediaQuery.of(context).size.width / 2,
height: MediaQuery.of(context).size.height / 2, height: MediaQuery.of(context).size.height / 2,
ringColor: Colors.white, ringColor: Colors.white,
@ -84,16 +84,16 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
Container( Container(
decoration: cardRadius(15.0, color: Color(0xffCC9B14)), decoration: cardRadius(15.0, color: Color(0xffCC9B14)),
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: Text(widget.pendingERRequestHistoryList.stringCallStatus, style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4)), child: Text(widget.pendingERRequestHistoryList!.stringCallStatus!, style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4)),
), ),
Container( Container(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: MyRichText(TranslationBase.of(context).requestedDateLiveCare, child: MyRichText(TranslationBase.of(context).requestedDateLiveCare,
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.pendingERRequestHistoryList.arrivalTime)), projectViewModel.isArabic), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.pendingERRequestHistoryList!.arrivalTime!)), projectViewModel.isArabic),
), ),
Container( Container(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: Text(TranslationBase.of(context).yourTurn + " " + widget.pendingERRequestHistoryList.patCount.toString() + " " + TranslationBase.of(context).patients, child: Text(TranslationBase.of(context).yourTurn + " " + widget.pendingERRequestHistoryList!.patCount.toString() + " " + TranslationBase.of(context).patients,
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)),
), ),
// Row( // Row(
@ -131,7 +131,7 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
cancelLiveCareRequest() { cancelLiveCareRequest() {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context).then((res) { service.cancelLiveCareRequest(widget.pendingERRequestHistoryList!.vCID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "LiveCare request cancelled successfully"); AppToast.showSuccessToast(message: "LiveCare request cancelled successfully");
widget.getLiveCareHistory(); widget.getLiveCareHistory();

@ -18,12 +18,12 @@ import 'ClinicTimingsDialog.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class ClinicCard extends StatefulWidget { class ClinicCard extends StatefulWidget {
bool isSelected; bool? isSelected;
final PatientERGetClinicsList patientERGetClinicsList; final PatientERGetClinicsList patientERGetClinicsList;
var languageID; var languageID;
int isOnline; int? isOnline;
ClinicCard({this.isSelected, this.languageID, this.isOnline, @required this.patientERGetClinicsList}){ ClinicCard({this.isSelected, this.languageID, this.isOnline, required this.patientERGetClinicsList}){
} }
@ -32,7 +32,7 @@ class ClinicCard extends StatefulWidget {
} }
class _State extends State<ClinicCard> { class _State extends State<ClinicCard> {
ClinicsServiceTimingsResponse clinicsServiceTimingsResponse; late ClinicsServiceTimingsResponse clinicsServiceTimingsResponse;
@override @override
void initState() { void initState() {
@ -51,7 +51,7 @@ class _State extends State<ClinicCard> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(width: widget.isSelected ? 3 : 0, color: widget.isSelected ? CustomColors.green : Colors.transparent), border: Border.all(width: widget.isSelected! ? 3 : 0, color: widget.isSelected! ? CustomColors.green : Colors.transparent),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
@ -72,10 +72,10 @@ class _State extends State<ClinicCard> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: projectViewModel.isArabic left: projectViewModel.isArabic
? 0 ? 0
: widget.isSelected : widget.isSelected!
? 4 ? 4
: 6, : 6,
right: projectViewModel.isArabic ? widget.isSelected right: projectViewModel.isArabic ? widget.isSelected!
? 4 ? 4
: 6: 0), : 6: 0),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 12), padding: EdgeInsets.symmetric(vertical: 10, horizontal: 12),
@ -96,7 +96,7 @@ class _State extends State<ClinicCard> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN : widget.patientERGetClinicsList.serviceName, widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN! : widget.patientERGetClinicsList.serviceName!,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -166,16 +166,16 @@ class _State extends State<ClinicCard> {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) { service.getLivecareClinicTiming(patientERGetClinicsList.serviceID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res); clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res as Map<String, dynamic>);
print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList.length); print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList!.length);
navigateTo(context, ClinicTimingsPage( navigateTo(context, ClinicTimingsPage(
clinicName: patientERGetClinicsList.serviceName, clinicName: patientERGetClinicsList.serviceName,
patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList, patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList!,
)); ));
// showGeneralDialog( // showGeneralDialog(
// barrierColor: Colors.black.withOpacity(0.5), // barrierColor: Colors.black.withOpacity(0.5),
@ -206,6 +206,6 @@ class _State extends State<ClinicCard> {
print(err); print(err);
}); });
locator<GAnalytics>().liveCare.livecare_clinic_schedule(clinic: patientERGetClinicsList.serviceName); locator<GAnalytics>().liveCare.livecare_clinic_schedule(clinic: patientERGetClinicsList.serviceName!);
} }
} }

@ -43,7 +43,7 @@ class ClinicList extends StatefulWidget {
bool isPharmacyLiveCare; bool isPharmacyLiveCare;
String pharmacyLiveCareQRCode; String pharmacyLiveCareQRCode;
ClinicList({@required this.getLiveCareHistory, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""}); ClinicList({required this.getLiveCareHistory, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""});
@override @override
_clinic_listState createState() => _clinic_listState(); _clinic_listState createState() => _clinic_listState();
@ -51,44 +51,44 @@ class ClinicList extends StatefulWidget {
class _clinic_listState extends State<ClinicList> { class _clinic_listState extends State<ClinicList> {
int currentSelectedIndex = 0; int currentSelectedIndex = 0;
LiveCareClinicsListResponse liveCareClinicsListResponse; late LiveCareClinicsListResponse liveCareClinicsListResponse;
List<PatientERGetClinicsList> liveCareOnlineClinicsListResponse; late List<PatientERGetClinicsList> liveCareOnlineClinicsListResponse;
List<PatientERGetClinicsList> liveCareOfflineClinicsListResponse; late List<PatientERGetClinicsList> liveCareOfflineClinicsListResponse;
LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse; late LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse;
bool isDataLoaded = false; bool isDataLoaded = false;
var languageID; var languageID;
var currentSelectedLiveCareType; var currentSelectedLiveCareType;
int selectedClinicID; late int selectedClinicID;
String selectedClinicName = "-"; String selectedClinicName = "-";
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; late AuthenticatedUser authUser;
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
MyInAppBrowser browser; late MyInAppBrowser browser;
String liveCareClinicIDs; late String liveCareClinicIDs;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
String selectedPaymentMethod = ""; String selectedPaymentMethod = "";
String amount = ""; String amount = "";
String tamaraPaymentStatus; late String tamaraPaymentStatus;
String tamaraOrderID; late String tamaraOrderID;
String selectedInstallmentPlan; late String selectedInstallmentPlan;
@override @override
void initState() { void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse(); liveCareClinicsListResponse = new LiveCareClinicsListResponse();
liveCareOnlineClinicsListResponse = new[]; liveCareOnlineClinicsListResponse = [];
liveCareOfflineClinicsListResponse = new[]; liveCareOfflineClinicsListResponse = [];
liveCareScheduleClinicsListResponse = new LiveCareScheduleClinicsListResponse(); liveCareScheduleClinicsListResponse = new LiveCareScheduleClinicsListResponse();
@ -126,10 +126,10 @@ class _clinic_listState extends State<ClinicList> {
isError = true; isError = true;
showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); showLiveCareCancelDialog(res['ErrorEndUserMessage'], res);
} else { } else {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res as Map<String, dynamic>);
isError = false; isError = false;
} }
if (!isError) getERAppointmentTime(erAppointmentFeesResponse.getERAppointmentFeesList); if (!isError) getERAppointmentTime(erAppointmentFeesResponse.getERAppointmentFeesList!);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
@ -208,7 +208,7 @@ class _clinic_listState extends State<ClinicList> {
(value) { (value) {
if (value) { if (value) {
if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") {
addNewCallForPatientER(projectViewModel.user.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString()); addNewCallForPatientER(projectViewModel.user!.patientID.toString() + "" + DateTime.now().millisecondsSinceEpoch.toString());
} else { } else {
navigateToPaymentMethod(getERAppointmentFeesList, context); navigateToPaymentMethod(getERAppointmentFeesList, context);
} }
@ -311,17 +311,17 @@ class _clinic_listState extends State<ClinicList> {
context, context,
FadePage( FadePage(
page: PaymentMethod( page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {}); setState(() {});
}, },
patientShare: num.parse(getERAppointmentFeesList.total), patientShare: num.parse(getERAppointmentFeesList.total!),
isFromAdvancePayment: widget.isPharmacyLiveCare, isFromAdvancePayment: widget.isPharmacyLiveCare,
))).then((value) { ))).then((value) {
print(value); print(value);
widget.isPharmacyLiveCare = isPharmacyLiveCare; widget.isPharmacyLiveCare = isPharmacyLiveCare;
widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue; widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue;
if (value != null) { if (value != null) {
openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo); openPayment(value, authUser, num.parse(getERAppointmentFeesList.total!), appo);
projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment'); projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment');
} }
}); });
@ -337,12 +337,12 @@ class _clinic_listState extends State<ClinicList> {
browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"LiveCare Payment", "LiveCare Payment",
widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!),
"12", "12",
authenticatedUser.emailAddress, authenticatedUser.emailAddress!,
paymentMethod[0], paymentMethod[0],
authenticatedUser.patientType, authenticatedUser.patientType,
authenticatedUser.firstName, authenticatedUser.firstName!,
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
browser, browser,
@ -364,12 +364,12 @@ class _clinic_listState extends State<ClinicList> {
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url); Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status']; tamaraPaymentStatus = uri.queryParameters['status']!;
tamaraOrderID = uri.queryParameters['AuthorizePaymentId']; tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
} else { } else {
Uri uri = new Uri.dataFromString(url); Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus']; tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
tamaraOrderID = uri.queryParameters['orderId']; tamaraOrderID = uri.queryParameters['orderId']!;
} }
} }
@ -394,7 +394,7 @@ class _clinic_listState extends State<ClinicList> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
try { try {
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo); // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
// } else { // } else {
@ -415,10 +415,10 @@ class _clinic_listState extends State<ClinicList> {
service.getTamaraPaymentStatus(orderID).then((res) { service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") { if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(selectedInstallmentPlan), appo); updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, int.parse(selectedInstallmentPlan), appo);
} else { } else {
updateTamaraRequestStatus( updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo); "Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "", int.parse(selectedInstallmentPlan), appo);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -428,14 +428,14 @@ class _clinic_listState extends State<ClinicList> {
} }
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) { updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
try { try {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) { service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!));
} else { } else {
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
@ -459,19 +459,19 @@ class _clinic_listState extends State<ClinicList> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
String amount; String amount;
String payment_method; String payment_method;
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.checkPaymentStatus( .checkPaymentStatus(
widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context) widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), widget.isPharmacyLiveCare, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
amount = res['Amount'].toString(); amount = res['Amount'].toString();
payment_method = res['PaymentMethod']; payment_method = res['PaymentMethod'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
addNewCallForPatientER(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); addNewCallForPatientER(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!));
} else { } else {
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
@ -517,9 +517,9 @@ class _clinic_listState extends State<ClinicList> {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
liveCareOnlineClinicsListResponse.clear(); liveCareOnlineClinicsListResponse.clear();
liveCareClinicsListResponse = LiveCareClinicsListResponse.fromJson(res); liveCareClinicsListResponse = LiveCareClinicsListResponse.fromJson(res as Map<String, dynamic>);
liveCareClinicsListResponse.patientERGetClinicsList.forEach((clinic) { liveCareClinicsListResponse.patientERGetClinicsList!.forEach((clinic) {
if (clinic.isOnline == 1) { if (clinic.isOnline == 1) {
liveCareOnlineClinicsListResponse.add(clinic); liveCareOnlineClinicsListResponse.add(clinic);
} else { } else {
@ -530,8 +530,8 @@ class _clinic_listState extends State<ClinicList> {
selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]); selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]);
selectedClinicName = liveCareClinicIDs.split("-")[0]; selectedClinicName = liveCareClinicIDs.split("-")[0];
} else { } else {
selectedClinicID = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceID; selectedClinicID = liveCareClinicsListResponse.patientERGetClinicsList![0].serviceID!;
selectedClinicName = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceName; selectedClinicName = liveCareClinicsListResponse.patientERGetClinicsList![0].serviceName!;
} }
isDataLoaded = true; isDataLoaded = true;
}); });
@ -554,9 +554,9 @@ class _clinic_listState extends State<ClinicList> {
print(res['ClinicsHaveScheduleList'].length); print(res['ClinicsHaveScheduleList'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res); liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res as Map<String, dynamic>);
selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].serviceID; selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].serviceID!;
selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].clinicDesc; selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].clinicDesc!;
isDataLoaded = true; isDataLoaded = true;
}); });
} else { } else {
@ -629,7 +629,7 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded isDataLoaded
? Expanded( ? Expanded(
child: Container( child: Container(
child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0 child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList!.length > 0
? Column( ? Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -639,15 +639,15 @@ class _clinic_listState extends State<ClinicList> {
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length, itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index]); updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![index]);
}, },
child: ScheduleClinicCard( child: ScheduleClinicCard(
isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index].serviceID ? true : false, isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![index].serviceID ? true : false,
clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index], clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![index],
languageID: languageID, languageID: languageID,
), ),
); );
@ -778,7 +778,7 @@ class _clinic_listState extends State<ClinicList> {
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
@ -803,15 +803,15 @@ class _clinic_listState extends State<ClinicList> {
updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) { updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) {
setState(() { setState(() {
selectedClinicID = patientERGetClinicsList.serviceID; selectedClinicID = patientERGetClinicsList.serviceID!;
selectedClinicName = patientERGetClinicsList.serviceName; selectedClinicName = patientERGetClinicsList.serviceName!;
}); });
} }
updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) { updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) {
setState(() { setState(() {
selectedClinicID = patientERGetClinicsList.serviceID; selectedClinicID = patientERGetClinicsList.serviceID!;
selectedClinicName = patientERGetClinicsList.clinicDesc; selectedClinicName = patientERGetClinicsList.clinicDesc!;
}); });
} }
} }

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class LiveCareLogs extends StatefulWidget { class LiveCareLogs extends StatefulWidget {
List<ErRequestHistoryList> erRequestHistoryList; List<ErRequestHistoryList> erRequestHistoryList;
LiveCareLogs({@required this.erRequestHistoryList}); LiveCareLogs({required this.erRequestHistoryList});
@override @override
_LiveCareLogsState createState() => _LiveCareLogsState(); _LiveCareLogsState createState() => _LiveCareLogsState();
@ -30,7 +30,7 @@ class _LiveCareLogsState extends State<LiveCareLogs> {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.erRequestHistoryList.length, itemCount: widget.erRequestHistoryList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return widget.erRequestHistoryList[index].callStatus < 4 return widget.erRequestHistoryList[index].callStatus! < 4
? Container() ? Container()
: LiveCareHistoryCard( : LiveCareHistoryCard(
erRequestHistoryList: widget.erRequestHistoryList[index], erRequestHistoryList: widget.erRequestHistoryList[index],

@ -35,15 +35,16 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:local_auth_ios/local_auth_ios.dart';
class ConfirmLogin extends StatefulWidget { class ConfirmLogin extends StatefulWidget {
final Function changePageViewIndex; final Function? changePageViewIndex;
final fromRegistration; final fromRegistration;
final bool isDubai; final bool isDubai;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key);
const ConfirmLogin({Key? key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key);
@override @override
_ConfirmLogin createState() => _ConfirmLogin(); _ConfirmLogin createState() => _ConfirmLogin();
@ -53,12 +54,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
final LocalAuthentication auth = LocalAuthentication(); final LocalAuthentication auth = LocalAuthentication();
var _availableBiometrics; var _availableBiometrics;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
bool authenticated; late bool authenticated;
final authService = new AuthProvider(); final authService = new AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
int mobileNumber; late int mobileNumber;
String errorMsg = ''; String errorMsg = '';
SelectDeviceIMEIRES user; late SelectDeviceIMEIRES user;
bool isLoading = false; bool isLoading = false;
var registerd_data; var registerd_data;
bool isMoreOption = false; bool isMoreOption = false;
@ -74,25 +75,25 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var lastLogin; var lastLogin;
int selectedOption; late int selectedOption;
bool onlySMSBox = false; bool onlySMSBox = false;
var userData; var userData;
static BuildContext _context; late BuildContext _context;
static bool _loading; late bool _loading;
int fingrePrintBefore; late int fingrePrintBefore;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
var dob; var dob;
int isHijri; late int isHijri;
var healthId; var healthId;
@override @override
@ -138,7 +139,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
), ),
Text( Text(
user.name.toLowerCase().capitalizeFirstofEach, user.name!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44), style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44),
), ),
SizedBox(height: 10), SizedBox(height: 10),
@ -172,9 +173,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
user.editedOn != null user.editedOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn)) ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn!))
: user.createdOn != null : user.createdOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn)) ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.createdOn!))
: '--', : '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),
@ -203,9 +204,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Text( Text(
user.editedOn != null user.editedOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false) ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn!), false)
: user.createdOn != null : user.createdOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn), false) ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.createdOn!), false)
: '--', : '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
), ),
@ -291,7 +292,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
try { try {
availableBiometrics = await auth.getAvailableBiometrics(); availableBiometrics = await auth.getAvailableBiometrics();
} on PlatformException catch (e) { } on PlatformException catch (e) {
AppToast.showErrorToast(message: e.message); AppToast.showErrorToast(message: e.message!);
print(e); print(e);
} }
if (!mounted) return; if (!mounted) return;
@ -303,7 +304,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
int login_method = 0; int login_method = 0;
authenticateUser(int type, {int isActive}) { authenticateUser(int type, {int? isActive}) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (type == 2 || type == 3) { if (type == 2 || type == 3) {
fingrePrintBefore = type; fingrePrintBefore = type;
@ -320,10 +321,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.loginWithSMS(type); this.loginWithSMS(type);
break; break;
case 2: case 2:
this.loginWithFingurePrintFace(type, isActive); this.loginWithFingurePrintFace(type, isActive!);
break; break;
case 3: case 3:
this.loginWithFingurePrintFace(type, isActive); this.loginWithFingurePrintFace(type, isActive!);
break; break;
case 4: case 4:
this.loginWithSMS(type); this.loginWithSMS(type);
@ -386,7 +387,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.sMSSignature = await SMSOTP.getSignature(); request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null || widget.isDubai) { if (healthId != null || widget.isDubai) {
if(!widget.isDubai){ if (!widget.isDubai) {
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
} }
request.healthId = healthId; request.healthId = healthId;
@ -435,11 +436,17 @@ class _ConfirmLogin extends State<ConfirmLogin> {
loginWithFingurePrintFace(type, int isActive) async { loginWithFingurePrintFace(type, int isActive) async {
if (isActive == 1 || isActive == 0) { if (isActive == 1 || isActive == 0) {
const iosStrings =
const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID');
try { try {
authenticated = await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings); authenticated = await auth.authenticate(
localizedReason: 'Scan your fingerprint to authenticate',
options: AuthenticationOptions(
useErrorDialogs: true,
stickyAuth: true,
),
authMessages: [
IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'),
],
);
} on PlatformException catch (e) { } on PlatformException catch (e) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 'Please enable your Touch or Face ID'); AppToast.showErrorToast(message: 'Please enable your Touch or Face ID');
@ -499,7 +506,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.registerd_data = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); this.registerd_data = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
} }
this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user.mobile); this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user.mobile!);
this.zipCode = this.registerd_data != null this.zipCode = this.registerd_data != null
? this.registerd_data.zipCode ? this.registerd_data.zipCode
: this.user.outSA == true : this.user.outSA == true
@ -568,7 +575,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var request = this.getCommonRequest().toJson(); var request = this.getCommonRequest().toJson();
dynamic res; dynamic res;
if (healthId != null || widget.isDubai) { if (healthId != null || widget.isDubai) {
if(!widget.isDubai) { if (!widget.isDubai) {
request['DOB'] = dob; request['DOB'] = dob;
} }
request['HealthId'] = healthId; request['HealthId'] = healthId;
@ -580,11 +587,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result, res = result,
if (result is Map) if (result is Map)
{ {
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result as Map<String, dynamic>),
if (this.registerd_data != null && this.registerd_data.isRegister == true) if (this.registerd_data != null && this.registerd_data.isRegister == true)
{ {
// if(widget.isDubai ==false){ // if(widget.isDubai ==false){
widget.changePageViewIndex(1), widget.changePageViewIndex!(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
} }
} }
@ -614,10 +621,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result, res = result,
if (result is Map) if (result is Map)
{ {
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result as Map<String, dynamic>),
if (this.registerd_data != null && this.registerd_data.isRegister == true) if (this.registerd_data != null && this.registerd_data.isRegister == true)
{ {
widget.changePageViewIndex(1), widget.changePageViewIndex!(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
} }
else else
@ -732,7 +739,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}); });
} }
Widget _loginOptionButton(String _title, String _icon, int _flag, int _loginIndex) { Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) || _flag == 2 && !checkIfBiometricAvailable(BiometricType.fingerprint)); bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) || _flag == 2 && !checkIfBiometricAvailable(BiometricType.fingerprint));
return InkWell( return InkWell(
onTap: isDisable onTap: isDisable
@ -812,7 +819,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Image.asset( Image.asset(
'assets/images/login/more_icon.png', 'assets/images/login/more_icon.png',
height: 45, height: 45,
width: SizeConfig.imageSizeMultiplier * 16, width: SizeConfig.imageSizeMultiplier! * 16,
), ),
projectViewModel.isArabic projectViewModel.isArabic
? SizedBox( ? SizedBox(
@ -821,7 +828,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox( : SizedBox(
height: 20, height: 20,
), ),
Texts(TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier * 1.8, textAlign: TextAlign.center, color: Colors.black) Texts(TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier! * 1.8, textAlign: TextAlign.center, color: Colors.black)
], ],
), ),
), ),

@ -23,7 +23,7 @@ class ForgotPassword extends StatefulWidget {
class _ForgotPassword extends State<ForgotPassword> { class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia'; String selectedType = 'Saudi Arabia';
String countryCode = '966'; String countryCode = '966';
final TextEditingController nationalIDorFile = null; final TextEditingController nationalIDorFile = TextEditingController();
String mobileNo = ""; String mobileNo = "";
var con; var con;
@ -100,14 +100,14 @@ class _ForgotPassword extends State<ForgotPassword> {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20), padding: EdgeInsets.only(top: 10, left: 20, right: 20),
height: SizeConfig.realScreenHeight * .8, height: SizeConfig.realScreenHeight! * .8,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
flex: 1, flex: 1,
child: AppText( child: AppText(
TranslationBase.of(context).forgotDesc, TranslationBase.of(context).forgotDesc,
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
textAlign: TextAlign.start, textAlign: TextAlign.start,
marginTop: 10.0, marginTop: 10.0,
)), )),

@ -40,7 +40,7 @@ class _Login extends State<Login> {
final nationalIDorFile = TextEditingController(); final nationalIDorFile = TextEditingController();
final mobileNumberController = TextEditingController(); final mobileNumberController = TextEditingController();
int loginType = LoginType.loginType; int loginType = LoginType.loginType;
String mobileNo; late String mobileNo;
String countryCode = '966'; String countryCode = '966';
bool isButtonDisabled = true; bool isButtonDisabled = true;
final authService = new AuthProvider(); final authService = new AuthProvider();
@ -51,8 +51,8 @@ class _Login extends State<Login> {
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
@ -138,7 +138,7 @@ class _Login extends State<Login> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -34,10 +34,10 @@ import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class RegisterInfo extends StatefulWidget { class RegisterInfo extends StatefulWidget {
final Function changePageViewIndex; final Function? changePageViewIndex;
final int page; final int page;
const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) : super(key: key); const RegisterInfo({Key? key, this.changePageViewIndex, this.page = 1}) : super(key: key);
@override @override
_RegisterInfo createState() => _RegisterInfo(); _RegisterInfo createState() => _RegisterInfo();
@ -47,14 +47,14 @@ class _RegisterInfo extends State<RegisterInfo> {
final authService = new AuthProvider(); final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences(); final sharedPref = new AppSharedPreferences();
RegisterInfoResponse registerInfo = RegisterInfoResponse(); RegisterInfoResponse registerInfo = RegisterInfoResponse();
bool isLoading; late bool isLoading;
int page; late int page;
final List<Location> locationList = [ final List<Location> locationList = [
new Location(name: 'KSA', value: '1', nameAr: "السعودية"), new Location(name: 'KSA', value: '1', nameAr: "السعودية"),
new Location(name: 'Dubai', value: '2', nameAr: "دبي"), new Location(name: 'Dubai', value: '2', nameAr: "دبي"),
]; ];
String language = '1'; String language = '1';
CheckPatientAuthenticationReq registerd_data; late CheckPatientAuthenticationReq registerd_data;
final List<Language> languageList = [ final List<Language> languageList = [
new Language(name: 'English', value: '2', nameAr: "إنجليزي"), new Language(name: 'English', value: '2', nameAr: "إنجليزي"),
new Language(name: 'Arabic', value: '1', nameAr: "عربي"), new Language(name: 'Arabic', value: '1', nameAr: "عربي"),
@ -70,16 +70,16 @@ class _RegisterInfo extends State<RegisterInfo> {
]; ];
String email = ''; String email = '';
List<CountriesLists> countriesList = []; List<CountriesLists> countriesList = [];
ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
String location = '1'; String location = '1';
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
bool isDubai = false; bool isDubai = false;
RegisterInfoResponse data = RegisterInfoResponse(); RegisterInfoResponse data = RegisterInfoResponse();
CheckPatientAuthenticationReq data2; late CheckPatientAuthenticationReq data2;
String gender = 'M'; String gender = 'M';
String maritalStatus = 'M'; String maritalStatus = 'M';
String nationality = 'SAU'; String nationality = 'SAU';
@ -160,7 +160,7 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
setState(() { setState(() {
gender = value; gender = value!;
registerInfo.gender = value; registerInfo.gender = value;
}) })
}, },
@ -168,7 +168,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.value, value: value.value,
child: Text( child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name, projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
), ),
); );
}).toList()))), }).toList()))),
@ -187,7 +187,7 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
setState(() { setState(() {
maritalStatus = value; maritalStatus = value!;
registerInfo.maritalStatusCode = value; registerInfo.maritalStatusCode = value;
}) })
}, },
@ -195,7 +195,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.value, value: value.value,
child: Text( child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name, projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
), ),
); );
}).toList()))), }).toList()))),
@ -211,7 +211,7 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
setState(() { setState(() {
nationality = value; nationality = value!;
registerInfo.nationalityCode = value; registerInfo.nationalityCode = value;
}) })
}, },
@ -219,7 +219,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.iD, value: value.iD,
child: Text( child: Text(
value.name, value.name!,
), ),
); );
}).toList())))), }).toList())))),
@ -284,14 +284,14 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
setState(() { setState(() {
language = value; language = value!;
}) })
}, },
items: languageList.map<DropdownMenuItem<String>>((Language value) { items: languageList.map<DropdownMenuItem<String>>((Language value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.value, value: value.value,
child: Text( child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name, projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
), ),
); );
}).toList()))) }).toList())))
@ -326,14 +326,14 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
setState(() { setState(() {
location = value; location = value!;
}) })
}, },
items: locationList.map<DropdownMenuItem<String>>((Location value) { items: locationList.map<DropdownMenuItem<String>>((Location value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.value, value: value.value,
child: Text( child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name, projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
), ),
); );
}).toList()))) }).toList())))
@ -425,9 +425,9 @@ class _RegisterInfo extends State<RegisterInfo> {
if (page == 1) { if (page == 1) {
if (isDubai) { if (isDubai) {
await setRegisterData(); await setRegisterData();
widget.changePageViewIndex(2); widget.changePageViewIndex!(2);
} else { } else {
widget.changePageViewIndex(2); widget.changePageViewIndex!(2);
} }
} else { } else {
registerNow(); registerNow();
@ -533,13 +533,13 @@ class _RegisterInfo extends State<RegisterInfo> {
getTempUserRequest() { getTempUserRequest() {
DateFormat dateFormat = DateFormat("mm/dd/yyyy"); DateFormat dateFormat = DateFormat("mm/dd/yyyy");
print(dateFormat.parse(registerInfo.dateOfBirth)); print(dateFormat.parse(registerInfo.dateOfBirth!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth!));
var date = hDate.toString(); var date = hDate.toString();
return { return {
"Patientobject": { "Patientobject": {
"TempValue": true, "TempValue": true,
"PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationType": registerInfo.idNumber!.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": registerInfo.idNumber, "PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber, "MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1,
@ -550,7 +550,7 @@ class _RegisterInfo extends State<RegisterInfo> {
"LastNameN": registerInfo.lastNameAr, "LastNameN": registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn, "LastName": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth, "StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth.replaceAll('/', '-')), "DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth!.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2, "Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationalityCode, "NationalityID": registerInfo.nationalityCode,
"eHealthIDField": registerInfo.healthId, "eHealthIDField": registerInfo.healthId,
@ -572,8 +572,8 @@ class _RegisterInfo extends State<RegisterInfo> {
getTempUserRequestDubai() { getTempUserRequestDubai() {
DateFormat dateFormat = DateFormat("mm/dd/yyyy"); DateFormat dateFormat = DateFormat("mm/dd/yyyy");
registerInfo = projectViewModel.registerInfo; registerInfo = projectViewModel.registerInfo;
print(dateFormat.parse(registerd_data.dob)); print(dateFormat.parse(registerd_data.dob!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob!));
var date = hDate.toString(); var date = hDate.toString();
final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
@ -581,7 +581,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return { return {
"Patientobject": { "Patientobject": {
"TempValue": true, "TempValue": true,
"PatientIdentificationType": registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationType": registerd_data.patientIdentificationID!.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": registerd_data.patientIdentificationID, "PatientIdentificationNo": registerd_data.patientIdentificationID,
"MobileNumber": registerd_data.patientMobileNumber, "MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1,
@ -591,8 +591,8 @@ class _RegisterInfo extends State<RegisterInfo> {
"MiddleName": registerInfo.secondNameEn ?? ".", "MiddleName": registerInfo.secondNameEn ?? ".",
"LastNameN": registerInfo.lastNameAr ?? "", "LastNameN": registerInfo.lastNameAr ?? "",
"LastName": registerInfo.lastNameEn ?? "", "LastName": registerInfo.lastNameEn ?? "",
"StrDateofBirth": dateFormat1.format(dateFormat2.parse(registerd_data.dob)), "StrDateofBirth": dateFormat1.format(dateFormat2.parse(registerd_data.dob!)),
"DateofBirth": DateUtil.convertISODateToJsonDate(registerd_data.dob.replaceAll('/', '-')), "DateofBirth": DateUtil.convertISODateToJsonDate(registerd_data.dob!.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2, "Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationalityCode, "NationalityID": registerInfo.nationalityCode,
"eHealthIDField": null, "eHealthIDField": null,
@ -760,7 +760,7 @@ class _RegisterInfo extends State<RegisterInfo> {
}); });
} }
Widget inputWidget(String _labelText, String _hintText, String name, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, String name, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5), padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
alignment: Alignment.center, alignment: Alignment.center,
@ -875,17 +875,17 @@ class _RegisterInfo extends State<RegisterInfo> {
} }
class Language { class Language {
final String name; final String? name;
final String value; final String? value;
final String nameAr; final String? nameAr;
Language({this.name, this.value, this.nameAr}); Language({this.name, this.value, this.nameAr});
} }
class Location { class Location {
final String name; final String? name;
final String value; final String? value;
final String nameAr; final String? nameAr;
Location({this.name, this.value, this.nameAr}); Location({this.name, this.value, this.nameAr});
} }

@ -27,9 +27,9 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart' as intl; import 'package:intl/intl.dart' as intl;
class Register extends StatefulWidget { class Register extends StatefulWidget {
final Function changePageViewIndex; final Function? changePageViewIndex;
const Register({Key key, this.changePageViewIndex}) : super(key: key); const Register({Key? key, this.changePageViewIndex}) : super(key: key);
@override @override
_Register createState() => _Register(); _Register createState() => _Register();
@ -38,11 +38,11 @@ class Register extends StatefulWidget {
class _Register extends State<Register> { class _Register extends State<Register> {
final nationalIDorFile = TextEditingController(); final nationalIDorFile = TextEditingController();
final int loginType = LoginType.loginType; final int loginType = LoginType.loginType;
String mobileNo; late String mobileNo;
String countryCode = '966'; String countryCode = '966';
var isHijri; var isHijri;
final util = Utils(); final util = Utils();
DateTime selectedDate; late DateTime selectedDate;
TextEditingController dob = TextEditingController(); TextEditingController dob = TextEditingController();
TextEditingController dobEn = TextEditingController(); TextEditingController dobEn = TextEditingController();
@ -50,7 +50,7 @@ class _Register extends State<Register> {
final authService = new AuthProvider(); final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences(); final sharedPref = new AppSharedPreferences();
bool isLoading; late bool isLoading;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -119,7 +119,7 @@ class _Register extends State<Register> {
), ),
Row(children: <Widget>[ Row(children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth * .89, width: SizeConfig.realScreenWidth! * .89,
child: isHijri == 1 child: isHijri == 1
? Directionality( ? Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
@ -195,7 +195,7 @@ class _Register extends State<Register> {
); );
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false, bool isNumber = true, Icon suffix}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false, bool isNumber = true, Icon? suffix}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
@ -400,7 +400,7 @@ class _Register extends State<Register> {
GifLoaderDialogUtils.hideDialog(context), GifLoaderDialogUtils.hideDialog(context),
if (result is Map) if (result is Map)
{ {
result = CheckUserStatusResponse.fromJson(result), result = CheckUserStatusResponse.fromJson(result as Map<String, dynamic>),
sharedPref.setObject(NHIC_DATA, result), sharedPref.setObject(NHIC_DATA, result),
Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true))), Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true))),
} }

@ -21,17 +21,17 @@ class RegisterNew extends StatefulWidget {
class _RegisterNew extends State<RegisterNew> { class _RegisterNew extends State<RegisterNew> {
final nationalIDorFile = TextEditingController(); final nationalIDorFile = TextEditingController();
final int loginType = LoginType.loginType; final int loginType = LoginType.loginType;
String mobileNo; late String mobileNo;
String countryCode = '966'; String countryCode = '966';
var isHijri; var isHijri;
final util = Utils(); final util = Utils();
DateTime selectedDate; late DateTime selectedDate;
String dob; late String dob;
bool isButtonDisabled = true; bool isButtonDisabled = true;
final authService = new AuthProvider(); final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences(); final sharedPref = new AppSharedPreferences();
PageController _controller; late PageController _controller;
bool isLoading; late bool isLoading;
int _currentIndex = 0; int _currentIndex = 0;
@override @override
@ -59,7 +59,7 @@ class _RegisterNew extends State<RegisterNew> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight! * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
@ -145,7 +145,7 @@ class _RegisterNew extends State<RegisterNew> {
); );
} }
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) { Widget showProgress({String? title, String? status, Color? color, bool isNeedBorder = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -157,7 +157,7 @@ class _RegisterNew extends State<RegisterNew> {
Container( Container(
width: 26, width: 26,
height: 26, height: 26,
decoration: containerRadius(color, 200), decoration: containerRadius(color!, 200),
child: Icon( child: Icon(
Icons.done, Icons.done,
color: Colors.white, color: Colors.white,
@ -174,7 +174,7 @@ class _RegisterNew extends State<RegisterNew> {
), ),
mHeight(8), mHeight(8),
Text( Text(
title, title!,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -184,9 +184,9 @@ class _RegisterNew extends State<RegisterNew> {
mHeight(2), mHeight(2),
Container( Container(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
decoration: containerRadius(color.withOpacity(0.2), 4), decoration: containerRadius(color!.withOpacity(0.2), 4),
child: Text( child: Text(
status, status!,
style: TextStyle( style: TextStyle(
fontSize: 8, fontSize: 8,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -38,7 +38,7 @@ class ActiveMedicationsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
model.activePrescriptionReport[index].itemDescription, model.activePrescriptionReport[index].itemDescription!,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
letterSpacing: -0.64, letterSpacing: -0.64,
@ -82,7 +82,7 @@ class ActiveMedicationsPage extends StatelessWidget {
), ),
), ),
Text( Text(
DateUtil.getDayMonthYearDateFormatted(model.activePrescriptionReport[index].orderDate), DateUtil.getDayMonthYearDateFormatted(model.activePrescriptionReport[index].orderDate!),
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -103,7 +103,7 @@ class ActiveMedicationsPage extends StatelessWidget {
), ),
), ),
Text( Text(
model.activePrescriptionReport[index].frequency, model.activePrescriptionReport[index].frequency!,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -124,7 +124,7 @@ class ActiveMedicationsPage extends StatelessWidget {
), ),
), ),
Text( Text(
model.activePrescriptionReport[index].route, model.activePrescriptionReport[index].route!,
style: TextStyle( style: TextStyle(
fontSize: 13, fontSize: 13,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -166,9 +166,9 @@ class ActiveMedicationsPage extends StatelessWidget {
context, context,
FadePage( FadePage(
page: ReminderPage( page: ReminderPage(
frequency: model.activePrescriptionReport[index].frequencyNumber, frequency: model.activePrescriptionReport[index].frequencyNumber!,
days: model.activePrescriptionReport[index].days, days: model.activePrescriptionReport[index].days!,
itemDescription: model.activePrescriptionReport[index].itemDescription, itemDescription: model.activePrescriptionReport[index].itemDescription!,
), ),
), ),
); );

@ -20,7 +20,7 @@ class DayCheckBoxDialog extends StatefulWidget {
]; ];
DayCheckBoxDialog( DayCheckBoxDialog(
{Key key, this.onValueSelected, this.selectedDaysOfWeek, this.title}); {Key? key, required this.onValueSelected, required this.selectedDaysOfWeek, required this.title});
@override @override
_DayCheckBoxDialogState createState() => _DayCheckBoxDialogState(); _DayCheckBoxDialogState createState() => _DayCheckBoxDialogState();

@ -18,20 +18,20 @@ import 'DayCheckBoxDialog.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class ReminderPage extends StatefulWidget { class ReminderPage extends StatefulWidget {
final int frequency; final int? frequency;
final int days; final int? days;
final String itemDescription; final String? itemDescription;
List<DateTime> _scheduleList =[]; List<DateTime> _scheduleList =[];
List<DayOfWeek> daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday]; List<DayOfWeek> daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday];
DateTime startDay; late DateTime startDay;
DateTime endDay; late DateTime endDay;
ReminderPage({Key key, this.frequency, this.days, this.itemDescription}) { ReminderPage({Key? key, this.frequency, this.days, this.itemDescription}) {
startDay = DateTime.now(); startDay = DateTime.now();
endDay = DateTime.now().add(Duration(days: days)); endDay = DateTime.now().add(Duration(days: days!));
int hour = (24 ~/ frequency).round(); int hour = (24 ~/ frequency!).round();
int durations = 24 ~/ hour; int durations = 24 ~/ hour;
for (int count = 0; count < durations; count++) { for (int count = 0; count < durations; count++) {
_scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, (hour * count))); _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, (hour * count)));

@ -16,9 +16,9 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ViewDoctorResponsesPage extends StatefulWidget { class ViewDoctorResponsesPage extends StatefulWidget {
final DoctorResponse doctorResponse; final DoctorResponse? doctorResponse;
const ViewDoctorResponsesPage({Key key, this.doctorResponse}) : super(key: key); const ViewDoctorResponsesPage({Key? key, this.doctorResponse}) : super(key: key);
@override @override
State<ViewDoctorResponsesPage> createState() => _ViewDoctorResponsesPageState(); State<ViewDoctorResponsesPage> createState() => _ViewDoctorResponsesPageState();
@ -27,13 +27,13 @@ class ViewDoctorResponsesPage extends StatefulWidget {
class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> { class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
int rate = 1; int rate = 1;
TextEditingController textController = new TextEditingController(); TextEditingController textController = new TextEditingController();
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<AskDoctorViewModel>( return BaseView<AskDoctorViewModel>(
onModelReady: (model) => model.updateReadStatus(transactionNo: widget.doctorResponse.transactionNo), onModelReady: (model) => model.updateReadStatus(transactionNo: widget.doctorResponse!.transactionNo!),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
@ -82,7 +82,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
children: [ children: [
Container( Container(
child: Text( child: Text(
(widget.doctorResponse.doctorName ?? ""), (widget.doctorResponse!.doctorName ?? ""),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -93,7 +93,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
), ),
Container( Container(
child: Text( child: Text(
(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctorResponse.createdOn)) ?? ""), (DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctorResponse!.createdOn!)) ?? ""),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: Color(0xff2E303A), color: Color(0xff2E303A),
@ -104,7 +104,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
widget.doctorResponse.transactions[_index]['DoctorResponse'], widget.doctorResponse!.transactions![_index]['DoctorResponse'],
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
color: Color(0xff2E303A), color: Color(0xff2E303A),
@ -127,7 +127,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.doctorResponse.transactions.length); itemCount: widget.doctorResponse!.transactions!.length);
} }
void openResponseRateDialog(BuildContext context) { void openResponseRateDialog(BuildContext context) {
@ -234,14 +234,14 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
AskDoctorService service = new AskDoctorService(); AskDoctorService service = new AskDoctorService();
service service
.rateDoctorResponse( .rateDoctorResponse(
transactionNo: widget.doctorResponse.transactionNo, transactionNo: widget.doctorResponse!.transactionNo!,
questionType: widget.doctorResponse.requestType, questionType: widget.doctorResponse!.requestType!,
rate: rate, rate: rate,
notes: textController.text, notes: textController.text,
mobileNo: projectViewModel.user.mobileNumber, mobileNo: projectViewModel.user!.mobileNumber!,
idNo: projectViewModel.user.patientIdentificationNo, idNo: projectViewModel.user!.patientIdentificationNo!,
patientName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName, patientName: projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
projectID: widget.doctorResponse.projectID, projectID: widget.doctorResponse!.projectID,
language: projectViewModel.isArabic ? "ar" : "en") language: projectViewModel.isArabic ? "ar" : "en")
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -257,7 +257,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
}); });
} }
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container( return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,

@ -17,7 +17,7 @@ class AskDoctorHomPage extends StatefulWidget {
} }
class _AskDoctorHomPageState extends State<AskDoctorHomPage> with SingleTickerProviderStateMixin { class _AskDoctorHomPageState extends State<AskDoctorHomPage> with SingleTickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
int filterType = 0; int filterType = 0;

@ -50,7 +50,7 @@ class AskDoctorPage extends StatelessWidget {
); );
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
List<DoctorList> _doctorList = _patientDoctorAppointmentList[index].patientDoctorAppointmentList; List<DoctorList> _doctorList = _patientDoctorAppointmentList[index].patientDoctorAppointmentList!;
return AppExpandableNotifier( return AppExpandableNotifier(
title: _patientDoctorAppointmentList[index].filterName, title: _patientDoctorAppointmentList[index].filterName,
bodyWidget: ListView.separated( bodyWidget: ListView.separated(

@ -62,7 +62,7 @@ class DoctorResponse extends StatelessWidget {
return InkWell( return InkWell(
onTap: () { onTap: () {
///go to page ViewDoctorResponsesPage ///go to page ViewDoctorResponsesPage
if (doctor.transactions != null && doctor.transactions.isNotEmpty) { if (doctor.transactions != null && doctor.transactions!.isNotEmpty) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -81,7 +81,7 @@ class DoctorResponse extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
color: Colors.white, color: Colors.white,
border: Border.all(color: Colors.grey[300]), border: Border.all(color: Colors.grey[300]!),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -150,7 +150,7 @@ class DoctorResponse extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
color: Colors.white, color: Colors.white,
border: Border.all(color: Colors.grey[300]), border: Border.all(color: Colors.grey[300]!),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,

@ -11,9 +11,9 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RequestTypePage extends StatefulWidget { class RequestTypePage extends StatefulWidget {
final DoctorList doctorList; final DoctorList? doctorList;
RequestTypePage({Key key, this.doctorList}); RequestTypePage({Key? key, this.doctorList});
@override @override
_RequestTypePageState createState() => _RequestTypePageState(); _RequestTypePageState createState() => _RequestTypePageState();
@ -50,8 +50,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
selected = model.askDoctorReqTypes[index].description; selected = model.askDoctorReqTypes[index].description!;
parameterCode = model.askDoctorReqTypes[index].parameterCode; parameterCode = model.askDoctorReqTypes[index].parameterCode!;
}); });
}, },
child: Row( child: Row(
@ -59,7 +59,7 @@ class _RequestTypePageState extends State<RequestTypePage> {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text(model.askDoctorReqTypes[index].description), child: Text(model.askDoctorReqTypes[index].description!),
), ),
Radio( Radio(
value: model.askDoctorReqTypes[index].description, value: model.askDoctorReqTypes[index].description,
@ -67,8 +67,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
selected = value; selected = value!;
parameterCode = model.askDoctorReqTypes[index].parameterCode; parameterCode = model.askDoctorReqTypes[index].parameterCode!;
}); });
}, },
), ),
@ -109,7 +109,7 @@ class _RequestTypePageState extends State<RequestTypePage> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).submit, TranslationBase.of(context).submit,
() => { () => {
model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) { model.sendRequestLOV(doctorList: widget.doctorList!, requestType: parameterCode.toString(), remark: question).then((value) {
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) { if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) {
Navigator.pop(context); Navigator.pop(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).RRTRequestSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).RRTRequestSuccess);

@ -38,20 +38,20 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
TextEditingController _fileTextController = TextEditingController(); TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
HospitalsModel _selectedHospital; late HospitalsModel _selectedHospital;
String amount = ""; String amount = "";
String email; late String email;
PatientInfo _selectedPatientInfo; late PatientInfo _selectedPatientInfo;
AuthenticatedUser authenticatedUser; late AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily; late GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel(); AdvanceModel advanceModel = AdvanceModel();
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; late AuthenticatedUser authUser;
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -122,8 +122,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
setState(() { setState(() {
if (type == BeneficiaryType.MyAccount) { if (type == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString(); _fileTextController.text = model.user!.patientID.toString();
advanceModel.depositorName = model.user.firstName + " " + model.user.lastName; advanceModel.depositorName = model.user!.firstName! + " " + model.user!.lastName!;
} else } else
_fileTextController.text = ""; _fileTextController.text = "";
@ -161,7 +161,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.getFamilyFiles().then((value) { model.getFamilyFiles().then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList); confirmSelectFamilyDialog(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!);
}); });
}, },
child: Container( child: Container(
@ -263,7 +263,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
if (model.user != null) if (model.user != null)
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorEmail, hintText: TranslationBase.of(context).depositorEmail,
initialValue: model.user.emailAddress, initialValue: model.user!.emailAddress!,
onChanged: (value) { onChanged: (value) {
email = value; email = value;
}, },
@ -297,8 +297,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
} }
if (beneficiaryType == BeneficiaryType.MyAccount) { if (beneficiaryType == BeneficiaryType.MyAccount) {
mobileNum = model.user.mobileNumber; mobileNum = model.user!.mobileNumber;
patientName = model.user.firstName; patientName = model.user!.firstName;
} }
if (beneficiaryType == BeneficiaryType.OtherAccount) { if (beneficiaryType == BeneficiaryType.OtherAccount) {
@ -309,7 +309,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
advanceModel.fileNumber = _fileTextController.text; advanceModel.fileNumber = _fileTextController.text;
advanceModel.hospitalsModel = _selectedHospital; advanceModel.hospitalsModel = _selectedHospital;
advanceModel.note = _notesTextController.text; advanceModel.note = _notesTextController.text;
advanceModel.email = email ?? model.user.emailAddress; advanceModel.email = email ?? model.user!.emailAddress;
advanceModel.amount = amount; advanceModel.amount = amount;
advanceModel.mobileNumber = mobileNum; advanceModel.mobileNumber = mobileNum;
advanceModel.patientName = patientName; advanceModel.patientName = patientName;
@ -323,7 +323,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
context, context,
FadePage( FadePage(
page: PaymentMethod( page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) { onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {}); setState(() {});
}, },
isShowInstallments: false, isShowInstallments: false,
@ -365,7 +365,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) { void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i), for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name! + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
]; ];
showDialog( showDialog(
context: context, context: context,
@ -386,7 +386,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) { void confirmSelectPatientDialog(List<PatientInfo> patientInfoList) {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < patientInfoList.length; i++) RadioSelectionDialogModel(patientInfoList[i].fullName, i), for (int i = 0; i < patientInfoList.length; i++) RadioSelectionDialogModel(patientInfoList[i].fullName!, i),
]; ];
showDialog( showDialog(
context: context, context: context,
@ -410,7 +410,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
if (getAllSharedRecordsByStatusList.isNotEmpty) { if (getAllSharedRecordsByStatusList.isNotEmpty) {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < getAllSharedRecordsByStatusList.length; i++) for (int i = 0; i < getAllSharedRecordsByStatusList.length; i++)
if (getAllSharedRecordsByStatusList[i].status == 3) RadioSelectionDialogModel(getAllSharedRecordsByStatusList[i].patientName, i), if (getAllSharedRecordsByStatusList[i].status == 3) RadioSelectionDialogModel(getAllSharedRecordsByStatusList[i].patientName!, i),
]; ];
showDialog( showDialog(
context: context, context: context,
@ -447,14 +447,14 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
String getHospitalName() { String getHospitalName() {
if (_selectedHospital != null) if (_selectedHospital != null)
return _selectedHospital.name; return _selectedHospital.name!;
else else
return TranslationBase.of(context).selectHospital; return TranslationBase.of(context).selectHospital;
} }
String getPatientName() { String getPatientName() {
if (_selectedPatientInfo != null) if (_selectedPatientInfo != null)
return _selectedPatientInfo.fullName; return _selectedPatientInfo.fullName!;
else else
return TranslationBase.of(context).selectPatientName; return TranslationBase.of(context).selectPatientName;
} }
@ -470,7 +470,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
String getFamilyMembersName() { String getFamilyMembersName() {
if (selectedPatientFamily != null) if (selectedPatientFamily != null)
return selectedPatientFamily.patientName; return selectedPatientFamily.patientName!;
else else
return TranslationBase.of(context).selectFamilyPatientName; return TranslationBase.of(context).selectFamilyPatientName;
} }

@ -31,11 +31,11 @@ import 'package:provider/provider.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
class ConfirmPaymentPage extends StatefulWidget { class ConfirmPaymentPage extends StatefulWidget {
final AdvanceModel advanceModel; final AdvanceModel? advanceModel;
final PatientInfoAndMobileNumber patientInfoAndMobileNumber; final PatientInfoAndMobileNumber? patientInfoAndMobileNumber;
final String selectedPaymentMethod; final String? selectedPaymentMethod;
AuthenticatedUser authenticatedUser; AuthenticatedUser? authenticatedUser;
String installmentPlan; String? installmentPlan;
ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser, this.installmentPlan}); ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser, this.installmentPlan});
@ -44,15 +44,15 @@ class ConfirmPaymentPage extends StatefulWidget {
} }
class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> { class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
MyInAppBrowser browser; late MyInAppBrowser browser;
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = ""; String transID = "";
String tamaraPaymentStatus; late String tamaraPaymentStatus;
String tamaraOrderID; late String tamaraOrderID;
// Pay _payClient; // Pay _payClient;
@ -71,12 +71,12 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
Navigator.pop(context, true); Navigator.pop(context, true);
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientInfoAndMobileNumber.projectID; appo.projectID = widget.patientInfoAndMobileNumber!.projectID;
// if (widget.selectedPaymentMethod == "ApplePay") { // if (widget.selectedPaymentMethod == "ApplePay") {
// startApplePay(); // startApplePay();
// } else { // } else {
projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet'); projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod!.toLowerCase(), type: 'wallet');
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); openPayment(widget.selectedPaymentMethod!, widget.authenticatedUser!, double.parse(widget.advanceModel!.amount!), AppoitmentAllHistoryResultList());
// } // }
}); });
} }
@ -88,7 +88,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
new SMSOTP( new SMSOTP(
context, context,
1, 1,
widget.patientInfoAndMobileNumber.mobileNumber, widget.patientInfoAndMobileNumber!.mobileNumber,
(value) { (value) {
submit(model, value); submit(model, value);
}, },
@ -134,14 +134,14 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.30,
child: widget.selectedPaymentMethod == "ApplePay" child: widget.selectedPaymentMethod == "ApplePay"
? SvgPicture.asset( ? SvgPicture.asset(
getImagePath(widget.selectedPaymentMethod), getImagePath(widget.selectedPaymentMethod!),
) )
: Image.asset(getImagePath(widget.selectedPaymentMethod)), : Image.asset(getImagePath(widget.selectedPaymentMethod!)),
), ),
Text( Text(
widget.advanceModel.hospitalsModel.projectOutSA widget.advanceModel!.hospitalsModel!.projectOutSA!
? '${widget.advanceModel.amount} ' + TranslationBase.of(context).aed ? '${widget.advanceModel!.amount} ' + TranslationBase.of(context).aed
: '${widget.advanceModel.amount} ' + TranslationBase.of(context).sar, : '${widget.advanceModel!.amount} ' + TranslationBase.of(context).sar,
// '${widget.advanceModel.amount} ' + TranslationBase.of(context).sar, // '${widget.advanceModel.amount} ' + TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
@ -161,7 +161,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
margin: EdgeInsets.all(3), margin: EdgeInsets.all(3),
child: NewTextFields( child: NewTextFields(
hintText: TranslationBase.of(context).fileNumber, hintText: TranslationBase.of(context).fileNumber,
initialValue: widget.advanceModel.fileNumber, initialValue: widget.advanceModel!.fileNumber!,
isEnabled: false, isEnabled: false,
), ),
), ),
@ -171,7 +171,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
margin: EdgeInsets.all(3), margin: EdgeInsets.all(3),
child: NewTextFields( child: NewTextFields(
hintText: TranslationBase.of(context).name, hintText: TranslationBase.of(context).name,
initialValue: widget.patientInfoAndMobileNumber.firstName, initialValue: widget.patientInfoAndMobileNumber!.firstName!,
isEnabled: false, isEnabled: false,
), ),
), ),
@ -183,7 +183,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).mobileNumber, hintText: TranslationBase.of(context).mobileNumber,
initialValue: widget.patientInfoAndMobileNumber.mobileNumber, initialValue: widget.patientInfoAndMobileNumber!.mobileNumber!,
isEnabled: false, isEnabled: false,
), ),
SizedBox( SizedBox(
@ -191,7 +191,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).depositorName, hintText: TranslationBase.of(context).depositorName,
initialValue: model.user.firstName + " " + model.user.middleName + " " + model.user.lastName, initialValue: model.user!.firstName! + " " + model.user!.middleName! + " " + model.user!.lastName!,
isEnabled: false, isEnabled: false,
), ),
SizedBox( SizedBox(
@ -199,7 +199,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
), ),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).notes, hintText: TranslationBase.of(context).notes,
initialValue: widget.advanceModel.note, initialValue: widget.advanceModel!.note!,
isEnabled: false, isEnabled: false,
), ),
], ],
@ -215,16 +215,16 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).confirm.toUpperCase(), TranslationBase.of(context).confirm.toUpperCase(),
() { () {
if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) { if (widget.advanceModel!.fileNumber == projectViewModel.user!.patientID.toString()) {
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); openPayment(widget.selectedPaymentMethod!, widget.authenticatedUser!, double.parse(widget.advanceModel!.amount!), AppoitmentAllHistoryResultList());
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel!.fileNumber!), projectID: widget.advanceModel!.hospitalsModel!.iD).then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model);
}); });
} }
projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet'); projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod!.toLowerCase(), type: 'wallet');
// startApplePay(); // startApplePay();
// if() // if()
@ -271,29 +271,29 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
AppleHeader appleHeader = new AppleHeader(); AppleHeader appleHeader = new AppleHeader();
ApplePaymentMethod applePaymentMethod = new ApplePaymentMethod(); ApplePaymentMethod applePaymentMethod = new ApplePaymentMethod();
applePayRequest.amount = widget.advanceModel.amount; applePayRequest.amount = widget.advanceModel!.amount;
applePayRequest.currency = "SAR"; applePayRequest.currency = "SAR";
applePayRequest.language = projectViewModel.isArabic ? "ar" : "en"; applePayRequest.language = projectViewModel.isArabic ? "ar" : "en";
applePayRequest.customername = projectViewModel.user.firstName; applePayRequest.customername = projectViewModel.user!.firstName;
applePayRequest.customerEmail = projectViewModel.user.emailAddress; applePayRequest.customerEmail = projectViewModel.user!.emailAddress;
applePayRequest.orderdescription = "Advance Payment"; applePayRequest.orderdescription = "Advance Payment";
applePayRequest.liveServiceid = ""; applePayRequest.liveServiceid = "";
applePayRequest.latitude = await this.sharedPref.getDouble(USER_LAT); applePayRequest.latitude = await this.sharedPref.getDouble(USER_LAT);
applePayRequest.longitude = await this.sharedPref.getDouble(USER_LONG); applePayRequest.longitude = await this.sharedPref.getDouble(USER_LONG);
applePayRequest.devicetoken = await sharedPref.getString(PUSH_TOKEN); applePayRequest.devicetoken = await sharedPref.getString(PUSH_TOKEN);
applePayRequest.clientrequestid = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber)); applePayRequest.clientrequestid = Utils.getAdvancePaymentTransID(widget.advanceModel!.hospitalsModel!.iD, int.parse(widget.advanceModel!.fileNumber!));
applePayRequest.projectid = widget.advanceModel.hospitalsModel.iD.toString(); applePayRequest.projectid = widget.advanceModel!.hospitalsModel!.iD.toString();
applePayRequest.serviceid = "3"; applePayRequest.serviceid = "3";
applePayRequest.patientid = projectViewModel.user.patientID.toString(); applePayRequest.patientid = projectViewModel.user!.patientID.toString();
applePayRequest.appleData = applePayResponse.token.data; applePayRequest.appleData = applePayResponse.token!.data;
applePayRequest.appleSignature = applePayResponse.token.signature; applePayRequest.appleSignature = applePayResponse.token!.signature;
appleHeader.appleEphemeralPublicKey = applePayResponse.token.header.ephemeralPublicKey; appleHeader.appleEphemeralPublicKey = applePayResponse.token!.header!.ephemeralPublicKey;
appleHeader.appleTransactionId = applePayResponse.token.header.transactionId; appleHeader.appleTransactionId = applePayResponse.token!.header!.transactionId;
appleHeader.applePublicKeyHash = applePayResponse.token.header.publicKeyHash; appleHeader.applePublicKeyHash = applePayResponse.token!.header!.publicKeyHash;
applePaymentMethod.appleType = getApplePayPaymentType(applePayResponse.paymentMethod.type); applePaymentMethod.appleType = getApplePayPaymentType(applePayResponse.paymentMethod!.type);
applePaymentMethod.appleNetwork = applePayResponse.paymentMethod.network; applePaymentMethod.appleNetwork = applePayResponse.paymentMethod!.network;
applePaymentMethod.appleDisplayName = applePayResponse.paymentMethod.displayName; applePaymentMethod.appleDisplayName = applePayResponse.paymentMethod!.displayName;
applePayRequest.appleHeader = appleHeader; applePayRequest.appleHeader = appleHeader;
applePayRequest.applePaymentMethod = applePaymentMethod; applePayRequest.applePaymentMethod = applePaymentMethod;
@ -355,18 +355,18 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber)); transID = Utils.getAdvancePaymentTransID(widget.advanceModel!.hospitalsModel!.iD, int.parse(widget.advanceModel!.fileNumber!));
browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Advance Payment", "Advance Payment",
transID, transID,
widget.advanceModel.hospitalsModel.iD.toString(), widget.advanceModel!.hospitalsModel!.iD.toString(),
widget.advanceModel.email, widget.advanceModel!.email!,
paymentMethod, paymentMethod,
widget.patientInfoAndMobileNumber.patientType, widget.patientInfoAndMobileNumber!.patientType,
widget.advanceModel.patientName, widget.advanceModel!.patientName!,
widget.advanceModel.fileNumber, widget.advanceModel!.fileNumber!,
authenticatedUser, authenticatedUser,
browser, browser,
false, false,
@ -386,8 +386,8 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
if (widget.selectedPaymentMethod == "TAMARA") { if (widget.selectedPaymentMethod == "TAMARA") {
Uri uri = new Uri.dataFromString(url); Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus']; tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
tamaraOrderID = uri.queryParameters['orderId']; tamaraOrderID = uri.queryParameters['orderId']!;
print(tamaraPaymentStatus); print(tamaraPaymentStatus);
print(tamaraOrderID); print(tamaraOrderID);
} }
@ -413,7 +413,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
if (widget.selectedPaymentMethod == "TAMARA" && tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") { if (widget.selectedPaymentMethod == "TAMARA" && tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
var res = { var res = {
"Amount": double.parse(widget.advanceModel.amount), "Amount": double.parse(widget.advanceModel!.amount!),
"ErrorMessage": null, "ErrorMessage": null,
"Fort_id": tamaraOrderID, "Fort_id": tamaraOrderID,
"Merchant_Reference": "5058637919318707883366", "Merchant_Reference": "5058637919318707883366",
@ -430,7 +430,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
String txn_ref; String txn_ref;
String amount; String amount;
String payment_method; String payment_method;
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(transID, false, AppGlobal.context).then((res) { service.checkPaymentStatus(transID, false, AppGlobal.context).then((res) {
@ -441,18 +441,18 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
payment_method = res['PaymentMethod']; payment_method = res['PaymentMethod'];
createAdvancePayment(res, appo); createAdvancePayment(res, appo);
projectViewModel.analytics.advancePayments.payment_success( projectViewModel.analytics.advancePayments.payment_success(
payment_type: 'wallet', payment_method: payment_method, txn_amount: "$amount", txn_currency: currency, txn_number: txn_ref, hospital: widget.advanceModel.hospitalsModel.name); payment_type: 'wallet', payment_method: payment_method, txn_amount: "$amount", txn_currency: currency, txn_number: txn_ref, hospital: widget.advanceModel!.hospitalsModel!.name!);
} else { } else {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
amount = widget.advanceModel.amount; amount = widget.advanceModel!.amount!;
payment_method = widget.selectedPaymentMethod; payment_method = widget.selectedPaymentMethod!;
projectViewModel.analytics.advancePayments.payment_fail( projectViewModel.analytics.advancePayments.payment_fail(
payment_type: 'wallet', payment_type: 'wallet',
payment_method: payment_method, payment_method: payment_method,
txn_amount: "$amount", txn_amount: "$amount",
txn_currency: currency, txn_currency: currency,
hospital: widget.advanceModel.hospitalsModel.name, hospital: widget.advanceModel!.hospitalsModel!.name!,
error_type: res['Response_Message']); error_type: res['Response_Message']);
} }
}).catchError((err) { }).catchError((err) {
@ -465,11 +465,11 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType, service.HIS_createAdvancePayment(appo, widget.advanceModel!.hospitalsModel!.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber!.patientType,
widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) widget.advanceModel!.patientName!, widget.advanceModel!.fileNumber, AppGlobal.context)
.then((res) { .then((res) {
addAdvancedNumberRequest( addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, widget.advanceModel.hospitalsModel.iD) Utils.isVidaPlusProject(projectViewModel, widget.advanceModel!.hospitalsModel!.iD)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference, paymentReference,

@ -15,13 +15,13 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ConfirmSMSDialog extends StatefulWidget { class ConfirmSMSDialog extends StatefulWidget {
final String phoneNumber; final String? phoneNumber;
final AdvanceModel advanceModel; final AdvanceModel? advanceModel;
final PatientInfoAndMobileNumber patientInfoAndMobileNumber; final PatientInfoAndMobileNumber? patientInfoAndMobileNumber;
final String selectedPaymentMethod; final String? selectedPaymentMethod;
const ConfirmSMSDialog( const ConfirmSMSDialog(
{Key key, {Key? key,
this.phoneNumber, this.phoneNumber,
this.advanceModel, this.advanceModel,
this.selectedPaymentMethod, this.selectedPaymentMethod,
@ -49,7 +49,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
String timerText = (TIMER_MIN - 1).toString() + ':59'; String timerText = (TIMER_MIN - 1).toString() + ':59';
int min = TIMER_MIN - 1; int min = TIMER_MIN - 1;
int sec = 59; int sec = 59;
Timer _timer; late Timer _timer;
resendCode() { resendCode() {
min = TIMER_MIN - 1; min = TIMER_MIN - 1;
@ -74,10 +74,10 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
}); });
} }
FocusNode focusD1; late FocusNode focusD1;
FocusNode focusD2; late FocusNode focusD2;
FocusNode focusD3; late FocusNode focusD3;
FocusNode focusD4; late FocusNode focusD4;
@override @override
void initState() { void initState() {
@ -157,7 +157,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
Form( Form(
key: verifyAccountForm, key: verifyAccountForm,
child: Container( child: Container(
width: SizeConfig.realScreenWidth * 0.90, width: SizeConfig.realScreenWidth! * 0.90,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -172,7 +172,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
child: TextFormField( child: TextFormField(
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
focusNode: focusD1, focusNode: focusD1,
//maxLength: 1, //maxLength: 1,
@ -203,7 +203,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
//maxLength: 1, //maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -230,7 +230,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
//maxLength: 1, //maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -256,7 +256,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
// maxLength: 1, // maxLength: 1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier! * 3,
), ),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: buildInputDecoration(context), decoration: buildInputDecoration(context),
@ -329,7 +329,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
} }
void submit(MyBalanceViewModel model) { void submit(MyBalanceViewModel model) {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState!.validate()) {
final activationCode = final activationCode =
digit1.text + digit2.text + digit3.text + digit4.text; digit1.text + digit2.text + digit3.text + digit4.text;
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
@ -346,7 +346,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
if (value.isEmpty) { if (value.isEmpty) {
return ''; return '';
} }
return null; return "null";
} }
InputDecoration buildInputDecoration(BuildContext context) { InputDecoration buildInputDecoration(BuildContext context) {

@ -9,12 +9,12 @@ import 'package:provider/provider.dart';
// todo 'sikander' remove this file when usage known // todo 'sikander' remove this file when usage known
class SelectCiteisDialog extends StatefulWidget { class SelectCiteisDialog extends StatefulWidget {
final List<CitiesModel> hospitals; final List<CitiesModel>? hospitals;
final Function(CitiesModel) onValueSelected; final Function(CitiesModel)? onValueSelected;
CitiesModel selectedHospital; CitiesModel? selectedHospital;
SelectCiteisDialog( SelectCiteisDialog(
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); {Key? key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override @override
_SelectCiteisDialogState createState() => _SelectCiteisDialogState(); _SelectCiteisDialogState createState() => _SelectCiteisDialogState();
@ -25,7 +25,7 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
void initState() { void initState() {
super.initState(); super.initState();
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; widget.selectedHospital = widget.selectedHospital ?? widget.hospitals![0];
} }
@override @override
@ -38,7 +38,7 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
children: [ children: [
Divider(), Divider(),
...List.generate( ...List.generate(
widget.hospitals.length, widget.hospitals!.length,
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -52,17 +52,17 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
widget.selectedHospital = widget.hospitals[index]; widget.selectedHospital = widget.hospitals![index];
}); });
}, },
child: ListTile( child: ListTile(
// title: Text(widget.hospitals[index].description + // title: Text(widget.hospitals[index].description +
// ' ${widget.hospitals[index].distanceInKilometers} KM'), // ' ${widget.hospitals[index].distanceInKilometers} KM'),
title: Text(projectProvider.isArabic title: Text(projectProvider.isArabic
? widget.hospitals[index].descriptionN ? widget.hospitals![index].descriptionN!
: widget.hospitals[index].description), : widget.hospitals![index].description!),
leading: Radio( leading: Radio(
value: widget.hospitals[index], value: widget.hospitals![index],
groupValue: widget.selectedHospital, groupValue: widget.selectedHospital,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (value) { onChanged: (value) {
@ -116,7 +116,7 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.onValueSelected(widget.selectedHospital); widget.onValueSelected!(widget.selectedHospital!);
Navigator.pop(context); Navigator.pop(context);
}, },
child: Padding( child: Padding(

@ -19,7 +19,7 @@ import 'advance_payment_page.dart';
class MyBalancePage extends StatelessWidget { class MyBalancePage extends StatelessWidget {
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -106,7 +106,7 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
Text( Text(
projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar, projectViewModel.user!.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -147,7 +147,7 @@ class MyBalancePage extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
balanceAmount.projectDescription, balanceAmount!.projectDescription!,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
letterSpacing: -0.64, letterSpacing: -0.64,
@ -157,7 +157,7 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
Text( Text(
amount.toStringAsFixed(2) + " " + (projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar), amount.toStringAsFixed(2) + " " + (projectViewModel.user!.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
letterSpacing: -0.64, letterSpacing: -0.64,

@ -4,8 +4,7 @@ import 'package:flutter/services.dart';
class NumberTextInputFormatter extends TextInputFormatter { class NumberTextInputFormatter extends TextInputFormatter {
@override @override
TextEditingValue formatEditUpdate( TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
TextEditingValue oldValue, TextEditingValue newValue) {
final int newTextLength = newValue.text.length; final int newTextLength = newValue.text.length;
int selectionIndex = newValue.selection.end; int selectionIndex = newValue.selection.end;
int usedSubstringIndex = 0; int usedSubstringIndex = 0;
@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter {
if (newValue.selection.end >= 10) selectionIndex++; if (newValue.selection.end >= 10) selectionIndex++;
} }
// Dump the rest. // Dump the rest.
if (newTextLength >= usedSubstringIndex) if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex));
newText.write(newValue.text.substring(usedSubstringIndex));
return TextEditingValue( return TextEditingValue(
text: newText.toString(), text: newText.toString(),
selection: TextSelection.collapsed(offset: selectionIndex), selection: TextSelection.collapsed(offset: selectionIndex),
@ -40,7 +38,7 @@ final _mobileFormatter = NumberTextInputFormatter();
class NewTextFields extends StatefulWidget { class NewTextFields extends StatefulWidget {
NewTextFields( NewTextFields(
{Key key, {Key? key,
this.type, this.type,
this.hintText, this.hintText,
this.suffixIcon, this.suffixIcon,
@ -64,53 +62,54 @@ class NewTextFields extends StatefulWidget {
this.borderOnlyError = false, this.borderOnlyError = false,
this.onSaved, this.onSaved,
this.onSuffixTap, this.onSuffixTap,
this.readOnly: false, this.readOnly = false,
this.maxLength, this.maxLength,
this.prefixIcon, this.prefixIcon,
this.bare = false, this.bare = false,
this.onTap, this.onTap,
this.fontSize = 14.0, this.fontSize = 14.0,
this.fontWeight = FontWeight.w600, this.fontWeight = FontWeight.w600,
this.hintColor, this.hintColor,
this.isEnabled = true,this.counterText=""}) this.isEnabled = true,
this.counterText = ""})
: super(key: key); : super(key: key);
final String hintText; final String? hintText;
// final String initialValue; // final String initialValue;
final String type; final String? type;
final bool autoFocus; final bool? autoFocus;
final IconData suffixIcon; final IconData? suffixIcon;
final Color suffixIconColor; final Color? suffixIconColor;
final Icon prefixIcon; final Icon? prefixIcon;
final VoidCallback onTap; final VoidCallback? onTap;
final TextEditingController controller; final TextEditingController? controller;
final TextInputType keyboardType; final TextInputType? keyboardType;
final FormFieldValidator validator; final FormFieldValidator? validator;
final Function onSaved; final Function(String?)? onSaved;
final Function onSuffixTap; final Function? onSuffixTap;
final Function onChanged; final Function(String)? onChanged;
final Function onSubmit; final Function(String)? onSubmit;
final bool readOnly; final bool readOnly;
final int maxLength; final int? maxLength;
final int minLines; final int? minLines;
final int maxLines; final int? maxLines;
final bool maxLengthEnforced; final bool maxLengthEnforced;
final bool bare; final bool bare;
final bool isEnabled; final bool isEnabled;
final TextInputAction inputAction; final TextInputAction? inputAction;
final double fontSize; final double fontSize;
final FontWeight fontWeight; final FontWeight fontWeight;
final bool keepPadding; final bool keepPadding;
final TextCapitalization textCapitalization; final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter>? inputFormatters;
final EdgeInsets padding; final EdgeInsets? padding;
final bool focus; final bool focus;
final bool borderOnlyError; final bool borderOnlyError;
final Color hintColor; final Color? hintColor;
final String initialValue; final String? initialValue;
final String counterText; final String counterText;
@override @override
_NewTextFieldsState createState() => _NewTextFieldsState(); _NewTextFieldsState createState() => _NewTextFieldsState();
} }
@ -155,9 +154,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AnimatedContainer( return AnimatedContainer(
duration: Duration(milliseconds: 300), duration: Duration(milliseconds: 300),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Container( child: Container(
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
child: TextFormField( child: TextFormField(
@ -187,8 +184,7 @@ class _NewTextFieldsState extends State<NewTextFields> {
autofocus: widget.autoFocus ?? false, autofocus: widget.autoFocus ?? false,
validator: widget.validator, validator: widget.validator,
onSaved: widget.onSaved, onSaved: widget.onSaved,
style: Theme.of(context).textTheme.bodyText2.copyWith( style: Theme.of(context).textTheme.bodyText2!.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
@ -198,24 +194,11 @@ class _NewTextFieldsState extends State<NewTextFields> {
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.hintText, labelText: widget.hintText,
counterText: widget.counterText, counterText: widget.counterText,
labelStyle: labelStyle: TextStyle(color: Theme.of(context).textTheme.bodyText1!.color),
TextStyle(color: Theme.of(context).textTheme.bodyText1.color), errorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(12.0)),
errorBorder: OutlineInputBorder( focusedErrorBorder: OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(0.5), width: 1.0), borderRadius: BorderRadius.circular(8.0)),
borderSide: BorderSide( focusedBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)),
color: Theme.of(context).errorColor.withOpacity(0.5), disabledBorder: OutlineInputBorder(borderSide: BorderSide(color: Colors.white, width: 1.0), borderRadius: BorderRadius.circular(12)),
width: 1.0),
borderRadius: BorderRadius.circular(12.0)),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Theme.of(context).errorColor.withOpacity(0.5),
width: 1.0),
borderRadius: BorderRadius.circular(8.0)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12)),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12)),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.white, width: 1.0), borderSide: BorderSide(color: Colors.white, width: 1.0),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),

@ -63,7 +63,7 @@ class DoctorHomePage extends StatelessWidget {
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
DoctorList _doctorList = model.patientDoctorAppointmentList[index].patientDoctorAppointmentList[_index]; DoctorList _doctorList = model.patientDoctorAppointmentList[index].patientDoctorAppointmentList![_index];
DoctorList doctorList = DoctorList( DoctorList doctorList = DoctorList(
projectID: _doctorList.projectID, projectID: _doctorList.projectID,
setupID: _doctorList.setupID, setupID: _doctorList.setupID,
@ -81,11 +81,11 @@ class DoctorHomePage extends StatelessWidget {
nationalityFlagURL: _doctorList.nationalityFlagURL); nationalityFlagURL: _doctorList.nationalityFlagURL);
return DoctorView( return DoctorView(
doctor: doctorList, doctor: doctorList,
isLiveCareAppointment: _doctorList.isLiveCareClinic, isLiveCareAppointment: _doctorList.isLiveCareClinic!,
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: model.patientDoctorAppointmentList[index].patientDoctorAppointmentList.length), itemCount: model.patientDoctorAppointmentList[index].patientDoctorAppointmentList!.length),
); );
}, },
itemCount: model.patientDoctorAppointmentList.length), itemCount: model.patientDoctorAppointmentList.length),

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
class DoctorInformation extends StatefulWidget { class DoctorInformation extends StatefulWidget {
final DoctorProfile doctorProfile; final DoctorProfile doctorProfile;
const DoctorInformation({Key key, this.doctorProfile}) : super(key: key); const DoctorInformation({Key? key, required this.doctorProfile}) : super(key: key);
@override @override
_DoctorInformationState createState() => _DoctorInformationState(); _DoctorInformationState createState() => _DoctorInformationState();
@ -58,7 +58,7 @@ class _DoctorInformationState extends State<DoctorInformation> {
decoration: decoration:
BoxDecoration(shape: BoxShape.circle, boxShadow: [ BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow( BoxShadow(
color: Colors.red[700], color: Colors.red[700]!,
blurRadius: 1.0, blurRadius: 1.0,
spreadRadius: 0.0, spreadRadius: 0.0,
) )
@ -161,7 +161,7 @@ class _DoctorInformationState extends State<DoctorInformation> {
decoration: decoration:
BoxDecoration(shape: BoxShape.circle, boxShadow: [ BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow( BoxShadow(
color: Colors.red[700], color: Colors.red[700]!,
blurRadius: 1.0, blurRadius: 1.0,
spreadRadius: 0.0, spreadRadius: 0.0,
) )

@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
class DoctorProfilePage extends StatefulWidget { class DoctorProfilePage extends StatefulWidget {
final PatientDoctorAppointment patientDoctorAppointment; final PatientDoctorAppointment patientDoctorAppointment;
DoctorProfilePage({this.patientDoctorAppointment}); DoctorProfilePage({required this.patientDoctorAppointment});
@override @override
_DoctorProfilePageState createState() => _DoctorProfilePageState createState() =>
@ -17,8 +17,8 @@ class DoctorProfilePage extends StatefulWidget {
class _DoctorProfilePageState extends State<DoctorProfilePage> class _DoctorProfilePageState extends State<DoctorProfilePage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
TabController _tabController; late TabController _tabController;
final PatientDoctorAppointment patientDoctorAppointment; late PatientDoctorAppointment patientDoctorAppointment;
_DoctorProfilePageState(this.patientDoctorAppointment); _DoctorProfilePageState(this.patientDoctorAppointment);
@ -155,6 +155,7 @@ class _DoctorProfilePageState extends State<DoctorProfilePage>
height: MediaQuery.of(context).size.height * 0.8, height: MediaQuery.of(context).size.height * 0.8,
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
DoctorInformation( DoctorInformation(
doctorProfile: model.doctorProfile, doctorProfile: model.doctorProfile,

@ -11,7 +11,7 @@ class ClassesPage extends StatelessWidget {
final String projectName; final String projectName;
final int projectID; final int projectID;
const ClassesPage({Key key, this.glassPerscription, this.appointmentNo, this.projectName, this.projectID}) : super(key: key); const ClassesPage({Key? key, this.glassPerscription, this.appointmentNo, this.projectName, this.projectID}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -30,7 +30,7 @@ defaultTheme({fontName}) {
scaffoldBackgroundColor: Color(0xffF8F8F8), scaffoldBackgroundColor: Color(0xffF8F8F8),
canvasColor: Colors.white, canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff515A5D), primaryColor: Color(0xff515A5D),
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
@ -76,7 +76,7 @@ invertThemes({fontName}) {
scaffoldBackgroundColor: Color(0xff000000), scaffoldBackgroundColor: Color(0xff000000),
canvasColor: Colors.black, canvasColor: Colors.black,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff515A5D), primaryColor: Color(0xff515A5D),
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
@ -126,7 +126,7 @@ bwThemes({fontName}) {
scaffoldBackgroundColor: Color(0xffffffe4), scaffoldBackgroundColor: Color(0xffffffe4),
canvasColor: Colors.black, canvasColor: Colors.black,
backgroundColor: Color(0xffffffe4), backgroundColor: Color(0xffffffe4),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xfffffff4), primaryColor: Color(0xfffffff4),
toggleableActiveColor: secondaryColor, toggleableActiveColor: secondaryColor,
@ -163,7 +163,7 @@ dimTheme({fontName}) {
scaffoldBackgroundColor: Color(0xffEEEEEE), scaffoldBackgroundColor: Color(0xffEEEEEE),
canvasColor: Colors.white, canvasColor: Colors.white,
backgroundColor: Color.fromRGBO(255, 255, 255, 1), backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100]!.withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Color(0xff40ACC9), primaryColor: Color(0xff40ACC9),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),

@ -19,7 +19,7 @@ class CalendarUtils {
_completer = Completer<CalendarUtils>(); _completer = Completer<CalendarUtils>();
try { try {
final calendarsResult = await deviceCalendarPlugin.retrieveCalendars(); final calendarsResult = await deviceCalendarPlugin.retrieveCalendars();
_completer?.complete(CalendarUtils._(calendarsResult?.data!)); _completer?.complete(CalendarUtils._(calendarsResult.data!));
} on Exception catch (e) { } on Exception catch (e) {
_completer!.completeError(e); _completer!.completeError(e);
final Future<CalendarUtils> sharedPrefsFuture = _completer!.future; final Future<CalendarUtils> sharedPrefsFuture = _completer!.future;
@ -30,15 +30,27 @@ class CalendarUtils {
return _completer!.future; return _completer!.future;
} }
Future createOrUpdateEvents({List<DateTime> scheduleList, String title, String description, List<DateTime> scheduleDateTime, List<DayOfWeek> daysOfWeek}) async { Future createOrUpdateEvents({List<DateTime>? scheduleList, String? title, String? description, List<DateTime>? scheduleDateTime, List<DayOfWeek>? daysOfWeek}) async {
List<Event> events =[]; List<Event> events = [];
scheduleDateTime.forEach((element) { Location _currentLocation;
if (DateTime.now().timeZoneName == "+04")
_currentLocation = getLocation('Asia/Dubai');
else
_currentLocation = getLocation('Asia/Riyadh');
scheduleDateTime!.forEach((element) {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
daysOfWeek: daysOfWeek, daysOfWeek: daysOfWeek,
endDate: element, endDate: element,
); );
Event event = Event(writableCalendars.id, recurrenceRule: recurrenceRule, start: element, end: element.add(Duration(minutes: 30)), title: title, description: description); //added byAamir Tz Time
Event event = Event(writableCalendars!.id,
recurrenceRule: recurrenceRule,
start: TZDateTime.from(element, _currentLocation),
end: TZDateTime.from(element.add(Duration(minutes: 30)), _currentLocation),
title: title,
description: description);
events.add(event); events.add(event);
}); });
@ -47,7 +59,7 @@ class CalendarUtils {
}); });
} }
Future createOrUpdateEvent({String title, String description, DateTime scheduleDateTime, String eventId}) async { Future createOrUpdateEvent({String? title, String? description, DateTime? scheduleDateTime, String? eventId}) async {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
// daysOfWeek: daysOfWeek, // daysOfWeek: daysOfWeek,
@ -60,17 +72,17 @@ class CalendarUtils {
else else
_currentLocation = getLocation('Asia/Riyadh'); _currentLocation = getLocation('Asia/Riyadh');
TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime, _currentLocation); TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation);
// print("eventId: " + eventId); // print("eventId: " + eventId);
// print("writableCalendars-name: " + writableCalendars.name); // print("writableCalendars-name: " + writableCalendars.name);
// print("writableCalendars-Id: " + writableCalendars.id); // print("writableCalendars-Id: " + writableCalendars.id);
// print("writableCalendarsToString: " + writableCalendars.toString()); // print("writableCalendarsToString: " + writableCalendars.toString());
Event event = Event(writableCalendars.id, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description); Event event = Event(writableCalendars!.id, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description);
deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) {
print("catchError " + e.toString()); print("catchError " + e.toString());
}).whenComplete(() { }).whenComplete(() {
print("whenComplete " + eventId); print("whenComplete " + eventId!);
}); });
} }
@ -87,8 +99,8 @@ class CalendarUtils {
Future createCalendar( Future createCalendar(
String calendarName, { String calendarName, {
Color calendarColor, Color? calendarColor,
String localAccountName, String? localAccountName,
}) async { }) async {
return await deviceCalendarPlugin.createCalendar(calendarName, calendarColor: calendarColor, localAccountName: localAccountName); return await deviceCalendarPlugin.createCalendar(calendarName, calendarColor: calendarColor, localAccountName: localAccountName);
} }

@ -137,7 +137,7 @@ class LocalNotification {
///Repeat notification every day at approximately 10:00:00 am ///Repeat notification every day at approximately 10:00:00 am
Future showDailyAtTime() async { Future showDailyAtTime() async {
var time = Time(10, 0, 0); // var time = Time(10, 0, 0);
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); // var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description');
// var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); // var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(
@ -152,7 +152,7 @@ class LocalNotification {
///Repeat notification weekly on Monday at approximately 10:00:00 am ///Repeat notification weekly on Monday at approximately 10:00:00 am
Future showWeeklyAtDayAndTime() async { Future showWeeklyAtDayAndTime() async {
var time = Time(10, 0, 0); // var time = Time(10, 0, 0);
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); // var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description');
// var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); // var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(

@ -4,16 +4,16 @@ import 'package:shared_preferences/shared_preferences.dart';
class AppSharedPreferences { class AppSharedPreferences {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance(); Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
Map<String, dynamic> _allData; Map<String, dynamic>? _allData;
// To Test Saved Data // To Test Saved Data
Future<Map<String, dynamic>> getAll() async{ Future<Map<String, dynamic>> getAll() async {
final prefs = (await _prefs); final prefs = (await _prefs);
_allData = {}; _allData = {};
prefs.getKeys().forEach((key) { prefs.getKeys().forEach((key) {
_allData[key] = prefs.get(key); _allData![key] = prefs.get(key);
}); });
return _allData; return _allData!;
} }
/// Save String [key] the key for save value [value] the value we need to save it /// Save String [key] the key for save value [value] the value we need to save it
@ -75,7 +75,7 @@ class AppSharedPreferences {
getStringWithDefaultValue(String key, String defaultVal) async { getStringWithDefaultValue(String key, String defaultVal) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload(); await prefs.reload();
String value = prefs.getString(key); String value = prefs.getString(key)!;
return value == null ? defaultVal : value; return value == null ? defaultVal : value;
} }

@ -5,44 +5,44 @@ import 'package:fluttertoast/fluttertoast.dart';
class AppToast { class AppToast {
static void showToast({ static void showToast({
@required String message, required String message,
Toast toastLength, Toast? toastLength,
int timeInSeconds, int? timeInSeconds,
double fontSize, double? fontSize,
ToastGravity toastGravity, ToastGravity? toastGravity,
Color backgroundColor, Color? backgroundColor,
Color textColor, Color? textColor,
int radius, int? radius,
int elevation, int? elevation,
int imageSize, int? imageSize,
}) { }) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: backgroundColor, textColor: textColor, fontSize: fontSize); msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds!, backgroundColor: backgroundColor, textColor: textColor, fontSize: fontSize);
} }
static void showSuccessToast({ static void showSuccessToast({
@required String message, required String message,
Toast toastLength = Toast.LENGTH_LONG, Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds, int? timeInSeconds,
double fontSize = 16, double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP, ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white, Color textColor = Colors.white,
int radius, int? radius,
int elevation, int? elevation,
int imageSize = 32, int imageSize = 32,
}) { }) {
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize); Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds!, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize);
} }
static void showErrorToast({ static void showErrorToast({
@required String message, required String message,
Toast toastLength = Toast.LENGTH_LONG, Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds = 2, int timeInSeconds = 2,
double fontSize = 16, double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP, ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white, Color textColor = Colors.white,
int radius = 15, int radius = 15,
int elevation, int? elevation,
int imageSize = 32, int imageSize = 32,
}) { }) {
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize); Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize);

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -9,12 +10,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:huawei_location/location/fused_location_provider_client.dart'; import 'package:huawei_location/huawei_location.dart';
import 'package:huawei_location/location/location.dart';
import 'package:huawei_location/location/location_callback.dart';
import 'package:huawei_location/location/location_request.dart';
import 'package:huawei_location/location/location_settings_request.dart';
import 'package:huawei_location/permission/permission_handler.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -28,9 +24,9 @@ class LocationUtils {
LocationUtils({required this.isShowConfirmDialog, required this.context, this.isHuawei = false}); LocationUtils({required this.isShowConfirmDialog, required this.context, this.isHuawei = false});
void getCurrentLocation({required Function(LatLng) callBack}) async { void getCurrentLocation({Function(LatLng)? callBack}) async {
if (Platform.isAndroid && isHuawei) { if (Platform.isAndroid && isHuawei) {
_getHMSCurrentLocation(callBack); _getHMSCurrentLocation(callBack!);
} else { } else {
Geolocator.isLocationServiceEnabled().then((value) async { Geolocator.isLocationServiceEnabled().then((value) async {
if (value) { if (value) {
@ -44,7 +40,9 @@ class LocationUtils {
if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) { if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () async { Utils.showPermissionConsentDialog(context, TranslationBase
.of(context)
.locationPermissionDialog, () async {
final hasPermission = await _handlePermission(); final hasPermission = await _handlePermission();
if (hasPermission) { if (hasPermission) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) { Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) {
@ -56,7 +54,9 @@ class LocationUtils {
} }
}); });
} else { } else {
if (await Permission.location.request().isGranted) { if (await Permission.location
.request()
.isGranted) {
getCurrentLocation(callBack: callBack); getCurrentLocation(callBack: callBack);
} else { } else {
setZeroLocation(); setZeroLocation();
@ -102,7 +102,9 @@ class LocationUtils {
late LocationCallback _locationCallback; late LocationCallback _locationCallback;
_getHMSCurrentLocation(Function(LatLng) callBack) async { _getHMSCurrentLocation(Function(LatLng) callBack) async {
PermissionHandler permissionHandler = PermissionHandler(); PermissionStatus permissionHandler = await Permission.location.request();
// print(statuses[Permission.location]);
int _locationUpdateCbId = 0; int _locationUpdateCbId = 0;
doIt() { doIt() {
@ -120,7 +122,17 @@ class LocationUtils {
Location location = locationResult.lastLocation!; Location location = locationResult.lastLocation!;
locationService.removeLocationUpdatesCb(_locationUpdateCbId); locationService.removeLocationUpdatesCb(_locationUpdateCbId);
callBack(LatLng(location.latitude!, location.longitude!)); callBack(LatLng(location.latitude!, location.longitude!));
setLocation(Position(latitude: location.latitude!, longitude: location.longitude!, altitude: location.altitude!,timestamp: null, accuracy: 1.0, heading: 0.0, speed: 0.0, speedAccuracy: 1)); setLocation(Position(
latitude: location.latitude!,
longitude: location.longitude!,
altitude: location.altitude!,
timestamp: null,
accuracy: 1.0,
heading: 0.0,
speed: 0.0,
speedAccuracy: 1,
altitudeAccuracy: 0.0,
headingAccuracy: 0.0));
}, onLocationAvailability: (locationAvailability) { }, onLocationAvailability: (locationAvailability) {
print("onLocationAvailability: $locationAvailability"); print("onLocationAvailability: $locationAvailability");
})); }));
@ -131,7 +143,7 @@ class LocationUtils {
}); });
} }
if (await permissionHandler.hasLocationPermission()) { if (await permissionHandler.isGranted) {
doIt(); doIt();
} else { } else {
bool has = await requestPermissions(); bool has = await requestPermissions();
@ -144,10 +156,18 @@ class LocationUtils {
showErrorLocationDialog(bool isPermissionError) { showErrorLocationDialog(bool isPermissionError) {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).locationDialogMessage, confirmMessage: TranslationBase
okText: TranslationBase.of(context).confirm, .of(context)
cancelText: TranslationBase.of(context).cancel_nocaps, .locationDialogMessage,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings(), Navigator.of(context).canPop()}, okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
okFunction: () =>
{ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else
Geolocator.openLocationSettings(), Navigator.of(context).canPop()},
cancelFunction: () => {}); cancelFunction: () => {});
return dialog.showAlertDialog(context); return dialog.showAlertDialog(context);
} }

@ -220,7 +220,7 @@ class Utils {
} }
static List<Widget> myMedicalList({ProjectViewModel? projectViewModel, BuildContext? context, bool? isLogin, count}) { static List<Widget> myMedicalList({ProjectViewModel? projectViewModel, BuildContext? context, bool? isLogin, count}) {
List<Widget> medical =[]; List<Widget> medical = [];
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null,
@ -242,12 +242,14 @@ class Utils {
left: 8, left: 8,
top: 4, top: 4,
child: badge_import.Badge( child: badge_import.Badge(
toAnimate: false, badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false),
badgeStyle: badge_import.BadgeStyle(
elevation: 0, elevation: 0,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor!.withOpacity(1.0), badgeColor: secondaryColor!.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
),
position: badge_import.BadgePosition.topEnd(),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
@ -260,12 +262,14 @@ class Utils {
right: 8, right: 8,
top: 4, top: 4,
child: badge_import.Badge( child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: badge_import.BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false),
badgeStyle: badge_import.BadgeStyle(
elevation: 0,
shape: badge_import.BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor!.withOpacity(1.0), badgeColor: secondaryColor!.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
@ -597,7 +601,7 @@ class Utils {
} }
static List<Widget> myMedicalListHomePage({ProjectViewModel? projectViewModel, BuildContext? context, bool? isLogin, count}) { static List<Widget> myMedicalListHomePage({ProjectViewModel? projectViewModel, BuildContext? context, bool? isLogin, count}) {
List<Widget> medical =[]; List<Widget> medical = [];
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null,
@ -615,12 +619,14 @@ class Utils {
left: 8, left: 8,
top: 4, top: 4,
child: badge_import.Badge( child: badge_import.Badge(
toAnimate: false,
elevation: 0,
position: badge_import.BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false),
badgeStyle: badge_import.BadgeStyle(
elevation: 0,
shape: badge_import.BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor!.withOpacity(1.0), badgeColor: secondaryColor!.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
@ -633,12 +639,14 @@ class Utils {
right: 8, right: 8,
top: 4, top: 4,
child: badge_import.Badge( child: badge_import.Badge(
toAnimate: false, badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false),
badgeStyle: badge_import.BadgeStyle(
elevation: 0, elevation: 0,
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor!.withOpacity(1.0), badgeColor: secondaryColor!.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
),
position: badge_import.BadgePosition.topEnd(),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
@ -820,10 +828,9 @@ class Utils {
return isVidaPlus; return isVidaPlus;
} }
// static String generateSignature() { // static String generateSignature() {
// //
// } // }
} }
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), required Widget child}) { Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), required Widget child}) {

@ -7,10 +7,7 @@ import 'package:google_maps_flutter/google_maps_flutter.dart' as googlemap;
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_map/components/callbacks.dart'; import 'package:huawei_map/huawei_map.dart' as hmsMap;
import 'package:huawei_map/components/cameraPosition.dart' as cameraposition;
import 'package:huawei_map/components/cameraPosition.dart';
import 'package:huawei_map/map.dart' as hmsMap;
class AppMap extends StatefulWidget { class AppMap extends StatefulWidget {
late VoidCallback onCameraMove; late VoidCallback onCameraMove;
@ -25,13 +22,13 @@ class AppMap extends StatefulWidget {
@override @override
State<StatefulWidget> createState() => _state = AppMapState(); State<StatefulWidget> createState() => _state = AppMapState();
moveTo({ required CameraPosition cameraPostion}) { moveTo({ required googlemap.CameraPosition cameraPostion}) {
if (_state!.isHuawei) { if (_state!.isHuawei) {
final cameraJson = cameraPostion?.toMap(); final cameraJson = cameraPostion.toMap();
final camera = hmsMap.CameraPosition.fromMap(cameraJson); final camera = hmsMap.CameraPosition.fromMap(cameraJson);
_state?._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera)); _state?._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera));
} else { } else {
_state?.googleMapController.animateCamera(googlemap.CameraUpdate.newCameraPosition(cameraPostion! as googlemap.CameraPosition)); _state?.googleMapController.animateCamera(googlemap.CameraUpdate.newCameraPosition(cameraPostion as googlemap.CameraPosition));
} }
} }
} }

@ -107,11 +107,17 @@ class BottomNavigationItem extends StatelessWidget {
right: 18.0, right: 18.0,
bottom: 28.0, bottom: 28.0,
child: badge_import.Badge( child: badge_import.Badge(
toAnimate: false, badgeStyle: badge_import.BadgeStyle(
position: badge_import.BadgePosition.topEnd(),
shape: badge_import.BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor!.withOpacity(1.0), badgeColor: secondaryColor!.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8)
),
// toAnimate: false,
badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false),
position: badge_import.BadgePosition.topEnd(),
// shape: badge_import.BadgeShape.circle,
// badgeColor: secondaryColor!.withOpacity(1.0),
// borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)), child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)),

@ -11,7 +11,7 @@ extension WithContainer on Widget {
class DefaultButton extends StatelessWidget { class DefaultButton extends StatelessWidget {
final String text; final String text;
final VoidCallback onPress; final VoidCallback? onPress;
final Color textColor; final Color textColor;
final Color? color; final Color? color;
final Color? disabledColor; final Color? disabledColor;

@ -75,7 +75,7 @@ class AppScaffold extends StatefulWidget {
final int? dropdownIndexValue; final int? dropdownIndexValue;
List<String>? dropDownList; List<String>? dropDownList;
final void Function(int?)? dropDownIndexChange; final void Function(int?)? dropDownIndexChange;
VoidCallbackAction? onTap; VoidCallbackAction()? onTap;
final bool isMainPharmacyPages; final bool isMainPharmacyPages;
final bool extendBody; final bool extendBody;
final ValueChanged<int>? changeCurrentTab; final ValueChanged<int>? changeCurrentTab;

@ -13,10 +13,9 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart'; import 'package:geocoding/geocoding.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart' as googleMap; import 'package:google_maps_flutter/google_maps_flutter.dart' as googleMap;
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_map/components/cameraPosition.dart';
import 'package:huawei_map/components/latLng.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PickupLocationFromMap extends StatefulWidget { class PickupLocationFromMap extends StatefulWidget {
@ -57,7 +56,8 @@ class _PickupLocationFromMapState extends State<PickupLocationFromMap> {
} }
appMap = AppMap( appMap = AppMap(
kGooglePlex.toMap(), //changed by Aamir
kGooglePlex.toMap() as Map<dynamic, dynamic>,
onCameraMove: () { onCameraMove: () {
_updatePosition(kGooglePlex); _updatePosition(kGooglePlex);
}, },
@ -180,7 +180,7 @@ class _PickupLocationFromMapState extends State<PickupLocationFromMap> {
void _updatePosition(CameraPosition _position) { void _updatePosition(CameraPosition _position) {
print(_position); print(_position);
latitude = _position.target.lat; latitude = _position.target.latitude;
longitude = _position.target.lng; longitude = _position.target.longitude;
} }
} }

@ -34,13 +34,14 @@ dependencies:
health: ^3.0.3 health: ^3.0.3
#chart #chart
fl_chart: ^0.45.0 fl_chart: 0.45.0
#Camera Preview #Camera Preview
camera: ^0.10.1 camera: ^0.10.1
# Permissions # Permissions
permission_handler: ^10.2.0 permission_handler: ^11.0.1
# Flutter Html View # Flutter Html View
flutter_html: ^2.2.1 flutter_html: ^2.2.1
@ -62,14 +63,14 @@ dependencies:
# Progress bar # Progress bar
flutter_progress_hud: ^2.0.2 flutter_progress_hud: ^2.0.2
percent_indicator: ^3.4.0 percent_indicator: ^4.2.3
# Icons # Icons
font_awesome_flutter: any font_awesome_flutter: any
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.0
# Image Attachments # Image Attachments
image_picker: ^0.8.5+3 image_picker: ^1.0.4
#GIF image #GIF image
# flutter_gifimage: ^1.0.1 # flutter_gifimage: ^1.0.1
@ -90,13 +91,13 @@ dependencies:
google_maps_flutter: ^2.1.1 google_maps_flutter: ^2.1.1
# Huawei # Huawei
huawei_map: 6.5.0+301 huawei_map: ^6.11.0+304
huawei_push: ^6.5.0+300 huawei_push: ^6.5.0+300
# Qr code Scanner TODO fix it # Qr code Scanner TODO fix it
# barcode_scanner: ^1.0.1 # barcode_scanner: ^1.0.1
# flutter_polyline_points: ^1.0.0 # flutter_polyline_points: ^1.0.0
location: ^4.3.0 location: ^5.0.3
# Qr code Scanner # Qr code Scanner
# barcode_scan_fix: ^1.0.2 # barcode_scan_fix: ^1.0.2
barcode_scan2: ^4.2.2 barcode_scan2: ^4.2.2
@ -105,7 +106,7 @@ dependencies:
flutter_rating_bar: ^4.0.1 flutter_rating_bar: ^4.0.1
# Calendar # Calendar
syncfusion_flutter_calendar: ^19.3.55 syncfusion_flutter_calendar: ^23.1.42
# SVG Images # SVG Images
# flutter_svg: ^0.23.0+1 # flutter_svg: ^0.23.0+1
@ -114,7 +115,7 @@ dependencies:
manage_calendar_events: ^2.0.1 manage_calendar_events: ^2.0.1
#InAppBrowser #InAppBrowser
flutter_inappwebview: 5.7.2+3 flutter_inappwebview: ^5.8.0
#Circular progress bar for reverse timer #Circular progress bar for reverse timer
circular_countdown_timer: ^0.2.0 circular_countdown_timer: ^0.2.0
@ -147,19 +148,19 @@ dependencies:
#Flutter WebRTC #Flutter WebRTC
flutter_webrtc: ^0.9.7 flutter_webrtc: ^0.9.7
screen_brightness: ^0.1.2 screen_brightness: ^0.2.2+1
#google maps places #google maps places
google_maps_place_picker_mb: ^3.0.0 google_maps_place_picker_mb: ^3.0.0
# google_maps_place_picker: ^2.1.0-nullsafety.3 # google_maps_place_picker: ^2.1.0-nullsafety.3
map_launcher: ^2.5.0+1 map_launcher: ^3.0.1
#countdown timer for Upcoming List #countdown timer for Upcoming List
flutter_countdown_timer: ^4.1.0 flutter_countdown_timer: ^4.1.0
#Dependencies for video call implementation #Dependencies for video call implementation
native_device_orientation: ^1.0.0 native_device_orientation: ^1.0.0
wakelock: ^0.5.6 wakelock: ^0.6.2
after_layout: ^1.1.0 after_layout: ^1.1.0
# twilio_programmable_video: ^0.11.0+1 # twilio_programmable_video: ^0.11.0+1
cached_network_image: ^3.1.0+1 cached_network_image: ^3.1.0+1
@ -177,11 +178,11 @@ dependencies:
speech_to_text: ^6.1.1 speech_to_text: ^6.1.1
# path: speech_to_text # path: speech_to_text
in_app_update: ^3.0.0 in_app_update: ^4.2.2
in_app_review: ^2.0.3 in_app_review: ^2.0.3
badges: ^2.0.1 badges: ^3.1.2
flutter_app_icon_badge: ^2.0.0 flutter_app_icon_badge: ^2.0.0
# syncfusion_flutter_sliders: ^19.3.55 # syncfusion_flutter_sliders: ^19.3.55
# searchable_dropdown: ^1.1.3 # searchable_dropdown: ^1.1.3
@ -189,13 +190,13 @@ dependencies:
youtube_player_flutter: ^8.0.0 youtube_player_flutter: ^8.0.0
# Dep by Zohaib # Dep by Zohaib
shimmer: ^2.0.0 shimmer: ^3.0.0
carousel_slider: ^4.0.0 carousel_slider: ^4.0.0
# flutter_material_pickers: ^3.1.2 # flutter_material_pickers: ^3.1.2
flutter_staggered_grid_view: ^0.4.1 flutter_staggered_grid_view: ^0.7.0
# flutter_hms_gms_availability: ^2.0.0 # flutter_hms_gms_availability: ^2.0.0
huawei_hmsavailability: ^6.6.0+300 huawei_hmsavailability: ^6.6.0+300
huawei_location: 6.0.0+302 huawei_location: ^6.11.0+301
# Marker Animation # Marker Animation
# flutter_animarker: ^3.2.0 # flutter_animarker: ^3.2.0
@ -206,7 +207,7 @@ dependencies:
# sms_retriever: ^1.0.0 # sms_retriever: ^1.0.0
sms_otp_auto_verify: ^2.1.0 sms_otp_auto_verify: ^2.1.0
flutter_ios_voip_kit: ^0.1.0 flutter_ios_voip_kit: ^0.1.0
google_api_availability: ^3.0.1 google_api_availability: ^5.0.0
# open_file: ^3.2.1 # open_file: ^3.2.1
open_filex: ^4.3.2 open_filex: ^4.3.2
path_provider: ^2.0.8 path_provider: ^2.0.8

Loading…
Cancel
Save