@ -1,4 +1,3 @@
import ' dart:convert ' ;
import ' dart:typed_data ' ;
import ' package:diplomaticquarterapp/analytics/google-analytics.dart ' ;
@ -8,15 +7,18 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
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/models/header_model.dart ' ;
import ' package:diplomaticquarterapp/routes.dart ' ;
import ' package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart ' ;
import ' package:diplomaticquarterapp/theme/colors.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/ defaultB utton.dart' ;
import ' package:diplomaticquarterapp/widgets/buttons/ custom_text_b utton.dart' ;
import ' package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart ' ;
import ' package:diplomaticquarterapp/widgets/new_design/doctor_header.dart ' ;
import ' package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart ' ;
import ' package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart ' ;
import ' package:flutter/material.dart ' ;
@ -53,159 +55,131 @@ class _QRCodeState extends State<QRCode> {
} ) ;
WidgetsBinding . instance . addPostFrameCallback ( ( timeStamp ) {
Future . delayed ( const Duration ( milliseconds: 500 ) , ( ) {
showNfcReader ( context , onNcfScan: ( String nfcId ) {
Future . delayed ( const Duration ( milliseconds: 100 ) , ( ) {
sendNfcCheckInRequest ( nfcId ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc ( widget . appointment ) ;
} ) ;
} , onCancel: ( ) {
/ / Navigator . of ( context ) . pop ( ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc_cancel ( widget . appointment ) ;
} ) ;
} ) ;
startNFCScan ( ) ;
} ) ;
super . initState ( ) ;
}
startNFCScan ( ) {
Future . delayed ( const Duration ( milliseconds: 500 ) , ( ) {
showNfcReader ( context , onNcfScan: ( String nfcId ) {
Future . delayed ( const Duration ( milliseconds: 100 ) , ( ) {
sendNfcCheckInRequest ( nfcId ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc ( widget . appointment ) ;
} ) ;
} , onCancel: ( ) {
/ / Navigator . of ( context ) . pop ( ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc_cancel ( widget . appointment ) ;
} ) ;
} ) ;
}
@ override
Widget build ( BuildContext context ) {
_context = context ;
return AppScaffold (
appBarTitle: TranslationBase . of ( context ) . attendRegisterCode ,
appBarTitle: TranslationBase . of ( context ) . onlineCheckIn ,
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: [
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: SvgPicture . asset ( " assets/images/nfc/contactless.svg " ) ,
) ,
onTap: ( ) {
showNfcReader ( context , onNcfScan: ( String nfcId ) {
Future . delayed ( const Duration ( milliseconds: 100 ) , ( ) {
sendNfcCheckInRequest ( nfcId ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc ( widget . appointment ) ;
} ) ;
} , onCancel: ( ) {
/ / Navigator . of ( context ) . pop ( ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc_cancel ( widget . appointment ) ;
} ) ;
} ,
) ,
] ,
) ,
) ,
/ / Expanded (
/ / flex: 1 ,
/ / child: Container (
/ / margin: EdgeInsets . only ( top: 30.0 ) ,
/ / alignment: Alignment . center ,
/ / child: Image . memory (
/ / _bytes ,
/ / ) ,
/ / ) ,
/ / ) ,
] ,
) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
DoctorHeader (
headerModel: HeaderModel (
widget . appointment . doctorTitle + " " + widget . appointment . doctorNameObj ,
widget . appointment . doctorID ,
widget . appointment . doctorImageURL ,
widget . appointment . doctorSpeciality ,
" " ,
widget . appointment . projectName ,
DateUtil . convertStringToDate ( widget . appointment . appointmentDate ) ,
widget . appointment . isLiveCareAppointment
? DateUtil . convertStringToDate ( widget . appointment . appointmentDate ) . toString ( ) . split ( " " ) [ 1 ] . substring ( 0 , 5 )
: widget . appointment . startTime . substring ( 0 , 5 ) ,
null ,
widget . appointment . doctorRate ,
widget . appointment . actualDoctorRate ,
widget . appointment . noOfPatientsRate ,
" " ,
) ,
Container (
margin: EdgeInsets . only ( top: 20.0 , left: 20.0 , right: 20.0 ) ,
child: Divider (
color: Colors . red [ 700 ] ,
thickness: 0.8 ,
isShowName: true ,
isNeedToShowButton: false ,
buttonTitle: ' ' ,
onTap: ( ) { } ,
onRatingAndReviewTap: ( ) { } ,
) ,
InkWell (
child: Container (
margin: EdgeInsets . only ( top: 30.0 ) ,
padding: EdgeInsets . all ( 8 ) ,
child: SvgPicture . asset (
" assets/images/nfc/contactless.svg " ,
width: 80.0 ,
height: 80.0 ,
) ,
) ,
Row (
children: < Widget > [
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 ) ) ,
) ,
onTap: ( ) {
showNfcReader ( context , onNcfScan: ( String nfcId ) {
Future . delayed ( const Duration ( milliseconds: 100 ) , ( ) {
sendNfcCheckInRequest ( nfcId ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc ( widget . appointment ) ;
} ) ;
} , onCancel: ( ) {
/ / Navigator . of ( context ) . pop ( ) ;
locator < GAnalytics > ( ) . todoList . to_do_list_nfc_cancel ( widget . appointment ) ;
} ) ;
} ,
) ,
Row (
children: < Widget > [
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 (
fontSize: 20 ,
fontWeight: FontWeight . w600 ,
letterSpacing: - 0.48 ,
) ) ,
) ,
] ,
) ,
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 ) ,
] ,
] ,
) ,
] ,
) ,
) ,
bottomSheet: Container (
color: CustomColors . appBackgroudGreyColor ,
padding: EdgeInsets . all ( 21 ) ,
/ / height: 45.0 ,
child: Row (
children: [
Expanded (
flex: 1 ,
child: ButtonTheme (
shape: RoundedRectangleBorder (
borderRadius: BorderRadius . circular ( 10.0 ) ,
) ,
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 ] ) ) ,
) ,
] ,
height: 45.0 ,
child: CustomTextButton (
backgroundColor: CustomColors . green ,
elevation: 0 ,
onPressed: ( ) {
startNFCScan ( ) ;
} ,
child: Text ( TranslationBase . of ( context ) . scanNFC ,
style: TextStyle (
fontSize: 18.0 ,
color: Colors . white ,
) ) ,
) ,
) ,
/ / 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 ( ) } )
/ / ] ,
/ / ) ,
/ / ) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ;