|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'dart:typed_data';
|
|
|
|
|
|
|
|
|
|
import 'package:barcode_scan2/barcode_scan2.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
|
@ -18,6 +19,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.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';
|
|
|
|
|
@ -56,7 +58,7 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
|
|
|
startNFCScan();
|
|
|
|
|
// startNFCScan();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
|
@ -76,9 +78,18 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
startQRCodeScan() async {
|
|
|
|
|
String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent;
|
|
|
|
|
if (onlineCheckInQRCode != "") {
|
|
|
|
|
sendNfcCheckInRequest(onlineCheckInQRCode);
|
|
|
|
|
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment);
|
|
|
|
|
} else {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
_context = context;
|
|
|
|
|
List<Widget> checkInOptionsList = getCheckInOptionsList(context);
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).onlineCheckIn,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
@ -123,47 +134,94 @@ class _QRCodeState extends State<QRCode> {
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
mHeight(21),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
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,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(left: 21, right: 21),
|
|
|
|
|
child: GridView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
primary: false,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
itemCount: checkInOptionsList.length,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return checkInOptionsList[index];
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// 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),
|
|
|
|
|
// ),
|
|
|
|
|
// 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,
|
|
|
|
|
// )),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> getCheckInOptionsList(BuildContext context) {
|
|
|
|
|
List<Widget> optionsList = [];
|
|
|
|
|
|
|
|
|
|
optionsList.add(
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
startNFCScan();
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).scanNFC,
|
|
|
|
|
imagePath: 'contactless.svg',
|
|
|
|
|
subTitle: "",
|
|
|
|
|
isEnable: true,
|
|
|
|
|
width: 80.0,
|
|
|
|
|
height: 80.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
optionsList.add(
|
|
|
|
|
InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
startQRCodeScan();
|
|
|
|
|
},
|
|
|
|
|
child: MedicalProfileItem(
|
|
|
|
|
title: TranslationBase.of(context).pharmaLiveCareScanQR,
|
|
|
|
|
imagePath: 'qr_code.svg',
|
|
|
|
|
subTitle: "",
|
|
|
|
|
isEnable: true,
|
|
|
|
|
width: 80.0,
|
|
|
|
|
height: 80.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return optionsList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sendEmail() async {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
|
|
|
|
|
|