Pharma LiveCare

merge-requests/598/head
haroon amjad 4 years ago
parent 33329f5c8a
commit 72e5d0a2be

@ -33,6 +33,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profil
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
@ -444,12 +446,12 @@ class _AppointmentActionsState extends State<AppointmentActions> {
}
static Future<void> openMap(double latitude, double longitude) async {
String googleUrl = 'https://www.google.com/maps/search/?api=1&query=$latitude,$longitude';
if (await canLaunch(googleUrl)) {
await launch(googleUrl);
} else {
throw 'Could not open the map.';
}
await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(latitude, longitude),
title: "Sulaiman Al Habib",
description: "Appointment Location",
);
}
askYourDoc() {

@ -1,3 +1,4 @@
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
@ -329,6 +331,19 @@ class _AppDrawerState extends State<AppDrawer> {
}
},
),
InkWell(
child: DrawerItem(TranslationBase.of(context).pharmacyLiveCare, SvgPicture.asset("assets/images/new/Live_Care.svg"),
isImageIcon: true,
bottomLine: false,
textColor: Theme.of(context).textTheme.bodyText1.color,
iconColor: Theme.of(context).textTheme.bodyText1.color,
sideArrow: true,
letterSpacing: -0.84,
projectProvider: projectProvider),
onTap: () {
readQRCode();
},
),
InkWell(
child: Stack(
children: [
@ -471,6 +486,19 @@ class _AppDrawerState extends State<AppDrawer> {
));
}
readQRCode() async {
String result = (await BarcodeScanner.scan())?.rawContent;
print(result);
GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService();
service.getPatientInfoByQR(result, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
drawerNavigator(context, routeName) {
Navigator.of(context).pushNamed(routeName);
}

Loading…
Cancel
Save