Merge branch 'dev_v3.13.6_automigrate' into dev_v3.13.6

# Conflicts:
#	lib/main.dart
#	lib/uitl/CalendarUtils.dart
#	lib/uitl/app_shared_preferences.dart
dev_v3.13.6_voipcall
devamirsaleemahmad 2 years ago
commit d8836d5e89

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

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

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

@ -35,7 +35,7 @@ class CMCLocationPage extends StatefulWidget {
final double longitude;
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
_CMCLocationPageState createState() => _CMCLocationPageState();
@ -65,8 +65,8 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
appMap = AppMap(
_kGooglePlex.toMap() as Map<dynamic, dynamic>,
// changed by Aamir
onCameraMove: (cam) {
_updatePosition(cam as gmaps.CameraPosition);
onCameraMove: () {
_updatePosition(_kGooglePlex);
// changed by Aamir Huawei & Google Issue may Be
},
onMapCreated: () {

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

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

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

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

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

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

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

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

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

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

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

@ -8,12 +8,12 @@ class VideoCallWebPage extends StatelessWidget{
final GlobalKey webViewKey = GlobalKey();
// InAppWebViewController webViewController;
InAppWebViewController controller;
InAppWebViewController? controller;
URLRequest request;
URLRequest? request;
final String receiverId;
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"));
}
@ -92,18 +92,18 @@ class VideoCallWebPage extends StatelessWidget{
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);
if(url.toString().toLowerCase().contains("endcallpage")){
LandingPage.isOpenCallPage = false;
if(LandingPage.isOpenCallPage == true) {
print("END CALL!!!");
// controller.goBack();
Navigator.pop(webViewKey.currentContext);
Navigator.pop(webViewKey.currentContext!);
}
}
}
@ -114,7 +114,7 @@ class VideoCallWebPage extends StatelessWidget{
// Navigator.pop(webViewKey.currentContext);
// }
if(uri.toString().toLowerCase().contains("endcallpage")){
Navigator.pop(webViewKey.currentContext);
Navigator.pop(webViewKey.currentContext!);
}
return NavigationActionPolicy.ALLOW;

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

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

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

@ -18,12 +18,12 @@ import 'ClinicTimingsDialog.dart';
// ignore: must_be_immutable
class ClinicCard extends StatefulWidget {
bool isSelected;
bool? isSelected;
final PatientERGetClinicsList patientERGetClinicsList;
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> {
ClinicsServiceTimingsResponse clinicsServiceTimingsResponse;
late ClinicsServiceTimingsResponse clinicsServiceTimingsResponse;
@override
void initState() {
@ -51,7 +51,7 @@ class _State extends State<ClinicCard> {
borderRadius: BorderRadius.all(
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(
color: Color(0xff000000).withOpacity(.05),
@ -72,10 +72,10 @@ class _State extends State<ClinicCard> {
margin: EdgeInsets.only(
left: projectViewModel.isArabic
? 0
: widget.isSelected
: widget.isSelected!
? 4
: 6,
right: projectViewModel.isArabic ? widget.isSelected
right: projectViewModel.isArabic ? widget.isSelected!
? 4
: 6: 0),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 12),
@ -96,7 +96,7 @@ class _State extends State<ClinicCard> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN : widget.patientERGetClinicsList.serviceName,
widget.languageID == 'ar' ? widget.patientERGetClinicsList.serviceNameN! : widget.patientERGetClinicsList.serviceName!,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -166,16 +166,16 @@ class _State extends State<ClinicCard> {
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) {
service.getLivecareClinicTiming(patientERGetClinicsList.serviceID!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res);
print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList.length);
clinicsServiceTimingsResponse = ClinicsServiceTimingsResponse.fromJson(res as Map<String, dynamic>);
print(clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList!.length);
navigateTo(context, ClinicTimingsPage(
clinicName: patientERGetClinicsList.serviceName,
patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList,
patientERGetClinicsServiceTimingsList: clinicsServiceTimingsResponse.patientERGetClinicsServiceTimingsList!,
));
// showGeneralDialog(
// barrierColor: Colors.black.withOpacity(0.5),
@ -206,6 +206,6 @@ class _State extends State<ClinicCard> {
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;
String pharmacyLiveCareQRCode;
ClinicList({@required this.getLiveCareHistory, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""});
ClinicList({required this.getLiveCareHistory, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""});
@override
_clinic_listState createState() => _clinic_listState();
@ -51,44 +51,44 @@ class ClinicList extends StatefulWidget {
class _clinic_listState extends State<ClinicList> {
int currentSelectedIndex = 0;
LiveCareClinicsListResponse liveCareClinicsListResponse;
late LiveCareClinicsListResponse liveCareClinicsListResponse;
List<PatientERGetClinicsList> liveCareOnlineClinicsListResponse;
List<PatientERGetClinicsList> liveCareOfflineClinicsListResponse;
late List<PatientERGetClinicsList> liveCareOnlineClinicsListResponse;
late List<PatientERGetClinicsList> liveCareOfflineClinicsListResponse;
LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse;
late LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse;
bool isDataLoaded = false;
var languageID;
var currentSelectedLiveCareType;
int selectedClinicID;
late int selectedClinicID;
String selectedClinicName = "-";
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
late AuthenticatedUser authUser;
AuthProvider authProvider = new AuthProvider();
MyInAppBrowser browser;
late MyInAppBrowser browser;
String liveCareClinicIDs;
late String liveCareClinicIDs;
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
String selectedPaymentMethod = "";
String amount = "";
String tamaraPaymentStatus;
String tamaraOrderID;
String selectedInstallmentPlan;
late String tamaraPaymentStatus;
late String tamaraOrderID;
late String selectedInstallmentPlan;
@override
void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse();
liveCareOnlineClinicsListResponse = new[];
liveCareOfflineClinicsListResponse = new[];
liveCareOnlineClinicsListResponse = [];
liveCareOfflineClinicsListResponse = [];
liveCareScheduleClinicsListResponse = new LiveCareScheduleClinicsListResponse();
@ -126,10 +126,10 @@ class _clinic_listState extends State<ClinicList> {
isError = true;
showLiveCareCancelDialog(res['ErrorEndUserMessage'], res);
} else {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res as Map<String, dynamic>);
isError = false;
}
if (!isError) getERAppointmentTime(erAppointmentFeesResponse.getERAppointmentFeesList);
if (!isError) getERAppointmentTime(erAppointmentFeesResponse.getERAppointmentFeesList!);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
@ -208,7 +208,7 @@ class _clinic_listState extends State<ClinicList> {
(value) {
if (value) {
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 {
navigateToPaymentMethod(getERAppointmentFeesList, context);
}
@ -311,17 +311,17 @@ class _clinic_listState extends State<ClinicList> {
context,
FadePage(
page: PaymentMethod(
onSelectedMethod: (String metohd, [String selectedInstallmentPlan]) {
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {});
},
patientShare: num.parse(getERAppointmentFeesList.total),
patientShare: num.parse(getERAppointmentFeesList.total!),
isFromAdvancePayment: widget.isPharmacyLiveCare,
))).then((value) {
print(value);
widget.isPharmacyLiveCare = isPharmacyLiveCare;
widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue;
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');
}
});
@ -337,12 +337,12 @@ class _clinic_listState extends State<ClinicList> {
browser.openPaymentBrowser(
amount,
"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",
authenticatedUser.emailAddress,
authenticatedUser.emailAddress!,
paymentMethod[0],
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.firstName!,
authenticatedUser.patientID,
authenticatedUser,
browser,
@ -364,12 +364,12 @@ class _clinic_listState extends State<ClinicList> {
if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status'];
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
tamaraPaymentStatus = uri.queryParameters['status']!;
tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!;
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
tamaraPaymentStatus = uri.queryParameters['paymentStatus']!;
tamaraOrderID = uri.queryParameters['orderId']!;
}
}
@ -394,7 +394,7 @@ class _clinic_listState extends State<ClinicList> {
print("onBrowserExit Called!!!!");
try {
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") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
// } else {
@ -415,10 +415,10 @@ class _clinic_listState extends State<ClinicList> {
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
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 {
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) {
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) {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context);
try {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
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 {
AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
@ -459,19 +459,19 @@ class _clinic_listState extends State<ClinicList> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
String amount;
String payment_method;
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
final currency = projectViewModel.user!.outSA == 0 ? "sar" : 'aed';
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.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) {
GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message'];
amount = res['Amount'].toString();
payment_method = res['PaymentMethod'];
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 {
AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
@ -517,9 +517,9 @@ class _clinic_listState extends State<ClinicList> {
if (res['MessageStatus'] == 1) {
setState(() {
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) {
liveCareOnlineClinicsListResponse.add(clinic);
} else {
@ -530,8 +530,8 @@ class _clinic_listState extends State<ClinicList> {
selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]);
selectedClinicName = liveCareClinicIDs.split("-")[0];
} else {
selectedClinicID = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceID;
selectedClinicName = liveCareClinicsListResponse.patientERGetClinicsList[0].serviceName;
selectedClinicID = liveCareClinicsListResponse.patientERGetClinicsList![0].serviceID!;
selectedClinicName = liveCareClinicsListResponse.patientERGetClinicsList![0].serviceName!;
}
isDataLoaded = true;
});
@ -554,9 +554,9 @@ class _clinic_listState extends State<ClinicList> {
print(res['ClinicsHaveScheduleList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res);
selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].serviceID;
selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[0].clinicDesc;
liveCareScheduleClinicsListResponse = LiveCareScheduleClinicsListResponse.fromJson(res as Map<String, dynamic>);
selectedClinicID = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].serviceID!;
selectedClinicName = liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![0].clinicDesc!;
isDataLoaded = true;
});
} else {
@ -629,7 +629,7 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded
? Expanded(
child: Container(
child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length > 0
child: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList!.length > 0
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@ -639,15 +639,15 @@ class _clinic_listState extends State<ClinicList> {
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList.length,
itemCount: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList!.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index]);
updateSelectedScheduleIndex(liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![index]);
},
child: ScheduleClinicCard(
isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index].serviceID ? true : false,
clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList[index],
isSelected: selectedClinicID == liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![index].serviceID ? true : false,
clinicsHaveScheduleList: liveCareScheduleClinicsListResponse.clinicsHaveScheduleList![index],
languageID: languageID,
),
);
@ -778,7 +778,7 @@ class _clinic_listState extends State<ClinicList> {
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
@ -803,15 +803,15 @@ class _clinic_listState extends State<ClinicList> {
updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) {
setState(() {
selectedClinicID = patientERGetClinicsList.serviceID;
selectedClinicName = patientERGetClinicsList.serviceName;
selectedClinicID = patientERGetClinicsList.serviceID!;
selectedClinicName = patientERGetClinicsList.serviceName!;
});
}
updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) {
setState(() {
selectedClinicID = patientERGetClinicsList.serviceID;
selectedClinicName = patientERGetClinicsList.clinicDesc;
selectedClinicID = patientERGetClinicsList.serviceID!;
selectedClinicName = patientERGetClinicsList.clinicDesc!;
});
}
}

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

@ -35,15 +35,16 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart';
import 'package:local_auth/auth_strings.dart';
import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart';
import 'package:local_auth_ios/local_auth_ios.dart';
class ConfirmLogin extends StatefulWidget {
final Function changePageViewIndex;
final Function? changePageViewIndex;
final fromRegistration;
final bool isDubai;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key);
final bool isDubai;
const ConfirmLogin({Key? key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key);
@override
_ConfirmLogin createState() => _ConfirmLogin();
@ -53,12 +54,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
final LocalAuthentication auth = LocalAuthentication();
var _availableBiometrics;
var sharedPref = new AppSharedPreferences();
bool authenticated;
late bool authenticated;
final authService = new AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
int mobileNumber;
late int mobileNumber;
String errorMsg = '';
SelectDeviceIMEIRES user;
late SelectDeviceIMEIRES user;
bool isLoading = false;
var registerd_data;
bool isMoreOption = false;
@ -74,25 +75,25 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var lastLogin;
int selectedOption;
late int selectedOption;
bool onlySMSBox = false;
var userData;
static BuildContext _context;
late BuildContext _context;
static bool _loading;
late bool _loading;
int fingrePrintBefore;
late int fingrePrintBefore;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider;
late ToDoCountProviderModel toDoProvider;
var dob;
int isHijri;
late int isHijri;
var healthId;
@override
@ -138,7 +139,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
user.name.toLowerCase().capitalizeFirstofEach,
user.name!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44),
),
SizedBox(height: 10),
@ -172,9 +173,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
),
Text(
user.editedOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn))
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user.editedOn!))
: 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),
),
@ -203,9 +204,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Expanded(child: SizedBox()),
Text(
user.editedOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn), false)
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user.editedOn!), false)
: 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),
),
@ -291,7 +292,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
try {
availableBiometrics = await auth.getAvailableBiometrics();
} on PlatformException catch (e) {
AppToast.showErrorToast(message: e.message);
AppToast.showErrorToast(message: e.message!);
print(e);
}
if (!mounted) return;
@ -303,7 +304,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
int login_method = 0;
authenticateUser(int type, {int isActive}) {
authenticateUser(int type, {int? isActive}) {
GifLoaderDialogUtils.showMyDialog(context);
if (type == 2 || type == 3) {
fingrePrintBefore = type;
@ -320,10 +321,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.loginWithSMS(type);
break;
case 2:
this.loginWithFingurePrintFace(type, isActive);
this.loginWithFingurePrintFace(type, isActive!);
break;
case 3:
this.loginWithFingurePrintFace(type, isActive);
this.loginWithFingurePrintFace(type, isActive!);
break;
case 4:
this.loginWithSMS(type);
@ -386,9 +387,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null || widget.isDubai) {
if(!widget.isDubai){
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
if (!widget.isDubai) {
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
request.healthId = healthId;
request.isHijri = isHijri;
await this.authService.sendActivationCodeRegister(request).then((result) {
@ -435,11 +436,17 @@ class _ConfirmLogin extends State<ConfirmLogin> {
loginWithFingurePrintFace(type, int isActive) async {
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 {
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) {
GifLoaderDialogUtils.hideDialog(context);
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.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.registerd_data.zipCode
: this.user.outSA == true
@ -568,7 +575,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var request = this.getCommonRequest().toJson();
dynamic res;
if (healthId != null || widget.isDubai) {
if(!widget.isDubai) {
if (!widget.isDubai) {
request['DOB'] = dob;
}
request['HealthId'] = healthId;
@ -580,11 +587,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result,
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(widget.isDubai ==false){
widget.changePageViewIndex(1),
// if(widget.isDubai ==false){
widget.changePageViewIndex!(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
}
}
@ -614,10 +621,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result,
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)
{
widget.changePageViewIndex(1),
widget.changePageViewIndex!(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
}
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));
return InkWell(
onTap: isDisable
@ -812,7 +819,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Image.asset(
'assets/images/login/more_icon.png',
height: 45,
width: SizeConfig.imageSizeMultiplier * 16,
width: SizeConfig.imageSizeMultiplier! * 16,
),
projectViewModel.isArabic
? SizedBox(
@ -821,7 +828,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox(
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> {
String selectedType = 'Saudi Arabia';
String countryCode = '966';
final TextEditingController nationalIDorFile = null;
final TextEditingController nationalIDorFile = TextEditingController();
String mobileNo = "";
var con;
@ -100,14 +100,14 @@ class _ForgotPassword extends State<ForgotPassword> {
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20),
height: SizeConfig.realScreenHeight * .8,
height: SizeConfig.realScreenHeight! * .8,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(context).forgotDesc,
fontSize: SizeConfig.textMultiplier * 3,
fontSize: SizeConfig.textMultiplier! * 3,
textAlign: TextAlign.start,
marginTop: 10.0,
)),

@ -40,7 +40,7 @@ class _Login extends State<Login> {
final nationalIDorFile = TextEditingController();
final mobileNumberController = TextEditingController();
int loginType = LoginType.loginType;
String mobileNo;
late String mobileNo;
String countryCode = '966';
bool isButtonDisabled = true;
final authService = new AuthProvider();
@ -51,8 +51,8 @@ class _Login extends State<Login> {
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider;
late ProjectViewModel projectViewModel;
late ToDoCountProviderModel toDoProvider;
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

@ -34,10 +34,10 @@ import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
class RegisterInfo extends StatefulWidget {
final Function changePageViewIndex;
final Function? changePageViewIndex;
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
_RegisterInfo createState() => _RegisterInfo();
@ -47,14 +47,14 @@ class _RegisterInfo extends State<RegisterInfo> {
final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences();
RegisterInfoResponse registerInfo = RegisterInfoResponse();
bool isLoading;
int page;
late bool isLoading;
late int page;
final List<Location> locationList = [
new Location(name: 'KSA', value: '1', nameAr: "السعودية"),
new Location(name: 'Dubai', value: '2', nameAr: "دبي"),
];
String language = '1';
CheckPatientAuthenticationReq registerd_data;
late CheckPatientAuthenticationReq registerd_data;
final List<Language> languageList = [
new Language(name: 'English', value: '2', nameAr: "إنجليزي"),
new Language(name: 'Arabic', value: '1', nameAr: "عربي"),
@ -70,16 +70,16 @@ class _RegisterInfo extends State<RegisterInfo> {
];
String email = '';
List<CountriesLists> countriesList = [];
ToDoCountProviderModel toDoProvider;
late ToDoCountProviderModel toDoProvider;
String location = '1';
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
bool isDubai = false;
RegisterInfoResponse data = RegisterInfoResponse();
CheckPatientAuthenticationReq data2;
late CheckPatientAuthenticationReq data2;
String gender = 'M';
String maritalStatus = 'M';
String nationality = 'SAU';
@ -160,7 +160,7 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16,
onChanged: (value) => {
setState(() {
gender = value;
gender = value!;
registerInfo.gender = value;
})
},
@ -168,7 +168,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return DropdownMenuItem<String>(
value: value.value,
child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name,
projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
),
);
}).toList()))),
@ -187,7 +187,7 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16,
onChanged: (value) => {
setState(() {
maritalStatus = value;
maritalStatus = value!;
registerInfo.maritalStatusCode = value;
})
},
@ -195,7 +195,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return DropdownMenuItem<String>(
value: value.value,
child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name,
projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
),
);
}).toList()))),
@ -211,7 +211,7 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16,
onChanged: (value) => {
setState(() {
nationality = value;
nationality = value!;
registerInfo.nationalityCode = value;
})
},
@ -219,7 +219,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return DropdownMenuItem<String>(
value: value.iD,
child: Text(
value.name,
value.name!,
),
);
}).toList())))),
@ -284,14 +284,14 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16,
onChanged: (value) => {
setState(() {
language = value;
language = value!;
})
},
items: languageList.map<DropdownMenuItem<String>>((Language value) {
return DropdownMenuItem<String>(
value: value.value,
child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name,
projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
),
);
}).toList())))
@ -326,14 +326,14 @@ class _RegisterInfo extends State<RegisterInfo> {
elevation: 16,
onChanged: (value) => {
setState(() {
location = value;
location = value!;
})
},
items: locationList.map<DropdownMenuItem<String>>((Location value) {
return DropdownMenuItem<String>(
value: value.value,
child: Text(
projectViewModel.isArabic == 1 ? value.nameAr : value.name,
projectViewModel.isArabic == 1 ? value.nameAr! : value.name!,
),
);
}).toList())))
@ -425,9 +425,9 @@ class _RegisterInfo extends State<RegisterInfo> {
if (page == 1) {
if (isDubai) {
await setRegisterData();
widget.changePageViewIndex(2);
widget.changePageViewIndex!(2);
} else {
widget.changePageViewIndex(2);
widget.changePageViewIndex!(2);
}
} else {
registerNow();
@ -533,13 +533,13 @@ class _RegisterInfo extends State<RegisterInfo> {
getTempUserRequest() {
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
print(dateFormat.parse(registerInfo.dateOfBirth));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth));
print(dateFormat.parse(registerInfo.dateOfBirth!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth!));
var date = hDate.toString();
return {
"Patientobject": {
"TempValue": true,
"PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationType": registerInfo.idNumber!.substring(0, 1) == "1" ? 1 : 2,
"PatientIdentificationNo": registerInfo.idNumber,
"MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1,
@ -550,7 +550,7 @@ class _RegisterInfo extends State<RegisterInfo> {
"LastNameN": registerInfo.lastNameAr,
"LastName": registerInfo.lastNameEn,
"StrDateofBirth": registerInfo.dateOfBirth,
"DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth.replaceAll('/', '-')),
"DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth!.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationalityCode,
"eHealthIDField": registerInfo.healthId,
@ -572,8 +572,8 @@ class _RegisterInfo extends State<RegisterInfo> {
getTempUserRequestDubai() {
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
registerInfo = projectViewModel.registerInfo;
print(dateFormat.parse(registerd_data.dob));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob));
print(dateFormat.parse(registerd_data.dob!));
var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob!));
var date = hDate.toString();
final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
@ -581,7 +581,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return {
"Patientobject": {
"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,
"MobileNumber": registerd_data.patientMobileNumber,
"PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1,
@ -591,8 +591,8 @@ class _RegisterInfo extends State<RegisterInfo> {
"MiddleName": registerInfo.secondNameEn ?? ".",
"LastNameN": registerInfo.lastNameAr ?? "",
"LastName": registerInfo.lastNameEn ?? "",
"StrDateofBirth": dateFormat1.format(dateFormat2.parse(registerd_data.dob)),
"DateofBirth": DateUtil.convertISODateToJsonDate(registerd_data.dob.replaceAll('/', '-')),
"StrDateofBirth": dateFormat1.format(dateFormat2.parse(registerd_data.dob!)),
"DateofBirth": DateUtil.convertISODateToJsonDate(registerd_data.dob!.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationalityCode,
"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(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
alignment: Alignment.center,
@ -875,17 +875,17 @@ class _RegisterInfo extends State<RegisterInfo> {
}
class Language {
final String name;
final String value;
final String nameAr;
final String? name;
final String? value;
final String? nameAr;
Language({this.name, this.value, this.nameAr});
}
class Location {
final String name;
final String value;
final String nameAr;
final String? name;
final String? value;
final String? 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;
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
_Register createState() => _Register();
@ -38,11 +38,11 @@ class Register extends StatefulWidget {
class _Register extends State<Register> {
final nationalIDorFile = TextEditingController();
final int loginType = LoginType.loginType;
String mobileNo;
late String mobileNo;
String countryCode = '966';
var isHijri;
final util = Utils();
DateTime selectedDate;
late DateTime selectedDate;
TextEditingController dob = TextEditingController();
TextEditingController dobEn = TextEditingController();
@ -50,7 +50,7 @@ class _Register extends State<Register> {
final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences();
bool isLoading;
late bool isLoading;
@override
Widget build(BuildContext context) {
@ -119,7 +119,7 @@ class _Register extends State<Register> {
),
Row(children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .89,
width: SizeConfig.realScreenWidth! * .89,
child: isHijri == 1
? Directionality(
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
@ -400,7 +400,7 @@ class _Register extends State<Register> {
GifLoaderDialogUtils.hideDialog(context),
if (result is Map)
{
result = CheckUserStatusResponse.fromJson(result),
result = CheckUserStatusResponse.fromJson(result as Map<String, dynamic>),
sharedPref.setObject(NHIC_DATA, result),
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> {
final nationalIDorFile = TextEditingController();
final int loginType = LoginType.loginType;
String mobileNo;
late String mobileNo;
String countryCode = '966';
var isHijri;
final util = Utils();
DateTime selectedDate;
String dob;
late DateTime selectedDate;
late String dob;
bool isButtonDisabled = true;
final authService = new AuthProvider();
final sharedPref = new AppSharedPreferences();
PageController _controller;
bool isLoading;
late PageController _controller;
late bool isLoading;
int _currentIndex = 0;
@override
@ -59,7 +59,7 @@ class _RegisterNew extends State<RegisterNew> {
showNewAppBarTitle: true,
body: SingleChildScrollView(
child: Container(
height: SizeConfig.realScreenHeight * .9,
height: SizeConfig.realScreenHeight! * .9,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -157,7 +157,7 @@ class _RegisterNew extends State<RegisterNew> {
Container(
width: 26,
height: 26,
decoration: containerRadius(color, 200),
decoration: containerRadius(color!, 200),
child: Icon(
Icons.done,
color: Colors.white,
@ -174,7 +174,7 @@ class _RegisterNew extends State<RegisterNew> {
),
mHeight(8),
Text(
title,
title!,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
@ -184,9 +184,9 @@ class _RegisterNew extends State<RegisterNew> {
mHeight(2),
Container(
padding: EdgeInsets.all(5),
decoration: containerRadius(color.withOpacity(0.2), 4),
decoration: containerRadius(color!.withOpacity(0.2), 4),
child: Text(
status,
status!,
style: TextStyle(
fontSize: 8,
fontWeight: FontWeight.w600,

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

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

@ -18,20 +18,20 @@ import 'DayCheckBoxDialog.dart';
// ignore: must_be_immutable
class ReminderPage extends StatefulWidget {
final int frequency;
final int days;
final String itemDescription;
final int? frequency;
final int? days;
final String? itemDescription;
List<DateTime> _scheduleList =[];
List<DayOfWeek> daysOfWeek = [DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday, DayOfWeek.Saturday, DayOfWeek.Sunday];
DateTime startDay;
DateTime endDay;
late DateTime startDay;
late DateTime endDay;
ReminderPage({Key key, this.frequency, this.days, this.itemDescription}) {
ReminderPage({Key? key, this.frequency, this.days, this.itemDescription}) {
startDay = DateTime.now();
endDay = DateTime.now().add(Duration(days: days));
int hour = (24 ~/ frequency).round();
endDay = DateTime.now().add(Duration(days: days!));
int hour = (24 ~/ frequency!).round();
int durations = 24 ~/ hour;
for (int count = 0; count < durations; 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';
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
State<ViewDoctorResponsesPage> createState() => _ViewDoctorResponsesPageState();
@ -27,13 +27,13 @@ class ViewDoctorResponsesPage extends StatefulWidget {
class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
int rate = 1;
TextEditingController textController = new TextEditingController();
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AskDoctorViewModel>(
onModelReady: (model) => model.updateReadStatus(transactionNo: widget.doctorResponse.transactionNo),
onModelReady: (model) => model.updateReadStatus(transactionNo: widget.doctorResponse!.transactionNo!),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
@ -82,7 +82,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
children: [
Container(
child: Text(
(widget.doctorResponse.doctorName ?? ""),
(widget.doctorResponse!.doctorName ?? ""),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
@ -93,7 +93,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
),
Container(
child: Text(
(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctorResponse.createdOn)) ?? ""),
(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.doctorResponse!.createdOn!)) ?? ""),
style: TextStyle(
fontSize: 14,
color: Color(0xff2E303A),
@ -104,7 +104,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
widget.doctorResponse.transactions[_index]['DoctorResponse'],
widget.doctorResponse!.transactions![_index]['DoctorResponse'],
style: TextStyle(
fontSize: 16,
color: Color(0xff2E303A),
@ -127,7 +127,7 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.doctorResponse.transactions.length);
itemCount: widget.doctorResponse!.transactions!.length);
}
void openResponseRateDialog(BuildContext context) {
@ -234,14 +234,14 @@ class _ViewDoctorResponsesPageState extends State<ViewDoctorResponsesPage> {
AskDoctorService service = new AskDoctorService();
service
.rateDoctorResponse(
transactionNo: widget.doctorResponse.transactionNo,
questionType: widget.doctorResponse.requestType,
transactionNo: widget.doctorResponse!.transactionNo!,
questionType: widget.doctorResponse!.requestType!,
rate: rate,
notes: textController.text,
mobileNo: projectViewModel.user.mobileNumber,
idNo: projectViewModel.user.patientIdentificationNo,
patientName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
projectID: widget.doctorResponse.projectID,
mobileNo: projectViewModel.user!.mobileNumber!,
idNo: projectViewModel.user!.patientIdentificationNo!,
patientName: projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!,
projectID: widget.doctorResponse!.projectID,
language: projectViewModel.isArabic ? "ar" : "en")
.then((res) {
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(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,

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

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

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

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

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

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

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

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

@ -19,7 +19,7 @@ import 'advance_payment_page.dart';
class MyBalancePage extends StatelessWidget {
List<ImagesInfo> imagesInfo =[];
ProjectViewModel projectViewModel;
late ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
@ -106,7 +106,7 @@ class MyBalancePage extends StatelessWidget {
),
),
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(
fontSize: 16,
fontWeight: FontWeight.bold,
@ -147,7 +147,7 @@ class MyBalancePage extends StatelessWidget {
children: [
Expanded(
child: Text(
balanceAmount.projectDescription,
balanceAmount!.projectDescription!,
style: TextStyle(
fontSize: 16,
letterSpacing: -0.64,
@ -157,7 +157,7 @@ class MyBalancePage extends StatelessWidget {
),
),
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(
fontSize: 16,
letterSpacing: -0.64,

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

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

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

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

@ -11,7 +11,7 @@ class ClassesPage extends StatelessWidget {
final String projectName;
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
Widget build(BuildContext context) {

@ -19,7 +19,7 @@ class CalendarUtils {
_completer = Completer<CalendarUtils>();
try {
final calendarsResult = await deviceCalendarPlugin.retrieveCalendars();
_completer?.complete(CalendarUtils._(calendarsResult?.data! as List<Calendar>));
_completer?.complete(CalendarUtils._(calendarsResult.data!));
} on Exception catch (e) {
_completer!.completeError(e);
final Future<CalendarUtils> sharedPrefsFuture = _completer!.future;
@ -30,6 +30,15 @@ class CalendarUtils {
return _completer!.future;
}
Future createOrUpdateEvents({List<DateTime>? scheduleList, String? title, String? description, List<DateTime>? scheduleDateTime, List<DayOfWeek>? daysOfWeek}) async {
List<Event> events = [];
Location _currentLocation;
if (DateTime.now().timeZoneName == "+04")
_currentLocation = getLocation('Asia/Dubai');
else
_currentLocation = getLocation('Asia/Riyadh');
scheduleDateTime!.forEach((element) {
Future createOrUpdateEvents({List<DateTime>? scheduleList, String? title, String? description, List<DateTime>? scheduleDateTime, List<DayOfWeek>? daysOfWeek}) async {
List<Event> events =[];
scheduleDateTime!.forEach((element) {
@ -38,7 +47,13 @@ class CalendarUtils {
daysOfWeek: daysOfWeek,
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);
});

@ -137,7 +137,7 @@ class LocalNotification {
///Repeat notification every day at approximately 10:00:00 am
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 iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(
@ -152,7 +152,7 @@ class LocalNotification {
///Repeat notification weekly on Monday at approximately 10:00:00 am
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 iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(

@ -7,13 +7,13 @@ class AppSharedPreferences {
late Map<String, dynamic> _allData;
// To Test Saved Data
Future<Map<String, dynamic>> getAll() async{
Future<Map<String, dynamic>> getAll() async {
final prefs = (await _prefs);
_allData = {};
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
@ -75,7 +75,7 @@ class AppSharedPreferences {
getStringWithDefaultValue(String key, String defaultVal) async {
final SharedPreferences prefs = await _prefs;
await prefs.reload();
String? value = prefs.getString(key);
String value = prefs.getString(key)!;
return value == null ? defaultVal : value;
}
@ -110,7 +110,7 @@ class AppSharedPreferences {
/// Get Object [key] the key was saved
Future getObject(String key) async {
try {
final SharedPreferences prefs = await _prefs;
final SharedPreferences prefs = await _prefs;
await prefs.reload();
var string = prefs.getString(key);
if (string == null) {

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.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/translations_delegate_base.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:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:huawei_location/location/fused_location_provider_client.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:huawei_location/huawei_location.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
@ -28,9 +24,9 @@ class LocationUtils {
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) {
_getHMSCurrentLocation(callBack);
_getHMSCurrentLocation(callBack!);
} else {
Geolocator.isLocationServiceEnabled().then((value) async {
if (value) {
@ -44,7 +40,9 @@ class LocationUtils {
if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () async {
Utils.showPermissionConsentDialog(context, TranslationBase
.of(context)
.locationPermissionDialog, () async {
final hasPermission = await _handlePermission();
if (hasPermission) {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) {
@ -56,7 +54,9 @@ class LocationUtils {
}
});
} else {
if (await Permission.location.request().isGranted) {
if (await Permission.location
.request()
.isGranted) {
getCurrentLocation(callBack: callBack);
} else {
setZeroLocation();
@ -99,10 +99,12 @@ class LocationUtils {
return true;
}
late LocationCallback _locationCallback;
late LocationCallback _locationCallback;
_getHMSCurrentLocation(Function(LatLng) callBack) async {
PermissionHandler permissionHandler = PermissionHandler();
PermissionStatus permissionHandler = await Permission.location.request();
// print(statuses[Permission.location]);
int _locationUpdateCbId = 0;
doIt() {
@ -120,7 +122,17 @@ class LocationUtils {
Location location = locationResult.lastLocation!;
locationService.removeLocationUpdatesCb(_locationUpdateCbId);
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) {
print("onLocationAvailability: $locationAvailability");
}));
@ -131,7 +143,7 @@ class LocationUtils {
});
}
if (await permissionHandler.hasLocationPermission()) {
if (await permissionHandler.isGranted) {
doIt();
} else {
bool has = await requestPermissions();
@ -144,10 +156,18 @@ class LocationUtils {
showErrorLocationDialog(bool isPermissionError) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).locationDialogMessage,
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()},
confirmMessage: TranslationBase
.of(context)
.locationDialogMessage,
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: () => {});
return dialog.showAlertDialog(context);
}

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

@ -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:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_map/components/callbacks.dart';
import 'package:huawei_map/components/cameraPosition.dart' as cameraposition;
import 'package:huawei_map/components/cameraPosition.dart';
import 'package:huawei_map/map.dart' as hmsMap;
import 'package:huawei_map/huawei_map.dart' as hmsMap;
class AppMap extends StatefulWidget {
late VoidCallback onCameraMove;
@ -25,13 +22,13 @@ class AppMap extends StatefulWidget {
@override
State<StatefulWidget> createState() => _state = AppMapState();
moveTo({ required CameraPosition cameraPostion}) {
moveTo({ required googlemap.CameraPosition cameraPostion}) {
if (_state!.isHuawei) {
final cameraJson = cameraPostion?.toMap();
final cameraJson = cameraPostion.toMap();
final camera = hmsMap.CameraPosition.fromMap(cameraJson);
_state?._huaweiMapController.animateCamera(hmsMap.CameraUpdate.newCameraPosition(camera));
} 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,
bottom: 28.0,
child: badge_import.Badge(
toAnimate: false,
badgeStyle: badge_import.BadgeStyle(
shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor!.withOpacity(1.0),
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),
// shape: badge_import.BadgeShape.circle,
// badgeColor: secondaryColor!.withOpacity(1.0),
// borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.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 {
final String text;
final VoidCallback onPress;
final VoidCallback? onPress;
final Color textColor;
final Color? color;
final Color? disabledColor;

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

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

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

Loading…
Cancel
Save