From c67e54ab41fbc120b9ed81ccac6d2a9aa6ae41cb Mon Sep 17 00:00:00 2001 From: Sneha Date: Mon, 24 Jul 2023 14:12:57 +0530 Subject: [PATCH] ORDERMEDICINES PAGE ADDED --- images/bmivalue.png | Bin 0 -> 1113 bytes images/date.png | Bin 805 -> 800 bytes images/height.png | Bin 2811 -> 2711 bytes images/time.png | Bin 4071 -> 3949 bytes images/weight.png | Bin 3188 -> 2617 bytes lib/common/dashboard.dart | 18 +- lib/common/settings.dart | 9 +- lib/common/updateprofile.dart | 4 +- lib/models/prescriptions_model.dart | 16 + lib/prescriptions/add_prescriptions.dart | 8 +- lib/prescriptions/oreder_medicines.dart | 717 +++++++++++++++++++++++ lib/prescriptions/prescriptions.dart | 515 ++++++++-------- 12 files changed, 1007 insertions(+), 280 deletions(-) create mode 100644 images/bmivalue.png create mode 100644 lib/prescriptions/oreder_medicines.dart diff --git a/images/bmivalue.png b/images/bmivalue.png new file mode 100644 index 0000000000000000000000000000000000000000..5b4b6a6c84fae7c01fe2df3711b2970d976b873f GIT binary patch literal 1113 zcmV-f1g86mP)#ua^QUZRAlljP?C#9`f1iUTaoPf3x|yBbZixT@0000000000000000001>Kmoxc z-P3NpR*Smo%N9{wSGQMjG&$}(KRhGHAn*f+7u`k_MVE0LHy-|9OqEt=9w=drfz zOJwIKS?OoXf#!*G!E&wkTyoFF(FN zd-;^VY?28j#AVh6wjpl9Smcu8GOGgH6gQDMa*1)7HGyr6n^-t<$#JLOf(2}jJF7ov zU#lCvwPOq7vL&*>WHR}rZW=mc%ZtnVxo*W}r7u+;oOfEJx#=r6uATe2^OPP~ZI(3` zxgHXLkd&KrQZiz_uSPp;;TLELPtK3u3a-$TUBM%+96=kX~nL*N;{#bpS5$H%w~ zfyv*vOnhLU<1*2KeUHn;29^+)i3}_yE)y46Qd}k~u(Y^LOkjy|nTWtr<1+69OODID z4lF$`v*Mhre+h!1(I2#9%A2Qg8P=jbj>}{R_B<|=8(2VGCNr>*xUAH`J8Qk6y1Ahu z35v^XI4^peiZSAALQ9Ivtaxt{U+qop67lEtHpwi$e#TJ!lxN}i*Rk$(CjkHe00000 z005w9Mwcr29sAQO<^;=Xm09b`=rE<$$UMAQ_5h5z$0b9iaieR5&14jY)fJPG zjU7#jqUZzSW>&A&Zm$_;jIqG#u-^*;6O4Wei^1c;0S?8PVRS2KFmPP#nHiqq$rc%8 zEO50NzQ(IKv(b1Q8a>0sSYZCNuWEI?qW|HKFoRzhS78{c8T8SR000000000000000 f00000z+-;_EOo5T9cp(C00000NkvXXu0mjf!AcD# literal 0 HcmV?d00001 diff --git a/images/date.png b/images/date.png index 1a2226233c3a2031c4961b7210cbc6d982ef37d3..4cd1f64d146f272387ba0d7f36570a8d101b1a81 100644 GIT binary patch delta 733 zcmZ3=wt#JdO8s+B7srqa##ry zG2SD>5{r(xPnZ6}VcXQ%f4l6CsLuwo62<#Go9F+Jck-H@rgpRb)Vpan*KjZ(1BdR( zVpZRBZ^Y_|$*+q4{A#(z>9vmo^G$?Z4WD%=)=w5&W%fsX=e-YG_gwxdyQsAI$c0k} zrp}%EeCLa9L-&GQ-kvs&9GS*mAK%{ov#D zeetzx>kY!@wp-46Y;$ABG`6yO+03xrtut2uU0I>ayGQ13U0ChRBE?rpX9VN4nZNU^ zJ-;euzly(V)0wA#|9-4h-I1K9-}%3z~5s&$)2e%zquEuXz9Vsfh)F!aIVK-Je$ zHmYgQn{Db}p1YuZ%|frTJrY4NlecO^4V+xVq)-p^6ZePrhknhg|M&83__e#K!i6k9 zSe9>Hv@n$`aGBhV>iegv|13Swy=*WT(G=H~%+h&F1A(lXso@OZLG388x<* zPiwyg3GJSuZ1~l-YkA}|KmWKnv7E?Bi$NiCKZB@aq+zha8U>Jqr>mdKI;RB2CIGhB BT(tlI delta 735 zcmZ3$wv=sxO8py87srqa#--GqDuMcgDbnbbh z-=g9lyRj)aydasy45(c2h6R(fd%|Om92sk{A!kwyCyVkKNB){|GD(eF6CCUib!nSs zoa9P3`do5VcFQTA&?CRO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;L9iK=>O%qydq!ekQf7mr=uLrO1;$Q|teW9G35L z-_-f!rAsi#OUoiG2H2(pndzjx`rzP7gkCwtDrjsn>K3T(#*_Uv3R7F$T> zvqjx$xYBS1>$L`ofRT(+=_lFX)4}**BgLeOcXh_6vmAx@s@k$kM=3G4fXY>iH8o&_ z_<2CDfFIa{WG5j_?Q4^(K*M=ce(g%4$R!fyrplW;^$0S5+I(c?phl|Fen9=T`L!VCFUt-6*vlU&lFP&YHJbll eZ0}aO;27brDKZ)FJi7WOXiN>Q46tDLg#Q8Sa3Y2P diff --git a/lib/common/dashboard.dart b/lib/common/dashboard.dart index 7e5fa29..160600e 100644 --- a/lib/common/dashboard.dart +++ b/lib/common/dashboard.dart @@ -549,13 +549,13 @@ class _DashboardState extends State { resizeToAvoidBottomInset: false, appBar: AppSettings.appBar('Health Care'), drawer: Drawer( - backgroundColor: secondaryColor, + backgroundColor: primaryColor, child: ListView( padding: EdgeInsets.zero, children: [ DrawerHeader( decoration: const BoxDecoration( - color: primaryColor, + color: buttonColors, ), child: Row( children: [ @@ -597,7 +597,7 @@ class _DashboardState extends State { child: Icon( Icons.camera_alt_outlined, size: 100, - color: greyColor, + color: primaryColor, ), onTap: () async { await takeImageFromCamera(); @@ -614,7 +614,7 @@ class _DashboardState extends State { child: Icon( Icons.photo, size: 100, - color: greyColor, + color: primaryColor, ), onTap: () async { await pickImageFromGallery(); @@ -631,17 +631,17 @@ class _DashboardState extends State { ), Text( AppSettings.userName, - style: drawerHeaderTextStyle(), + style: drawerHeaderTextStyleNew(), ), Text( AppSettings.phoneNumber, - style: drawerHeaderTextStyle(), + style: drawerHeaderTextStyleNew(), ), Visibility( visible: AppSettings.email != '', child: Text( AppSettings.email, - style: drawerHeaderTextStyle(), + style: drawerHeaderTextStyleNew(), ), ), Row( @@ -650,14 +650,14 @@ class _DashboardState extends State { visible: AppSettings.age != '', child: Text( AppSettings.age + ' Yrs, ', - style: drawerHeaderTextStyle(), + style: drawerHeaderTextStyleNew(), ), ), Visibility( visible: AppSettings.gender != '', child: Text( AppSettings.gender, - style: drawerHeaderTextStyle(), + style: drawerHeaderTextStyleNew(), ), ), ], diff --git a/lib/common/settings.dart b/lib/common/settings.dart index 215fa9b..2d8b044 100644 --- a/lib/common/settings.dart +++ b/lib/common/settings.dart @@ -112,6 +112,9 @@ TextStyle drawerHeaderTextStyle(){ return TextStyle(color: Colors.white, fontSize: 15); } +TextStyle drawerHeaderTextStyleNew(){ + return TextStyle(color: Colors.black, fontSize: 15); +} @@ -194,7 +197,7 @@ class AppSettings { static String getMedicineTimingsUrl = host + 'getmedicineztiming'; static String prescriptionUploadPicUrl = host + 'uploads-precription'; static String getAllpharmaciesDataUrl = host + 'getAllPharmacylist'; - static String uploadPrescriptionUrl = host + 'submitPicture'; + static String getQuotationUrl = host + 'submitPicture'; static String addPrescriptionUrl = host + 'add-prescription-details'; static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo'; static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription'; @@ -761,8 +764,8 @@ class AppSettings { } } - static Future uploadPrescription(payload) async { - var uri = Uri.parse(uploadPrescriptionUrl + '/' + customerId); + static Future getQuotation(payload) async { + var uri = Uri.parse(getQuotationUrl + '/' + customerId); var response = await http.post( uri, body: json.encode(payload), diff --git a/lib/common/updateprofile.dart b/lib/common/updateprofile.dart index 92624bc..8d4e890 100644 --- a/lib/common/updateprofile.dart +++ b/lib/common/updateprofile.dart @@ -135,7 +135,7 @@ class _UpdateprofileState extends State { child: Icon( Icons.camera_alt_outlined, size: 100, - color: greyColor, + color: primaryColor, ), onTap: () async { await takeImageFromCamera(); @@ -150,7 +150,7 @@ class _UpdateprofileState extends State { child: Icon( Icons.photo, size: 100, - color: greyColor, + color: primaryColor, ), onTap: () async { await pickImageFromGallery(); diff --git a/lib/models/prescriptions_model.dart b/lib/models/prescriptions_model.dart index 6a7176e..63a9a5d 100644 --- a/lib/models/prescriptions_model.dart +++ b/lib/models/prescriptions_model.dart @@ -18,6 +18,22 @@ class PrescriptionsModel { rtvm.patient_type = json['patientType'] ?? ''; rtvm.prescription_url = json['pictureUrl'][0] ?? ''; + if(rtvm.patient_type.toString().toLowerCase()=='self'){ + rtvm.age=AppSettings.age; + rtvm.gender=AppSettings.gender; + rtvm.patient_name=AppSettings.userName; + } + /* "others": { + "name": "jhanu", + "age": 23, + "gender": "female" + },*/ + else{ + rtvm.age=json['others']['age'].toString(); + rtvm.gender=json['others']['gender']; + rtvm.patient_name=json['others']['name']; + } + return rtvm; } diff --git a/lib/prescriptions/add_prescriptions.dart b/lib/prescriptions/add_prescriptions.dart index a68fbad..313033e 100644 --- a/lib/prescriptions/add_prescriptions.dart +++ b/lib/prescriptions/add_prescriptions.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/prescriptions/prescriptions.dart'; import 'package:image_picker/image_picker.dart'; import 'package:photo_view/photo_view.dart'; import 'package:pinch_zoom/pinch_zoom.dart'; @@ -218,7 +219,6 @@ class _AddPrescriptionState extends State { ), onTap: (){ showPicDialog(Url); - }, ) ), @@ -371,6 +371,12 @@ class _AddPrescriptionState extends State { if(uploadStatus){ Navigator.of(context,rootNavigator: true).pop(); AppSettings.longSuccessToast('Prescription added successfully'); + Navigator.pop(context); + /* await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Prescriptions()), + );*/ } else{ Navigator.of(context,rootNavigator: true).pop(); diff --git a/lib/prescriptions/oreder_medicines.dart b/lib/prescriptions/oreder_medicines.dart new file mode 100644 index 0000000..dc44d21 --- /dev/null +++ b/lib/prescriptions/oreder_medicines.dart @@ -0,0 +1,717 @@ +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/google_maps_place_picker_mb/src/models/pick_result.dart'; +import 'package:healthcare_user/google_maps_place_picker_mb/src/place_picker.dart'; +import 'package:healthcare_user/keys.dart'; +import 'package:healthcare_user/models/pharmacies_model.dart'; +import 'package:google_maps_flutter_android/google_maps_flutter_android.dart'; +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; +import 'package:location/location.dart' as locationmap; + + +class OrderMedicines extends StatefulWidget { + var prescriptionDetails; + OrderMedicines({this.prescriptionDetails}); + + @override + State createState() => _OrderMedicinesState(); +} + +class _OrderMedicinesState extends State { + double lat = 0; + double lng = 0; + String userAddress = ''; + String dropdownArea = '2'; + //String dropdownType = 'Tank'; + var AreaItems = ['2', '5', '10', '25', '50', '100']; + List pharmaciesCheckboxes = []; + List selectedPharmacies = []; + bool isLoading = false; + bool isSereverIssue = false; + List pharmaciesList = []; + List FilteredList = []; + + PickResult? selectedPlace; + + bool _mapsInitialized = false; + final String _mapsRenderer = "latest"; + + var kInitialPosition = const LatLng(15.462477, 78.717401); + + locationmap.Location location = locationmap.Location(); + + final GoogleMapsFlutterPlatform mapsImplementation = + GoogleMapsFlutterPlatform.instance; + + void initRenderer() { + if (_mapsInitialized) return; + if (mapsImplementation is GoogleMapsFlutterAndroid) { + switch (_mapsRenderer) { + case "legacy": + (mapsImplementation as GoogleMapsFlutterAndroid) + .initializeWithRenderer(AndroidMapRenderer.legacy); + break; + case "latest": + (mapsImplementation as GoogleMapsFlutterAndroid) + .initializeWithRenderer(AndroidMapRenderer.latest); + break; + } + } + setState(() { + _mapsInitialized = true; + }); + } + + Future getAllPharmaciesData(var distance) async { + isLoading = true; + try { + var pharmacyResponse = await AppSettings.getAllpharmacies(); + + setState(() { + pharmaciesList = ((jsonDecode(pharmacyResponse)['data']) as List) + .map((dynamic model) { + return PharmaciesModel.fromJson(model); + }).toList(); + FilteredList = []; + pharmaciesList.forEach((element) async { + var distanceInM; + if (distance == '2') { + distanceInM = 2000; + } else if (distance == '5') { + distanceInM = 5000; + } else if (distance == '10') { + distanceInM = 10000; + } else if (distance == '25') { + distanceInM = 25000; + } else if (distance == '50') { + distanceInM = 50000; + } else if (distance == '100') { + distanceInM = 100000; + } + double distanceInMeters = await Geolocator.distanceBetween( + element.lat, element.lng, lat, lng); + if (distanceInMeters <= distanceInM) { + FilteredList.add(element); + } + }); + + isLoading = false; + }); + } catch (e) { + setState(() { + isLoading = false; + isSereverIssue = true; + }); + } + } + + + showListOfSelectedPharmacies() async { + return showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + return StatefulBuilder( + builder: (BuildContext context, StateSetter setState) { + + return Container( + height: 300.0, // Change as per your requirement + width: 300.0, // Change as per your requirement + child: ListView.builder( + shrinkWrap: true, + itemCount: 5, + itemBuilder: (BuildContext context, int index) { + return ListTile( + title: Text('Gujarat, India'), + ); + }, + ), + ); + /* return AlertDialog( + title: const Text('Selected pharmacies'), + content: SingleChildScrollView( + child: Expanded( + child: ListView.builder( + itemCount: selectedPharmacies.length, + itemBuilder: (context, index) { + return Card( + child: Column( + children: [ + Text(selectedPharmacies[index].pharmacy_name) + ], + ), + );}, + ), + ) + ), + actions: [ + TextButton( + child: Text('Cancel', style: textButtonStyle()), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + TextButton( + child: Text('Get quote', style: textButtonStyle()), + onPressed: () async { + Navigator.of(context).pop(); + }, + ), + ], + );*/ + }); + }, + ); + } + + Widget setupAlertDialoadContainer() { + return Container( + height: 300.0, // Change as per your requirement + width: 300.0, // Change as per your requirement + child: ListView.builder( + shrinkWrap: true, + itemCount: 5, + itemBuilder: (BuildContext context, int index) { + return ListTile( + title: Text('Gujarat, India'), + ); + }, + ), + ); + } + + Widget _pharamciesData() { + if (FilteredList.length != 0) { + return + Container( + color: secondaryColor, + child: Column(crossAxisAlignment: CrossAxisAlignment.end, children: [ + Expanded( + child: GridView.builder( + itemCount: FilteredList.length, + itemBuilder: (context, index) { + return Card( + elevation: 2.0, + child: CheckboxListTile( + title: Padding( + padding: EdgeInsets.fromLTRB(0, 10, 0, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * .18, + height: MediaQuery.of(context).size.height * .10, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: FilteredList[index].picture == '' + ? AssetImage("images/logo.png") + : NetworkImage( + FilteredList[index].picture) + as ImageProvider, // picked file + fit: BoxFit.contain)), + ), + SizedBox( + width: 5, + ), + Expanded( + child: Container( + width: MediaQuery.of(context).size.width * .70, + child: Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + FilteredList[index] + .pharmacy_name + .toUpperCase(), + style: wrapTextStyleBlack()), + SizedBox( + height: 10, + ), + Text( + FilteredList[index] + .contact_number + .toUpperCase(), + style: wrapTextStyleBlack()), + SizedBox( + height: 10, + ), + Text( + FilteredList[index] + .pharmacy_address + .toUpperCase(), + style: wrapTextStyleBlack()), + Visibility( + visible: + FilteredList[index].description != '', + child: SizedBox( + height: 10, + ), + ), + Visibility( + visible: + FilteredList[index].description != '', + child: Text( + FilteredList[index] + .description + .toUpperCase(), + style: wrapTextStyleBlack()), + ), + SizedBox( + height: 10, + ), + ], + )), + ), + ], + )), + checkColor: Colors.white, + activeColor: primaryColor, + value: FilteredList[index].isChecked, + onChanged: (val) { + setState( + () { + FilteredList[index].isChecked = val!; + }, + ); + if (FilteredList[index].isChecked) { + pharmaciesCheckboxes.add({ + 'pharmacyId': FilteredList[index].pharmacy_id, + }); + selectedPharmacies.add(FilteredList[index]); + } else { + pharmaciesCheckboxes.removeWhere((e) => + e['pharmacyId'].toString().toUpperCase() == + FilteredList[index] + .pharmacy_id + .toString() + .toUpperCase()); + selectedPharmacies.remove(FilteredList[index]); + } + }, + ), + ); + }, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 1, //.size.width * .33, + childAspectRatio: MediaQuery.of(context).size.width / + (MediaQuery.of(context).size.height / 7)), + ), + ), + Padding( + padding: EdgeInsets.all(0), + child: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .06, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: buttonColors, // background + onPrimary: Colors.black, // foreground + ), + onPressed: () async { + + + if(pharmaciesCheckboxes.length==3){ + + var payload = new Map(); + + payload["picture"] = widget.prescriptionDetails.prescription_url.toString(); + payload["pharmacies"] = pharmaciesCheckboxes; + payload["familyDetails"] = { + "patient_name": widget.prescriptionDetails.patient_name.toString(), + "patient_age": int.parse(widget.prescriptionDetails.age.toString()), + "patient_gender": widget.prescriptionDetails.gender, + "patient_address": userAddress + }; + bool status = await AppSettings.getQuotation(payload); + + if(status){ + AppSettings.longSuccessToast('Quotation request sent successfully'); + } + else{ + AppSettings.longFailedToast('Get quotation failed try after some time'); + } + + } + else if(pharmaciesCheckboxes.length>3){ + + showListOfSelectedPharmacies(); + + } + else{ + AppSettings.longFailedToast('Please select at least three pharmacies to get quotation'); + } + + + }, + child: Text('Get quote'), + )), + ), + ]), + ); + } + else { + return Center( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: isSereverIssue + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image( + image: AssetImage('images/serverissue.png'), + // height: MediaQuery.of(context).size.height * .10, + ), + SizedBox( + height: 20, + ), + Text( + 'There is an issue at server please try after some time',style:serverIssueTextStyle() ,), + ], + ) + : userAddress==''?Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + /*Image( + image: AssetImage('images/resourceblue.pngs'), + // height: MediaQuery.of(context).size.height * .10, + ),*/ + Icon(Icons.location_on_outlined,color: primaryColor,size: 40,), + SizedBox( + height: 20, + ), + Text( + 'Please select location to see near by tankers',style:TextStyle( + color: primaryColor, + fontWeight: FontWeight.bold, + ),), + ], + ): + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + /*Image( + image: AssetImage('images/resourceblue.pngs'), + // height: MediaQuery.of(context).size.height * .10, + ),*/ + Icon( + Icons.info, + color: primaryColor, + size: 40, + ), + SizedBox( + height: 20, + ), + Text( + 'No pharmacies near to your selected locaton', + style: TextStyle( + color: primaryColor, + fontWeight: FontWeight.bold, + ), + ), + ], + ) + )); + } + } + + @override + void initState() { + lat = AppSettings.userLatitude; + lng = AppSettings.userLongitude; + userAddress = AppSettings.userAddress; + getAllPharmaciesData(dropdownArea); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Order Medicines'), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * .18, + height: MediaQuery.of(context).size.height * .10, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage(widget.prescriptionDetails.prescription_url) + as ImageProvider, // picked file + fit: BoxFit.contain)), + ), + SizedBox( + width: MediaQuery.of(context).size.width * .02, + ), + Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.prescriptionDetails.prescription_name + .toString() + .toUpperCase(), + style: valuesTextStyle()), + Text( + widget.prescriptionDetails.patient_name + .toString() + .toUpperCase(), + style: valuesTextStyle()), + Text( + widget.prescriptionDetails.gender + .toString() + .toUpperCase(), + style: valuesTextStyle()), + Text( + widget.prescriptionDetails.age + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ], + ), + ), + ], + )), + Padding( + padding: EdgeInsets.all(10), + child: TextButton( + onPressed: () {}, + child: const Text( + 'Want to order non prescribed items?', + style: TextStyle( + fontSize: 15, + decoration: TextDecoration.underline, + color: primaryColor), + )), + ), + Padding( + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Your address', + style: labelTextStyle(), + ), + Text( + userAddress, + style: valuesTextStyle(), + ), + Row( + children: [ + TextButton( + child: const Text( + 'Change', + style: TextStyle( + fontSize: 15, + decoration: TextDecoration.underline, + color: primaryColor), + ), + onPressed: () { + location.serviceEnabled().then((value) { + if (value) { + initRenderer(); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) { + return PlacePicker( + resizeToAvoidBottomInset: false, + hintText: "Find a place ...", + searchingText: "Please wait ...", + selectText: "Select place", + outsideOfPickAreaText: + "Place not in area", + initialPosition: kInitialPosition, + useCurrentLocation: true, + selectInitialPosition: true, + usePinPointingSearch: true, + usePlaceDetailSearch: true, + zoomGesturesEnabled: true, + zoomControlsEnabled: true, + onMapCreated: (GoogleMapController + controller) {}, + onPlacePicked: (PickResult result) { + setState(() { + selectedPlace = result; + lat = selectedPlace! + .geometry!.location.lat; + lng = selectedPlace! + .geometry!.location.lng; + if (selectedPlace! + .types!.length == + 1) { + userAddress = selectedPlace! + .formattedAddress!; + } else { + userAddress = selectedPlace! + .name! + + ', ' + + selectedPlace! + .formattedAddress!; + } + Navigator.of(context).pop(); + getAllPharmaciesData( + dropdownArea); + }); + }, + onMapTypeChanged: + (MapType mapType) {}, + apiKey: Platform.isAndroid + ? APIKeys.androidApiKey + : APIKeys.iosApiKey, + forceAndroidLocationManager: true, + ); + }, + ), + ); + } else { + showGeneralDialog( + context: context, + pageBuilder: (context, x, y) { + return Scaffold( + backgroundColor: + Colors.grey.withOpacity(.5), + body: Center( + child: Container( + width: double.infinity, + height: 150, + padding: + const EdgeInsets.symmetric( + horizontal: 20), + child: Card( + child: Padding( + padding: const EdgeInsets.all( + 10.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + const Text( + "Please enable the location", + style: TextStyle( + fontSize: 18, + fontWeight: + FontWeight.w500, + ), + ), + const SizedBox( + height: 20, + ), + ElevatedButton( + onPressed: () { + Navigator.pop( + context); + }, + child: const Text( + "Cancel"), + ), + ], + ), + ), + ), + ), + ), + ); + }, + ); + } + }); + }, + ), + Icon( + Icons.location_on_outlined, + color: primaryColor, + size: 20, + ), + ], + ) + ], + ), + ), + Expanded( + child: Container( + height: MediaQuery.of(context).size.height * .09, + padding: const EdgeInsets.fromLTRB(10, 10, 0, 0), + child: DropdownButtonFormField( + value: dropdownArea, + isExpanded: true, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.area_chart, + color: primaryColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: greyColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + labelText: 'distance', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + + hint: Text('Select Area'), + // Down Arrow Icon + icon: const Icon(Icons.keyboard_arrow_down), + + // Array list of items + items: AreaItems.map((String items) { + return DropdownMenuItem( + value: items, + child: Text(items), + ); + }).toList(), + // After selecting the desired option,it will + // change button value to selected value + onChanged: (String? newValue) { + setState(() { + dropdownArea = newValue!; + }); + getAllPharmaciesData(dropdownArea); + }, + ), + ), + ) + ], + ), + ), + Expanded( + child: isLoading + ? Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ) + : _pharamciesData(), + ) + ], + )); + } +} diff --git a/lib/prescriptions/prescriptions.dart b/lib/prescriptions/prescriptions.dart index a85cc23..4ccc2b3 100644 --- a/lib/prescriptions/prescriptions.dart +++ b/lib/prescriptions/prescriptions.dart @@ -6,8 +6,9 @@ import 'package:geolocator/geolocator.dart'; import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/models/pharmacies_model.dart'; import 'package:healthcare_user/prescriptions/add_prescriptions.dart'; +import 'package:healthcare_user/prescriptions/oreder_medicines.dart'; import 'package:image_picker/image_picker.dart'; - +import 'package:photo_view/photo_view.dart'; import 'package:healthcare_user/models/prescriptions_model.dart'; class Prescriptions extends StatefulWidget { @@ -22,9 +23,10 @@ class _PrescriptionsState extends State { String Url = ''; List pharmaciesList = []; List prescriptionsList = []; + List prescriptionsListOriginal = []; List FilteredList = []; bool isPharmacyDataLoading = false; - bool isPrescriptionsData = false; + bool isPrescriptionsDataLoading = false; bool isSereverIssue = false; double lat = 0; double lng = 0; @@ -33,6 +35,7 @@ class _PrescriptionsState extends State { //String dropdownType = 'Tank'; var AreaItems = ['2', '5', '10', '25', '50', '100']; List pharmaciesCheckboxes = []; + bool isLoading=false; Future getAllPharmaciesData(var distance) async { isPharmacyDataLoading=true; @@ -78,21 +81,21 @@ class _PrescriptionsState extends State { } Future getAllPrescriptions() async { - isPrescriptionsData=true; + isPrescriptionsDataLoading=true; try { var response = await AppSettings.getAllPrescriptions(); setState(() { - prescriptionsList = ((jsonDecode(response)) as List) + prescriptionsListOriginal = ((jsonDecode(response)) as List) .map((dynamic model) { return PrescriptionsModel.fromJson(model); }).toList(); - - isPrescriptionsData = false; + prescriptionsList=prescriptionsListOriginal.reversed.toList(); + isPrescriptionsDataLoading = false; }); } catch (e) { setState(() { - isPrescriptionsData = false; + isPrescriptionsDataLoading = false; isSereverIssue = true; }); } @@ -299,7 +302,7 @@ class _PrescriptionsState extends State { payload["picture"] = Url.toString(); payload["pharmacies"] = pharmaciesCheckboxes; - bool status = await AppSettings.uploadPrescription(payload); + bool status = await AppSettings.getQuotation(payload); try { if (status) { Navigator.of(context, rootNavigator: true).pop(); @@ -399,262 +402,264 @@ class _PrescriptionsState extends State { )); } } + showPicDialog(var imageUrl){ + return showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + return StatefulBuilder( + builder: (BuildContext context, StateSetter setState) { + return AlertDialog( + title: const Text(''), + content: SingleChildScrollView( + child: ListBody( + children: [ + Container( + width: MediaQuery.of(context).size.width * .10, + height: MediaQuery.of(context).size.height * .50, + child: PhotoView( + imageProvider: NetworkImage(imageUrl) as ImageProvider, + maxScale: PhotoViewComputedScale.contained * 4.0, + minScale: PhotoViewComputedScale.contained, + initialScale: PhotoViewComputedScale.contained, + basePosition: Alignment.center, + + ) + ) + ], + ), + ), + actions: [ + TextButton( + child: Text('Close', style: textButtonStyle()), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }); + }, + ); + } Widget _allPrescriptions(){ if (prescriptionsList.length != 0) { - return Column( - children: [ - GridView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: FilteredList.length, - itemBuilder: (context, index) { - return Card( - elevation: 2.0, - child: CheckboxListTile( - title: Padding( - padding: EdgeInsets.fromLTRB(10, 10, 0, 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, + return Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child:ListView.builder( + padding: EdgeInsets.all(0), + itemCount: prescriptionsList.length, + itemBuilder: (BuildContext context, int index) { + return Card( + + //color: prescriptionsList[index].cardColor, + child: Padding( + padding:EdgeInsets.all(8) , + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context).size.width * .18, - height: - MediaQuery.of(context).size.height * .10, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - image: DecorationImage( - image: FilteredList[index].picture == '' - ? AssetImage("images/logo.png") - : NetworkImage( - FilteredList[index].picture) - as ImageProvider, // picked file - fit: BoxFit.contain)), - ), - SizedBox( - width: 5, - ), - Expanded( - child: Container( - width: - MediaQuery.of(context).size.width * .70, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Container( + width: MediaQuery.of(context).size.width * .18, + height: + MediaQuery.of(context).size.height * .10, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage(prescriptionsList[index].prescription_url) as ImageProvider, // picked file + fit: BoxFit.contain)), + ), + onTap: (){ + showPicDialog(prescriptionsList[index].prescription_url); + + }, + ), + SizedBox(width:MediaQuery.of(context).size.width * .02,), + + Container( + width: MediaQuery.of(context).size.width * .55, child: Column( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - FilteredList[index] - .pharmacy_name - .toUpperCase(), - style: wrapTextStyleBlack()), - SizedBox( - height: 10, - ), - Text( - FilteredList[index] - .contact_number - .toUpperCase(), - style: wrapTextStyleBlack()), - /*Visibility( - visible: FilteredList[index].supplier_alternate_phone_number!='', - child: Text( - FilteredList[index] - .supplier_alternate_phone_number - .toUpperCase(), - style: wrapTextStyleBlack()),),*/ - SizedBox( - height: 10, - ), - Text( - FilteredList[index] - .pharmacy_address - .toUpperCase(), - style: wrapTextStyleBlack()), - Visibility( - visible: - FilteredList[index].description != - '', - child: SizedBox( - height: 10, - ), - ), - Visibility( - visible: - FilteredList[index].description != - '', - child: Text( - FilteredList[index] - .description - .toUpperCase(), - style: wrapTextStyleBlack()), + Text(prescriptionsList[index].prescription_name.toString().toUpperCase(),style: valuesTextStyle()), + Text(prescriptionsList[index].patient_name.toString().toUpperCase(),style: valuesTextStyle()), + Text(prescriptionsList[index].gender.toString().toUpperCase(),style: valuesTextStyle()), + Text(prescriptionsList[index].age.toString().toUpperCase(),style: valuesTextStyle()), + ], + ), + + + ), + + + Expanded(child:IconButton( + icon: const Icon(Icons.edit,color: primaryColor,), + onPressed: () { + + + }, + ),), + Expanded(child:IconButton( + icon: const Icon(Icons.delete,color: primaryColor,), + + onPressed: () async{ + /* showDialog( + //if set to true allow to close popup by tapping out of the popup + //barrierDismissible: false, + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('Do you want to delete tank?', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + TextButton( + onPressed: ()async { + var payload = new Map(); + payload["tankLocation"] = modelTanksViewList[index].tank_location.toString().toLowerCase(); + bool deleteTankStatus = await AppSettings.deleteTank(modelTanksViewList[index].tank_name,payload); + + + if(deleteTankStatus){ + readJson(); + AppSettings.longSuccessToast('tank deleted successfully'); + Navigator.of(context).pop(true); + + } + else{ + AppSettings.longFailedToast('tank deletion failed'); + Navigator.of(context).pop(true); + } + }, + child: const Text('Yes', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), ), - SizedBox( - height: 10, + TextButton( + onPressed: () { + Navigator.of(context).pop(true); + }, + child: const Text('No', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), ), - /*Text( - FilteredList[index] - .starting_price - .toUpperCase(), - style: wrapTextStyleBlack()), - SizedBox(height: 10,),*/ ], - )), - ), - ], - ) - ), - checkColor: Colors.white, - activeColor: primaryColor, - value: FilteredList[index].isChecked, - onChanged: (val) { - setState( - () { - FilteredList[index].isChecked = val!; - }, - ); - if (FilteredList[index].isChecked) { - pharmaciesCheckboxes.add({ + ), + );*/ - 'pharmacyId': - FilteredList[index] - .pharmacy_id, - }); - } else { - pharmaciesCheckboxes.removeWhere((e) => - e['pharmacyId'] - .toString() - .toUpperCase() == - FilteredList[index] - .pharmacy_id - .toString() - .toUpperCase()); - } - }, - ), - ); - }, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 1,//.size.width * .33, - childAspectRatio: MediaQuery.of(context).size.width / - (MediaQuery.of(context).size.height /7)), - ), - ElevatedButton( - style: ElevatedButton.styleFrom( - primary: primaryColor, // background - onPrimary: Colors.white, // foreground - ), - onPressed: () async { - if(Url!=''&&pharmaciesCheckboxes.isNotEmpty){ - AppSettings.preLoaderDialog(context); + }, + ),) - var payload = new Map(); + ], - payload["picture"] = Url.toString(); - payload["pharmacies"] = pharmaciesCheckboxes; - bool status = await AppSettings.uploadPrescription(payload); - try { - if (status) { - Navigator.of(context, rootNavigator: true).pop(); - Url=''; - pharmaciesCheckboxes = []; - AppSettings.longSuccessToast( - "Prescription uploaded Successfully"); - // Navigator.pop(context); - getAllPharmaciesData(dropdownArea); - /* - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ConnectionsView()), - );*/ - } else { - Navigator.of(context, rootNavigator: true).pop(); - AppSettings.longFailedToast( - "Failed to upload prescription"); - } - } catch (exception) { - AppSettings.longFailedToast("Failed to upload prescription"); - print(exception); - } + ), + TextButton( + child: const Text( + 'Order Medicines', + style: TextStyle(color: primaryColor), + ), + onPressed: () { - } - else{ - AppSettings.longFailedToast('Please select image and pharmacies' ); - } - }, - child: const Text('Upload'), - ) - ], - ); - } else { - return Center( + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new OrderMedicines(prescriptionDetails:prescriptionsList[index]))); + //signup screen + }, + ) + ], + ), + ), + ); + }) ), + Padding( + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + child: CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + iconSize: 40, + icon: const Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async{ + /*await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddPrescription()), + );*/ + Navigator.push(context, MaterialPageRoute(builder: (context) => AddPrescription())).then((value) { + getAllPrescriptions(); + }); + //showBoreAddingDialog(); + }, + ), + /* Padding( + padding: EdgeInsets.fromLTRB(5, 0, 5, 5), + child: Text( + 'Add Tanks ', + style: TextStyle(color: Colors.white), + ), + )*/ + ], + ), + ), + ), + ]); + } + else{ + return Center( child: Padding( padding: EdgeInsets.fromLTRB(0, 40, 0, 0), - child: isSereverIssue - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image( - image: AssetImage('images/serverissue.png'), - // height: MediaQuery.of(context).size.height * .10, - ), - SizedBox( - height: 20, - ), - Text( - 'There is an issue at server please try after some time', - style: serverIssueTextStyle(), - ), - ], - ) - : userAddress == '' - ? Column( - mainAxisAlignment: MainAxisAlignment.center, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ - /*Image( - image: AssetImage('images/resourceblue.pngs'), - // height: MediaQuery.of(context).size.height * .10, - ),*/ - Icon( - Icons.location_on_outlined, - color: primaryColor, - size: 40, - ), + SizedBox(height: MediaQuery.of(context).size.height * .25,), + Text('Click below icon to add new prescription'), SizedBox( height: 20, ), - Text( - 'Please select location to see near by pharmacies', - style: TextStyle( - color: primaryColor, - fontWeight: FontWeight.bold, + CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: IconButton( + iconSize: 40, + icon: const Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async { + Navigator.push(context, MaterialPageRoute(builder: (context) => AddPrescription())).then((value) { + getAllPrescriptions(); + }); + }, ), - ), - ], - ) - : Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image( - image: AssetImage('images/no_data.png'), - // height: MediaQuery.of(context).size.height * .10, - ), - SizedBox( - height: 20, - ), - Text( - 'No Pharmacies', - style: serverIssueTextStyle(), - ), + ) ], ), - )); - }} + ) + ); + } + } /**/ @@ -662,32 +667,12 @@ class _PrescriptionsState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppSettings.appBar('Prescriptions'), - body: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: ElevatedButton( - style: ElevatedButton.styleFrom( - primary: primaryColor, // background - onPrimary: Colors.white, // foreground - ), - onPressed: () async { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const AddPrescription()), - ); - }, - child: const Text('Add'), - ), - ), - _allPrescriptions(), - - ], - )), + body: isPrescriptionsDataLoading?Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ): _allPrescriptions(), ); } }