QR Code checkin implemented

dev_3.3_LabReportEnhancementCR
haroon amjad 2 years ago
parent 542501f5c5
commit 0a478e077a

@ -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();

@ -294,15 +294,17 @@ class Utils {
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg',
subTitle: TranslationBase.of(context).radiologySubtitle,
isEnable: projectViewModel.havePrivilege(7),
medical.add(
InkWell(
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg',
subTitle: TranslationBase.of(context).radiologySubtitle,
isEnable: projectViewModel.havePrivilege(7),
),
),
));
);
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
@ -820,10 +822,7 @@ 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}) {

@ -51,8 +51,8 @@ class MedicalProfileItem extends StatelessWidget {
)
: SvgPicture.asset(
"assets/images/new/services/$imagePath",
height: SizeConfig.widthMultiplier * 7,
width: SizeConfig.widthMultiplier * 7,
height: height != null ? height : SizeConfig.widthMultiplier * 7,
width: width != null ? width : SizeConfig.widthMultiplier * 7,
color: imgColor,
),
mFlex(2),

Loading…
Cancel
Save