Merge branch 'zik_new_design_flutter_v2.5' into 'development_v2.5'
Zik new design flutter v2.5 See merge request Cloud_Solution/diplomatic-quarter!586merge-requests/587/merge
commit
9852811983
@ -0,0 +1,82 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import '../google-analytics.dart';
|
||||
|
||||
class AdvancePayments{
|
||||
|
||||
final GALogger logger;
|
||||
AdvancePayments(this.logger);
|
||||
|
||||
// R038
|
||||
payment_services({@required String service_type}){
|
||||
logger('payment_services', parameters: {
|
||||
'service_type' : service_type
|
||||
});
|
||||
}
|
||||
|
||||
// R039
|
||||
wallet_recharge({@required String service_type}){
|
||||
logger('wallet_recharge', parameters: {
|
||||
'service_type' : service_type
|
||||
});
|
||||
}
|
||||
|
||||
// R040
|
||||
wallet_payment_details(){
|
||||
logger('wallet_payment_details');
|
||||
}
|
||||
|
||||
// R041
|
||||
payment_method({@required String method,type}){
|
||||
logger('payment_method', parameters: {
|
||||
'payment_method' : method,
|
||||
'payment_type' : type
|
||||
});
|
||||
}
|
||||
|
||||
// R042
|
||||
payment_confirm({@required String method,type}){
|
||||
logger('payment_confirm', parameters: {
|
||||
'payment_method' : method,
|
||||
'payment_type' : type
|
||||
});
|
||||
}
|
||||
|
||||
// R043
|
||||
payment_otp_confirmation({@required String method,type}){
|
||||
logger('payment_otp_confirmation', parameters: {
|
||||
'payment_method' : method,
|
||||
'payment_type' : type
|
||||
});
|
||||
}
|
||||
|
||||
// R044
|
||||
payment_confirm_card_details({@required String method,type}){
|
||||
logger('payment_confirm_card_details', parameters: {
|
||||
'payment_method' : method,
|
||||
'payment_type' : type
|
||||
});
|
||||
}
|
||||
|
||||
// R045
|
||||
payment_pay({@required String method,type}){
|
||||
logger('payment_pay', parameters: {
|
||||
'payment_method' : method,
|
||||
'payment_type' : type
|
||||
});
|
||||
}
|
||||
|
||||
// R046
|
||||
payment_success({@required String appointment_type, clinic, hospital, payment_method, payment_type, txn_number, txn_amount, txn_currency}){
|
||||
logger('payment_success', parameters: {
|
||||
'appointment_type' : appointment_type,
|
||||
'clinic_type_online' : clinic,
|
||||
'payment_method' : payment_method,
|
||||
'payment_type' : payment_type,
|
||||
'hospital_name' : hospital,
|
||||
'transaction_number' : txn_number,
|
||||
'transaction_amount' : txn_amount,
|
||||
'transaction_currency' : txn_currency
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
|
||||
|
||||
class AppNav{
|
||||
final name = 'app_nav';
|
||||
final GALogger logger;
|
||||
AppNav(this.logger);
|
||||
|
||||
logNavName(String value){
|
||||
logger(name, parameters: {
|
||||
'nav_name' : value
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
import '../google-analytics.dart';
|
||||
|
||||
class ErrorTracking{
|
||||
|
||||
final GALogger logger;
|
||||
ErrorTracking(this.logger);
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
|
||||
|
||||
class HamburgerMenu{
|
||||
final hamburger_menu = 'hamburger_menu';
|
||||
|
||||
final GALogger logger;
|
||||
HamburgerMenu(this.logger);
|
||||
|
||||
logMenuItemClick(String value){
|
||||
logger(hamburger_menu, parameters: {
|
||||
'menu_item' : value
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
import '../google-analytics.dart';
|
||||
|
||||
class HMGServices{
|
||||
final hmg_services = 'hmg_services';
|
||||
|
||||
final GALogger logger;
|
||||
HMGServices(this.logger);
|
||||
logServiceName(String value){
|
||||
logger('hmg_services', parameters: {
|
||||
'services_name' : value
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import '../google-analytics.dart';
|
||||
|
||||
class LiveCare{
|
||||
|
||||
final GALogger logger;
|
||||
LiveCare(this.logger);
|
||||
|
||||
// R030.1
|
||||
livecare_immediate_consultation(){
|
||||
logger('livecare_immediate_consultation');
|
||||
}
|
||||
|
||||
// R030.2
|
||||
livecare_schedule_video_call(){
|
||||
logger('livecare_schedule_video_call');
|
||||
}
|
||||
|
||||
// R031.1
|
||||
livecare_clinic_schedule({@required String clinic}){
|
||||
logger('livecare_clinic_schedule', parameters: {
|
||||
'clinic_type_online' : clinic
|
||||
});
|
||||
}
|
||||
|
||||
// R031.2
|
||||
livecare_immediate_consultation_clinic({@required String clinic}){
|
||||
logger('livecare_immediate_consultation_clinic', parameters: {
|
||||
'clinic_type_online' : clinic
|
||||
});
|
||||
}
|
||||
|
||||
// R031.2
|
||||
livecare_schedule_video_call_clinic({@required String clinic}){
|
||||
logger('livecare_schedule_video_call_clinic', parameters: {
|
||||
'clinic_type_online' : clinic
|
||||
});
|
||||
}
|
||||
|
||||
// R032
|
||||
livecare_immediate_consultation_TnC({@required String clinic}){
|
||||
logger('livecare_immediate_consultation_TnC', parameters: {
|
||||
'clinic_type_online' : clinic
|
||||
});
|
||||
}
|
||||
|
||||
// R033
|
||||
payment_method({@required String appointment_type, clinic, payment_method, payment_type}){
|
||||
logger('payment_method', parameters: {
|
||||
'appointment_type' : appointment_type,
|
||||
'clinic_type_online' : clinic,
|
||||
'payment_method' : payment_method,
|
||||
'payment_type' : payment_type
|
||||
});
|
||||
}
|
||||
|
||||
// R034
|
||||
payment_confirm({@required String appointment_type, clinic, payment_method, payment_type}){
|
||||
logger('payment_confirm', parameters: {
|
||||
'appointment_type' : appointment_type,
|
||||
'clinic_type_online' : clinic,
|
||||
'payment_method' : payment_method,
|
||||
'payment_type' : payment_type
|
||||
});
|
||||
}
|
||||
|
||||
// R035
|
||||
payment_pay({@required String appointment_type, clinic, hospital, payment_method, payment_type}){
|
||||
// logger('payment_pay', parameters: {
|
||||
// 'appointment_type' : appointment_type,
|
||||
// 'clinic_type_online' : clinic,
|
||||
// 'payment_method' : payment_method,
|
||||
// 'payment_type' : payment_type,
|
||||
// 'hospital_name' : hospital
|
||||
// });
|
||||
}
|
||||
|
||||
// R036
|
||||
payment_success({@required String appointment_type, clinic, hospital, payment_method, payment_type, txn_number, txn_amount, txn_currency}){
|
||||
// appointment_type
|
||||
// clinic_type_online
|
||||
// payment_method
|
||||
// payment_type
|
||||
// hospital_name
|
||||
// transaction_number
|
||||
// transaction_amount
|
||||
// transaction_currency
|
||||
}
|
||||
|
||||
// R037
|
||||
livecare_immediate_consultation_payment_failed({@required String appointment_type, clinic, hospital, payment_method, payment_type, error_code, error_message}){
|
||||
// appointment_type
|
||||
// clinic_type_online
|
||||
// payment_method
|
||||
// payment_type
|
||||
// hospital_name
|
||||
// error_code
|
||||
// error_message
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import '../google-analytics.dart';
|
||||
|
||||
class LoginRegistration{
|
||||
|
||||
final GALogger logger;
|
||||
LoginRegistration(this.logger);
|
||||
// R004.1
|
||||
login_register_initiate(){
|
||||
logger('login_register_initiate');
|
||||
}
|
||||
|
||||
// R005.1
|
||||
visited_alhabib_group(bool value){
|
||||
// selection_type: yes/no
|
||||
logger('visited_alhabib_group', parameters: {
|
||||
'selection_type' : value ? 'yes' : 'no'
|
||||
});
|
||||
}
|
||||
|
||||
// R006.1, R007.1, R008.1, R009.1
|
||||
registration_cancel({@required String step}){
|
||||
// registration_step : enter details
|
||||
// registration_step : personal info
|
||||
// registration_step : patient info
|
||||
// fourth (verification)
|
||||
logger('registration_cancel', parameters: {
|
||||
'registration_step' : step
|
||||
});
|
||||
}
|
||||
|
||||
// R006.2
|
||||
registration_enter_details(){
|
||||
logger('registration_enter_details');
|
||||
}
|
||||
|
||||
// R007.2
|
||||
registration_personal_info(){
|
||||
logger('registration_personal_info');
|
||||
}
|
||||
|
||||
// R008.2
|
||||
registration_patient_info(){
|
||||
logger('registration_patient_info');
|
||||
}
|
||||
|
||||
// R009.2
|
||||
registration_verification_option(){
|
||||
logger('registration_verification_option');
|
||||
}
|
||||
|
||||
// R010
|
||||
registration_confirmation({@required String by}){
|
||||
// verification_method: by
|
||||
logger('registration_confirmation', parameters: {
|
||||
'verification_method' : by
|
||||
});
|
||||
}
|
||||
|
||||
// R011.1
|
||||
login_start({@required String method}){
|
||||
logger('login_start', parameters: {
|
||||
'login_method' : method
|
||||
});
|
||||
}
|
||||
|
||||
// R011.2
|
||||
forget_file_number(){
|
||||
logger('forget_file_number');
|
||||
}
|
||||
|
||||
// R011.3
|
||||
register_now({@required String method}){
|
||||
logger('register_now', parameters: {
|
||||
'login_method' : method
|
||||
});
|
||||
}
|
||||
|
||||
// R012.1, R014.1
|
||||
login_successful({@required String method}){
|
||||
logger('login_successful', parameters: {
|
||||
'login_method' : method
|
||||
});
|
||||
}
|
||||
|
||||
// R012.4
|
||||
login_unsuccessful({@required String method, error}){
|
||||
logger('login_unsuccessful', parameters: {
|
||||
'login_method' : method
|
||||
});
|
||||
}
|
||||
|
||||
// R013
|
||||
recover_file_number(){
|
||||
logger('recover_file_number');
|
||||
}
|
||||
|
||||
// R014.2
|
||||
login_with_other_account(){
|
||||
logger('login_with_other_account');
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
import '../google-analytics.dart';
|
||||
|
||||
class OfferAndPromotion{
|
||||
|
||||
final GALogger logger;
|
||||
OfferAndPromotion(this.logger);
|
||||
|
||||
final offers_and_promotion = 'offers_&_promotion';
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
||||
|
||||
import '../google-analytics.dart';
|
||||
|
||||
class TodoList{
|
||||
|
||||
final GALogger logger;
|
||||
TodoList(this.logger);
|
||||
|
||||
// R047.1
|
||||
to_do_list_pay_now(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_pay_now', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R047.2
|
||||
to_do_list_more_details(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_more_details', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R048
|
||||
to_do_list_confirm_payment_details(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_confirm_payment_details', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R048
|
||||
to_do_list_cancel_payment_details(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_cancel_payment_details', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R049.1 // should be for appointment flow
|
||||
// to_do_list_appointment_actions(AppoitmentAllHistoryResultList appointment, action){
|
||||
// logger('to_do_list_pay_now', parameters: {
|
||||
// 'appointment_type' : appointment.appointmentType,
|
||||
// 'clinic_type_online' : appointment.clinicName,
|
||||
// 'hospital_name' : appointment.projectName,
|
||||
// 'doctor_name' : appointment.doctorName,
|
||||
// 'payment_type' : appointment.patientType,
|
||||
// });
|
||||
// }
|
||||
|
||||
// R049.2
|
||||
to_do_list_cancel_appointment(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_cancel_appointment', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R049.3
|
||||
to_do_list_confirm_appointment(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_confirm_appointment', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R050
|
||||
to_do_list_check_in(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_check_in', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R051
|
||||
to_do_list_nfc(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_nfc', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
|
||||
// R052
|
||||
to_do_list_nfc_cancel(AppoitmentAllHistoryResultList appointment){
|
||||
logger('to_do_list_nfc_cancel', parameters: {
|
||||
'appointment_type' : appointment.appointmentType,
|
||||
'clinic_type_online' : appointment.clinicName,
|
||||
'hospital_name' : appointment.projectName,
|
||||
'doctor_name' : appointment.doctorName,
|
||||
'payment_type' : appointment.patientType,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,355 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/locator.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/routes.dart';
|
||||
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
|
||||
|
||||
class QRCode extends StatefulWidget {
|
||||
PatientShareResponse patientShareResponse;
|
||||
String appoQR;
|
||||
AuthenticatedUser authUser;
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
|
||||
QRCode({@required this.patientShareResponse, @required this.appoQR});
|
||||
|
||||
@override
|
||||
_QRCodeState createState() => _QRCodeState();
|
||||
}
|
||||
|
||||
class _QRCodeState extends State<QRCode> {
|
||||
Uint8List _bytes;
|
||||
bool _supportsNFC = false;
|
||||
BuildContext _context;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
|
||||
_bytes = base64.decode(widget.appoQR.split(',').last);
|
||||
widget.authUser = new AuthenticatedUser();
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
FlutterNfcKit.nfcAvailability.then((value) {
|
||||
setState(() {
|
||||
_supportsNFC = (value == NFCAvailability.available);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_context = context;
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).attendRegisterCode,
|
||||
isShowAppBar: true,
|
||||
showNewAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
body: SingleChildScrollView(
|
||||
child: Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.width / 3,
|
||||
child: Row(
|
||||
children: [
|
||||
<<<<<<< HEAD
|
||||
_supportsNFC
|
||||
? Expanded(
|
||||
flex: 1,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 30.0),
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Image.asset("assets/images/nfc/ic_nfc.png"),
|
||||
),
|
||||
onTap: () {
|
||||
locator<ProjectViewModel>().analytics.todoList.to_do_list_nfc();
|
||||
showNfcReader(context, onNcfScan: (String nfcId) {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
sendNfcCheckInRequest(nfcId);
|
||||
});
|
||||
}, onCancel: (){
|
||||
locator<ProjectViewModel>().analytics.todoList.to_do_list_nfc_cancel();
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
=======
|
||||
// _supportsNFC
|
||||
// ?
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
InkWell(
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 30.0),
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Image.asset("assets/images/nfc/ic_nfc.png"),
|
||||
>>>>>>> 259e27d4a7e8d7ddf751de88de36fe901df0e2da
|
||||
),
|
||||
onTap: () {
|
||||
showNfcReader(context, onNcfScan: (String nfcId) {
|
||||
Future.delayed(const Duration(milliseconds: 100), () {
|
||||
sendNfcCheckInRequest(nfcId);
|
||||
});
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// : Container(),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 30.0),
|
||||
alignment: Alignment.center,
|
||||
child: Image.memory(
|
||||
_bytes,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
|
||||
child: Divider(
|
||||
color: Colors.red[700],
|
||||
thickness: 0.8,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
|
||||
child: Image.asset("assets/images/new-design/device_icon.png", width: MediaQuery.of(context).size.width / 3.4, height: MediaQuery.of(context).size.width / 3.4),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(TranslationBase.of(context).scanQRHospital, style: TextStyle(color: Colors.red[700], fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
|
||||
child: Divider(
|
||||
color: Colors.red[700],
|
||||
thickness: 0.8,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(TranslationBase.of(context).appoInfo, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.0, bottom: 20.0, right: 20.0),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.grey[200],
|
||||
boxShadow: [
|
||||
BoxShadow(color: Colors.grey, spreadRadius: 2),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(widget.patientShareResponse.doctorNameObj, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)),
|
||||
),
|
||||
if (getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality) != "null\n")
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(widget.patientShareResponse.projectName, style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
|
||||
child: Text(getDate(widget.patientShareResponse.appointmentDate), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0),
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
DefaultButton(TranslationBase.of(context).sendEmail.toUpperCase(), () => {sendEmail()})
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
sendEmail() async {
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
|
||||
if (await widget.sharedPref.getObject(USER_PROFILE) != null) {
|
||||
var data = AuthenticatedUser.fromJson(await widget.sharedPref.getObject(USER_PROFILE));
|
||||
setState(() {
|
||||
widget.authUser = data;
|
||||
});
|
||||
}
|
||||
|
||||
ConfirmDialog dialog = new ConfirmDialog(
|
||||
context: context,
|
||||
confirmMessage: "Send a copy of this QR to the email " + widget.authUser.emailAddress + "?",
|
||||
okText: TranslationBase.of(context).confirm,
|
||||
cancelText: TranslationBase.of(context).cancel_nocaps,
|
||||
okFunction: () {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
service
|
||||
.sendAppointmentQREmail(widget.authUser.emailAddress, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo.toString(),
|
||||
widget.patientShareResponse.doctorNameObj, widget.patientShareResponse.projectName, widget.appoQR, getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), context)
|
||||
.then((res) {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
ConfirmDialog.closeAlertDialog(context);
|
||||
}).catchError((err) {
|
||||
ConfirmDialog.closeAlertDialog(context);
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
AppToast.showErrorToast(message: err);
|
||||
print(err);
|
||||
});
|
||||
},
|
||||
cancelFunction: () => {});
|
||||
dialog.showAlertDialog(context);
|
||||
}
|
||||
|
||||
Future navigateToHome(context) async {
|
||||
Navigator.of(context).pushNamed(HOME);
|
||||
}
|
||||
|
||||
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {}
|
||||
|
||||
String getDate(String appoDate) {
|
||||
var appoDateFormatted = "";
|
||||
|
||||
var dateObj = DateUtil.convertStringToDate(appoDate);
|
||||
|
||||
setState(() {
|
||||
appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
|
||||
", " +
|
||||
dateObj.day.toString() +
|
||||
" " +
|
||||
DateUtil.getMonth(dateObj.month) +
|
||||
" " +
|
||||
dateObj.year.toString() +
|
||||
", " +
|
||||
dateObj.hour.toString() +
|
||||
":" +
|
||||
dateObj.minute.toString() +
|
||||
":00";
|
||||
});
|
||||
|
||||
return appoDateFormatted;
|
||||
}
|
||||
|
||||
String getDoctorSpeciality(List<String> docSpecial) {
|
||||
String docSpeciality = "";
|
||||
if (docSpecial != null && docSpecial.length != 0) {
|
||||
docSpecial.forEach((v) {
|
||||
docSpeciality = docSpeciality + v + "\n";
|
||||
});
|
||||
}
|
||||
return docSpeciality;
|
||||
}
|
||||
|
||||
sendNfcCheckInRequest(String nfcId) {
|
||||
GifLoaderDialogUtils.showMyDialog(context);
|
||||
|
||||
DoctorsListService service = new DoctorsListService();
|
||||
|
||||
service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) {
|
||||
print(res);
|
||||
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
_showMyDialog(res["SuccessMsg"], this.context);
|
||||
}).catchError((err) {
|
||||
GifLoaderDialogUtils.hideDialog(context);
|
||||
print(err);
|
||||
_showMyDialog(err, this.context);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _showMyDialog(String message, BuildContext context) async {
|
||||
return showDialog<void>(
|
||||
context: context,
|
||||
barrierDismissible: true, // user must tap button!
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Alert'),
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
Text(message),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('OK'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SearchResults extends StatefulWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
|
||||
bool isLiveCareAppointment;
|
||||
|
||||
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
|
||||
|
||||
@override
|
||||
_SearchResultsState createState() => _SearchResultsState();
|
||||
}
|
||||
|
||||
class _SearchResultsState extends State<SearchResults> {
|
||||
// var event = RobotProvider();
|
||||
List<DoctorList> tempList = [];
|
||||
ProjectViewModel projectViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).bookAppo,
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
||||
body: ListView.separated(
|
||||
physics: BouncingScrollPhysics(),
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
// color: Color(0xffD9D9D9),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return AppExpandableNotifier(
|
||||
title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName,
|
||||
isTitleSingleLine: false,
|
||||
bodyWidget: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
itemBuilder: (context, _index) {
|
||||
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
|
||||
final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index];
|
||||
return DoctorView(
|
||||
doctor: doctor,
|
||||
isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
onTap: (){
|
||||
projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
|
||||
}
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patientDoctorAppointmentListHospital.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SearchResults extends StatefulWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
|
||||
bool isLiveCareAppointment;
|
||||
|
||||
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
|
||||
|
||||
@override
|
||||
_SearchResultsState createState() => _SearchResultsState();
|
||||
}
|
||||
|
||||
class _SearchResultsState extends State<SearchResults> {
|
||||
// var event = RobotProvider();
|
||||
List<DoctorList> tempList = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).bookAppo,
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
||||
body: ListView.separated(
|
||||
physics: BouncingScrollPhysics(),
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
// color: Color(0xffD9D9D9),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return AppExpandableNotifier(
|
||||
title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName,
|
||||
isTitleSingleLine: false,
|
||||
bodyWidget: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
itemBuilder: (context, _index) {
|
||||
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
|
||||
return DoctorView(
|
||||
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
|
||||
isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patientDoctorAppointmentListHospital.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SearchResults extends StatefulWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
|
||||
bool isLiveCareAppointment;
|
||||
|
||||
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
|
||||
|
||||
@override
|
||||
_SearchResultsState createState() => _SearchResultsState();
|
||||
}
|
||||
|
||||
class _SearchResultsState extends State<SearchResults> {
|
||||
// var event = RobotProvider();
|
||||
List<DoctorList> tempList = [];
|
||||
ProjectViewModel projectViewModel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
projectViewModel = Provider.of(context);
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).bookAppo,
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
||||
body: ListView.separated(
|
||||
physics: BouncingScrollPhysics(),
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
// color: Color(0xffD9D9D9),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return AppExpandableNotifier(
|
||||
title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName,
|
||||
isTitleSingleLine: false,
|
||||
bodyWidget: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
itemBuilder: (context, _index) {
|
||||
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
|
||||
final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index];
|
||||
return DoctorView(
|
||||
doctor: doctor,
|
||||
isLiveCareAppointment: widget.isLiveCareAppointment,
|
||||
onTap: (){
|
||||
projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
|
||||
}
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patientDoctorAppointmentListHospital.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
||||
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
|
||||
import 'package:diplomaticquarterapp/theme/colors.dart';
|
||||
// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SearchResults extends StatefulWidget {
|
||||
List<DoctorList> doctorsList = [];
|
||||
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
|
||||
bool isLiveCareAppointment;
|
||||
|
||||
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
|
||||
|
||||
@override
|
||||
_SearchResultsState createState() => _SearchResultsState();
|
||||
}
|
||||
|
||||
class _SearchResultsState extends State<SearchResults> {
|
||||
// var event = RobotProvider();
|
||||
List<DoctorList> tempList = [];
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: TranslationBase.of(context).bookAppo,
|
||||
isShowDecPage: false,
|
||||
isShowAppBar: true,
|
||||
showNewAppBarTitle: true,
|
||||
showNewAppBar: true,
|
||||
backgroundColor: CustomColors.appBackgroudGrey2Color,
|
||||
body: ListView.separated(
|
||||
physics: BouncingScrollPhysics(),
|
||||
separatorBuilder: (context, index) {
|
||||
return Container(
|
||||
height: 12,
|
||||
margin: EdgeInsets.only(left: 21, right: 21),
|
||||
// color: Color(0xffD9D9D9),
|
||||
);
|
||||
},
|
||||
itemBuilder: (context, index) {
|
||||
return AppExpandableNotifier(
|
||||
title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName,
|
||||
isTitleSingleLine: false,
|
||||
bodyWidget: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
|
||||
itemBuilder: (context, _index) {
|
||||
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
|
||||
return DoctorView(
|
||||
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
|
||||
isLiveCareAppointment: widget.isLiveCareAppointment ?? widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].isLiveCare,
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) => SizedBox(height: 14),
|
||||
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
|
||||
);
|
||||
},
|
||||
itemCount: widget.patientDoctorAppointmentListHospital.length,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue