update location completed

dev
Sneha 1 year ago
parent 51452337d1
commit 2bcacdcb92

@ -8,6 +8,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>

@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
task clean(type: Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

@ -32,9 +32,15 @@ class _AddReportsState extends State<AddReports> {
List uiReportsImages = []; List uiReportsImages = [];
List uiPrescriptionImages = []; List uiPrescriptionImages = [];
Map<String,dynamic> findings={};
List<Asset> images = <Asset>[]; List<Asset> images = <Asset>[];
String _error = 'No Error Dectected'; String _error = 'No Error Dectected';
String apiMultiImages = ''; String apiMultiImages = '';
String findingPictureId = '';
String reportsPictureId = '';
String prescriptionPictureId = '';
Map<String,dynamic> reports={};
Map<String,dynamic> prescriptions={};
String? prescriptionFor; String? prescriptionFor;
String? gender; String? gender;
@ -50,7 +56,10 @@ class _AddReportsState extends State<AddReports> {
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiFindingsImages = jsonDecode(res)['findings']; uiFindingsImages = jsonDecode(res)['findingsPictureUpload']['findings'];
findings=jsonDecode(res)['findingsPictureUpload'];
findingPictureId=jsonDecode(res)['findingsPictureUpload']['findingsPictureId'];
}); });
} }
@ -64,12 +73,53 @@ class _AddReportsState extends State<AddReports> {
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiFindingsImages = jsonDecode(res)['findings']; uiFindingsImages = jsonDecode(res)['findingsPictureUpload']['findings'];
findings=jsonDecode(res)['findingsPictureUpload'];
findingPictureId=jsonDecode(res)['findingsPictureUpload']['findingsPictureId'];
});
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
Future pickImageFromGalleryForAddFindings() async {
imageFileList = [];
final List<XFile>? selectedImages = await imagePicker.pickMultiImage();
AppSettings.preLoaderDialog(context);
if (selectedImages!.isNotEmpty) {
imageFileList.addAll(selectedImages);
}
var res = await AppSettings.addFindingsGallery(imageFileList,findingPictureId);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
uiFindingsImages = jsonDecode(res)['findingsPictureUpload']['findings'];
findings=jsonDecode(res)['findingsPictureUpload'];
findingPictureId=jsonDecode(res)['findingsPictureUpload']['findingsPictureId'];
});
}
Future takeImageFromCameraForAddFindings() async {
try {
final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.addFindingsCamera(image,findingPictureId);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
uiFindingsImages = jsonDecode(res)['findingsPictureUpload']['findings'];
findings=jsonDecode(res)['findingsPictureUpload'];
findingPictureId=jsonDecode(res)['findingsPictureUpload']['findingsPictureId'];
}); });
} on PlatformException catch (e) { } on PlatformException catch (e) {
print('Failed to pick image: $e'); print('Failed to pick image: $e');
} }
} }
/*Future pickImageFromGalleryForUpdate() async { /*Future pickImageFromGalleryForUpdate() async {
imageFileList = []; imageFileList = [];
final List<XFile>? selectedImages = await imagePicker.pickMultiImage(); final List<XFile>? selectedImages = await imagePicker.pickMultiImage();
@ -109,11 +159,13 @@ class _AddReportsState extends State<AddReports> {
if (image == null) return; if (image == null) return;
final imageTemp = File(image.path); final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var res = await AppSettings.uploadImageForFindingsCamera(image); var res = await AppSettings.uploadReportsCamera(image);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiReportsImages = jsonDecode(res)['findings']; uiReportsImages = jsonDecode(res)['reportsPictureUpload']['reports'];
reports=jsonDecode(res)['reportsPictureUpload'];
reportsPictureId=jsonDecode(res)['reportsPictureUpload']['reportsPictureId'];
}); });
} on PlatformException catch (e) { } on PlatformException catch (e) {
print('Failed to pick image: $e'); print('Failed to pick image: $e');
@ -128,14 +180,55 @@ class _AddReportsState extends State<AddReports> {
imageFileListReports.addAll(selectedImages); imageFileListReports.addAll(selectedImages);
} }
var res = await AppSettings.uploadImageForReports(imageFileListReports); var res = await AppSettings.uploadReportsGallery(imageFileListReports);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
uiReportsImages = jsonDecode(res)['reportsPictureUpload']['reports'];
reports=jsonDecode(res)['reportsPictureUpload'];
reportsPictureId=jsonDecode(res)['reportsPictureUpload']['reportsPictureId'];
});
}
Future takeImageFromCameraForAddReports() async {
try {
final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.addReportsCamera(image,reportsPictureId);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
uiReportsImages = jsonDecode(res)['reportsPictureUpload']['reports'];
reports=jsonDecode(res)['reportsPictureUpload'];
reportsPictureId=jsonDecode(res)['reportsPictureUpload']['reportsPictureId'];
});
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
Future pickImageFromGalleryForAddReports() async {
imageFileListReports = [];
final List<XFile>? selectedImages = await imagePicker.pickMultiImage();
AppSettings.preLoaderDialog(context);
if (selectedImages!.isNotEmpty) {
imageFileListReports.addAll(selectedImages);
}
var res = await AppSettings.addReportsGallery(imageFileListReports,reportsPictureId);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiReportsImages = jsonDecode(res)['reports']; uiReportsImages = jsonDecode(res)['reportsPictureUpload']['reports'];
reports=jsonDecode(res)['reportsPictureUpload'];
reportsPictureId=jsonDecode(res)['reportsPictureUpload']['reportsPictureId'];
}); });
} }
Future takeImageFromCameraForPrescriptions() async { Future takeImageFromCameraForPrescriptions() async {
try { try {
final image = await _picker.pickImage(source: ImageSource.camera); final image = await _picker.pickImage(source: ImageSource.camera);
@ -146,7 +239,11 @@ class _AddReportsState extends State<AddReports> {
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiPrescriptionImages = jsonDecode(res)['precription'];
uiPrescriptionImages = jsonDecode(res)['prescriptionsPictureUpload']['precription'];
prescriptions=jsonDecode(res)['prescriptionsPictureUpload'];
prescriptionPictureId=jsonDecode(res)['prescriptionsPictureUpload']['prescriptionPictureId'];
}); });
} on PlatformException catch (e) { } on PlatformException catch (e) {
print('Failed to pick image: $e'); print('Failed to pick image: $e');
@ -166,13 +263,91 @@ class _AddReportsState extends State<AddReports> {
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiPrescriptionImages = jsonDecode(res)['prescription']; uiPrescriptionImages = jsonDecode(res)['prescriptionsPictureUpload']['precription'];
prescriptions=jsonDecode(res)['prescriptionsPictureUpload'];
prescriptionPictureId=jsonDecode(res)['prescriptionsPictureUpload']['prescriptionPictureId']??'';
});
}
Future takeImageFromCameraForAddPrescriptions() async {
try {
final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.addPrescriptionsCamera(image,prescriptionPictureId);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
uiPrescriptionImages = jsonDecode(res)['prescriptionsPictureUpload']['precription'];
prescriptions=jsonDecode(res)['prescriptionsPictureUpload'];
prescriptionPictureId=jsonDecode(res)['prescriptionsPictureUpload']['prescriptionPictureId'];
});
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
Future pickImageFromGalleryForAddPrescriptions() async {
imageFileListPrescriptions = [];
final List<XFile>? selectedImages = await imagePicker.pickMultiImage();
AppSettings.preLoaderDialog(context);
if (selectedImages!.isNotEmpty) {
imageFileListPrescriptions.addAll(selectedImages);
}
var res = await AppSettings.addPrescriptionsGallery(imageFileListPrescriptions,prescriptionPictureId);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
uiPrescriptionImages = jsonDecode(res)['prescriptionsPictureUpload']['precription'];
prescriptions=jsonDecode(res)['prescriptionsPictureUpload'];
prescriptionPictureId=jsonDecode(res)['prescriptionsPictureUpload']['prescriptionPictureId'];
}); });
} }
Future<bool> onWillPop() async {
final shouldPop = await showDialog<bool>(context: context, builder: (context) {
return AlertDialog(
title: const Text('Do you want to leave this page',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(false);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
);
},
);
return shouldPop!;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return WillPopScope(
onWillPop: () async => onWillPop(),
child: Scaffold(
appBar: AppSettings.appBar('Reports'), appBar: AppSettings.appBar('Reports'),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
@ -372,6 +547,7 @@ class _AddReportsState extends State<AddReports> {
], ],
), ),
), ),
/*findings*/
Visibility( Visibility(
visible: uiFindingsImages.length == 0, visible: uiFindingsImages.length == 0,
child: ElevatedButton( child: ElevatedButton(
@ -473,12 +649,18 @@ class _AddReportsState extends State<AddReports> {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
String fileName = uiFindingsImages[index]['url'].split('/').last; String fileName = uiFindingsImages[index]['url'].split('/').last;
var response = await AppSettings.deleteFindings(fileName); try{
var response = await AppSettings.deleteFindings(fileName,findingPictureId);
print(jsonDecode(response)); print(jsonDecode(response));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiFindingsImages = jsonDecode(response)['findings']; uiFindingsImages = jsonDecode(response)['findingsPictureUpload']['findings'];
}); });
}
catch(e){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast('Image deletion failed');
}
}, },
), ),
@ -503,8 +685,8 @@ class _AddReportsState extends State<AddReports> {
visible: uiFindingsImages.length != 0, visible: uiFindingsImages.length != 0,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: Colors.red, // background primary: buttonColors, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.black, // foreground
), ),
onPressed: () async { onPressed: () async {
showModalBottomSheet<void>( showModalBottomSheet<void>(
@ -523,7 +705,7 @@ class _AddReportsState extends State<AddReports> {
color: primaryColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await takeImageFromCamera(); await takeImageFromCameraForAddFindings();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -539,7 +721,7 @@ class _AddReportsState extends State<AddReports> {
color: primaryColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await pickImageFromGallery(); await pickImageFromGalleryForAddFindings();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -552,6 +734,8 @@ class _AddReportsState extends State<AddReports> {
child: const Text('Add Findings'), child: const Text('Add Findings'),
), ),
), ),
/*reports*/
Visibility( Visibility(
visible: uiReportsImages.length == 0, visible: uiReportsImages.length == 0,
child: ElevatedButton( child: ElevatedButton(
@ -653,11 +837,11 @@ class _AddReportsState extends State<AddReports> {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
String fileName = uiReportsImages[index]['url'].split('/').last; String fileName = uiReportsImages[index]['url'].split('/').last;
var response = await AppSettings.deleteReports(fileName); var response = await AppSettings.deleteReports(fileName,reportsPictureId);
print(jsonDecode(response)); print(jsonDecode(response));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiReportsImages = jsonDecode(response)['reports']; uiReportsImages = jsonDecode(response)['reportsPictureUpload']['reports'];
}); });
}, },
@ -683,8 +867,8 @@ class _AddReportsState extends State<AddReports> {
visible: uiReportsImages.length != 0, visible: uiReportsImages.length != 0,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: Colors.red, // background primary: buttonColors, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.black, // foreground
), ),
onPressed: () async { onPressed: () async {
showModalBottomSheet<void>( showModalBottomSheet<void>(
@ -703,7 +887,7 @@ class _AddReportsState extends State<AddReports> {
color: primaryColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await takeImageFromCameraForReports(); await takeImageFromCameraForAddReports();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -719,7 +903,7 @@ class _AddReportsState extends State<AddReports> {
color: primaryColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await pickImageFromGalleryForReports(); await pickImageFromGalleryForAddReports();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -732,6 +916,8 @@ class _AddReportsState extends State<AddReports> {
child: const Text('Add Reports'), child: const Text('Add Reports'),
), ),
), ),
/*prescriptions*/
Visibility( Visibility(
visible: uiPrescriptionImages.length == 0, visible: uiPrescriptionImages.length == 0,
child: ElevatedButton( child: ElevatedButton(
@ -833,11 +1019,11 @@ class _AddReportsState extends State<AddReports> {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
String fileName = uiPrescriptionImages[index]['url'].split('/').last; String fileName = uiPrescriptionImages[index]['url'].split('/').last;
var response = await AppSettings.deletePrescriptions(fileName); var response = await AppSettings.deletePrescriptions(fileName,prescriptionPictureId);
print(jsonDecode(response)); print(jsonDecode(response));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
uiPrescriptionImages = jsonDecode(response)['precription']; uiPrescriptionImages = jsonDecode(response)['prescriptionsPictureUpload']['precription'];
}); });
}, },
@ -863,8 +1049,8 @@ class _AddReportsState extends State<AddReports> {
visible: uiPrescriptionImages.length != 0, visible: uiPrescriptionImages.length != 0,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: Colors.red, // background primary: buttonColors, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.black, // foreground
), ),
onPressed: () async { onPressed: () async {
showModalBottomSheet<void>( showModalBottomSheet<void>(
@ -883,7 +1069,7 @@ class _AddReportsState extends State<AddReports> {
color: primaryColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await takeImageFromCameraForPrescriptions(); await takeImageFromCameraForAddPrescriptions();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -899,7 +1085,7 @@ class _AddReportsState extends State<AddReports> {
color: primaryColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await pickImageFromGalleryForPrescriptions(); await pickImageFromGalleryForAddPrescriptions();
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -1010,6 +1196,10 @@ class _AddReportsState extends State<AddReports> {
), ),
), ),
), ),
)); ))
);
} }
} }

File diff suppressed because it is too large Load Diff

@ -2,13 +2,16 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_user/Reports/add_reports.dart'; import 'package:healthcare_user/Reports/add_reports.dart';
import 'package:healthcare_user/Reports/all_records_tab.dart';
import 'package:healthcare_user/Reports/finding_images.dart'; import 'package:healthcare_user/Reports/finding_images.dart';
import 'package:healthcare_user/Reports/prescription_images.dart'; import 'package:healthcare_user/Reports/prescription_images.dart';
import 'package:healthcare_user/Reports/report_images.dart'; import 'package:healthcare_user/Reports/report_images.dart';
import 'package:healthcare_user/Reports/update_report.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/common/zoom_image.dart'; import 'package:healthcare_user/common/zoom_image.dart';
import 'package:healthcare_user/models/reports_model.dart'; import 'package:healthcare_user/models/reports_model.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
import 'package:intl/intl.dart';
class AllReports extends StatefulWidget { class AllReports extends StatefulWidget {
const AllReports({Key? key}) : super(key: key); const AllReports({Key? key}) : super(key: key);
@ -25,6 +28,7 @@ class _AllReportsState extends State<AllReports> {
bool isReportsDataLoading = false; bool isReportsDataLoading = false;
bool isSereverIssue = false; bool isSereverIssue = false;
TextEditingController searchController = TextEditingController(); TextEditingController searchController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String dropdownSearchType = 'Problem'; String dropdownSearchType = 'Problem';
var typeOfSearchItems = [ var typeOfSearchItems = [
'Problem', 'Problem',
@ -104,6 +108,31 @@ class _AllReportsState extends State<AllReports> {
} }
} }
Future<void> getRecordsByDate(var date) async {
isReportsDataLoading=true;
try {
var response = await AppSettings.getAllRecords();
setState(() {
reportsListOriginal = ((jsonDecode(response)) as List)
.map((dynamic model) {
return ReportsModel.fromJson(model);
}).toList();
reportsList=reportsListOriginal.reversed.toList();
reportsList= reportsListOriginal.where(
(x) => x.date.toString().toLowerCase().contains(date.toString().toLowerCase())
).toList();
isReportsDataLoading = false;
});
} catch (e) {
setState(() {
isReportsDataLoading = false;
isSereverIssue = true;
});
}
}
@override @override
void initState() { void initState() {
getAllRecords(); getAllRecords();
@ -308,7 +337,17 @@ class _AllReportsState extends State<AllReports> {
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
itemCount: reportsList.length, itemCount: reportsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Card( return GestureDetector(
onTap: (){
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new AllReportsTab(recordDetails:reportsList[index],initialIndex: 0,))).then((value) {
getAllRecords();
});
},
child: Card(
//color: prescriptionsList[index].cardColor, //color: prescriptionsList[index].cardColor,
child: Padding( child: Padding(
@ -331,6 +370,7 @@ class _AllReportsState extends State<AllReports> {
Text(reportsList[index].doctorName.toString().toUpperCase(),style: valuesTextStyle()), Text(reportsList[index].doctorName.toString().toUpperCase(),style: valuesTextStyle()),
Text(reportsList[index].hospitalName.toString().toUpperCase(),style: valuesTextStyle()), Text(reportsList[index].hospitalName.toString().toUpperCase(),style: valuesTextStyle()),
Text(reportsList[index].date.toString().toUpperCase(),style: valuesTextStyle()), Text(reportsList[index].date.toString().toUpperCase(),style: valuesTextStyle()),
Text('Patient details: ',style: problemTextStyle()),
Text(reportsList[index].patient_name.toString().toUpperCase(),style: valuesTextStyle()), Text(reportsList[index].patient_name.toString().toUpperCase(),style: valuesTextStyle()),
Row( Row(
children: [ children: [
@ -352,7 +392,12 @@ class _AllReportsState extends State<AllReports> {
icon: const Icon(Icons.edit,color: primaryColor,), icon: const Icon(Icons.edit,color: primaryColor,),
onPressed: () { onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new UpdateReport(reportDetails:reportsList[index]))).then((value) {
getAllRecords();
});
}, },
),), ),),
Expanded(child:IconButton( Expanded(child:IconButton(
@ -425,14 +470,20 @@ class _AllReportsState extends State<AllReports> {
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async { onPressed: () async {
Navigator.push( /*Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new FindingImages(imageDetails:reportsList[index].findingsImages,recordId: reportsList[index].recordId,))).then((value) { builder: (__) => new FindingImages(imageDetails:reportsList[index].findingsImages,recordId: reportsList[index].recordId,))).then((value) {
getAllRecords(); getAllRecords();
});*/
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new AllReportsTab(recordDetails:reportsList[index],initialIndex: 0,))).then((value) {
getAllRecords();
}); });
}, },
child: Text('Findings: '+reportsList[index].findingsImages.length.toString()), child: Text('Findings: '+reportsList[index].findingsImages.length.toString(),style:textButtonStyleReports(),),
), ),
SizedBox( SizedBox(
width:MediaQuery.of(context).size.width * .05, width:MediaQuery.of(context).size.width * .05,
@ -443,15 +494,21 @@ class _AllReportsState extends State<AllReports> {
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async { onPressed: () async {
Navigator.push( /*Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new ReportImages(imageDetails:reportsList[index].reportImages,recordId:reportsList[index].recordId ,))).then((value) { builder: (__) => new ReportImages(imageDetails:reportsList[index].reportImages,recordId:reportsList[index].recordId ,))).then((value) {
getAllRecords(); getAllRecords();
});*/
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new AllReportsTab(recordDetails:reportsList[index],initialIndex: 1,))).then((value) {
getAllRecords();
}); });
}, },
child: Text('Reports: '+reportsList[index].reportImages.length.toString()), child: Text('Reports: '+reportsList[index].reportImages.length.toString(),style:textButtonStyleReports()),
), ),
SizedBox( SizedBox(
width:MediaQuery.of(context).size.width * .05, width:MediaQuery.of(context).size.width * .05,
@ -462,15 +519,22 @@ class _AllReportsState extends State<AllReports> {
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async { onPressed: () async {
/*Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new PrescriptionImages(imageDetails:reportsList[index].prescriptionImages,recordId: reportsList[index].recordId,familyDetails:reportsList[index],details:reportsList[index] ,))).then((value) {
getAllRecords();
});*/
Navigator.push( Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new PrescriptionImages(imageDetails:reportsList[index].prescriptionImages,recordId: reportsList[index].recordId,familyDetails:reportsList[index]))).then((value) { builder: (__) => new AllReportsTab(recordDetails:reportsList[index],initialIndex: 2,))).then((value) {
getAllRecords(); getAllRecords();
}); });
}, },
child: Text('Prescriptions: '+reportsList[index].prescriptionImages.length.toString()), child: Text('Prescriptions: '+reportsList[index].prescriptionImages.length.toString(),style:textButtonStyleReports()),
), ),
], ],
), ),
@ -498,6 +562,7 @@ class _AllReportsState extends State<AllReports> {
], ],
), ),
), ),
),
); );
}); });
} }
@ -602,7 +667,7 @@ class _AllReportsState extends State<AllReports> {
Icons.clear, Icons.clear,
color: greyColor, color: greyColor,
),*/ ),*/
suffixIcon: IconButton( suffixIcon: searchController.text!=''?IconButton(
icon: Icon( icon: Icon(
Icons.clear, Icons.clear,
color: Colors.red, color: Colors.red,
@ -613,6 +678,13 @@ class _AllReportsState extends State<AllReports> {
}); });
getAllRecords(); getAllRecords();
}, },
):IconButton(
icon: Icon(
Icons.clear,
color: Colors.transparent,
),
onPressed: () {
},
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
@ -660,7 +732,7 @@ class _AllReportsState extends State<AllReports> {
Icons.clear, Icons.clear,
color: greyColor, color: greyColor,
),*/ ),*/
suffixIcon: IconButton( suffixIcon: searchController.text!=''?IconButton(
icon: Icon( icon: Icon(
Icons.clear, Icons.clear,
color: Colors.red, color: Colors.red,
@ -671,6 +743,13 @@ class _AllReportsState extends State<AllReports> {
}); });
getAllRecords(); getAllRecords();
}, },
):IconButton(
icon: Icon(
Icons.clear,
color: Colors.transparent,
),
onPressed: () {
},
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
@ -692,6 +771,106 @@ class _AllReportsState extends State<AllReports> {
), ),
),) ),)
),), ),),
Visibility(
visible:dropdownSearchType.toString().toLowerCase()=='date' ,
child: Container(
height: MediaQuery.of(context).size.height * .07,
padding: EdgeInsets.all(5),
child: Center(child: TextField(
cursorColor: primaryColor,
controller: searchController,
onChanged: (string) {
if(string.length>=1){
getRecordsByDate(string);
}
else{
getAllRecords();
}
},
onTap: () async {
DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1950),
lastDate: DateTime.now(),
builder: (BuildContext context, Widget? child) {
return Theme(
data: ThemeData.dark().copyWith(
colorScheme: ColorScheme.dark(
primary: buttonColors,
onPrimary: Colors.white,
surface: buttonColors,
onSurface: Colors.white,
),
dialogBackgroundColor: primaryColor,
),
child: child!,
);
},
);
if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() {
searchController.text = formattedDate; //set output date to TextField value.
});
getRecordsByDate(searchController.text);
} else {}
},
decoration: InputDecoration(
prefixIcon: Icon(
Icons.search,
color: primaryColor,
),
suffixIcon: searchController.text!=''?IconButton(
icon: Icon(
Icons.clear,
color: Colors.red,
),
onPressed: () {
setState(() {
searchController.text='';
});
getAllRecords();
},
):IconButton(
icon: Icon(
Icons.clear,
color: Colors.transparent,
),
onPressed: () {
},
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
//labelText: 'Search by phone number',
hintText: 'Search by date',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),)
),
),
Expanded(child: _filtereddata()), Expanded(child: _filtereddata()),
Padding( Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 8), padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
@ -775,7 +954,7 @@ class _AllReportsState extends State<AllReports> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppSettings.appBar('Reports'), appBar: AppSettings.appBar('Records'),
body: isReportsDataLoading?Center( body: isReportsDataLoading?Center(
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: primaryColor, color: primaryColor,

@ -15,13 +15,11 @@ class FindingImages extends StatefulWidget {
FindingImages({this.imageDetails, this.recordId}); FindingImages({this.imageDetails, this.recordId});
@override @override
State<FindingImages> createState() => _FindingImagesState(); State<FindingImages> createState() => _FindingImagesState();
} }
class _FindingImagesState extends State<FindingImages> { class _FindingImagesState extends State<FindingImages> {
final ImagePicker imagePicker = ImagePicker(); final ImagePicker imagePicker = ImagePicker();
List imageFileList = []; List imageFileList = [];
List uiFindingsImages = []; List uiFindingsImages = [];
@ -68,7 +66,8 @@ class _FindingImagesState extends State<FindingImages> {
imageFileList.addAll(selectedImages); imageFileList.addAll(selectedImages);
} }
var res = await AppSettings.updateFindingsGallery(imageFileList,widget.recordId); var res =
await AppSettings.updateFindingsGallery(imageFileList, widget.recordId);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
@ -93,14 +92,13 @@ class _FindingImagesState extends State<FindingImages> {
} }
} }
Widget renderUi() { Widget renderUi() {
if (widget.imageDetails.length != 0) { if (widget.imageDetails.length != 0) {
return GridView.builder( return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: GridView.builder(
itemCount: widget.imageDetails.length, itemCount: widget.imageDetails.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
@ -110,11 +108,13 @@ class _FindingImagesState extends State<FindingImages> {
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new ImageZoomPage(imageName:'Findings',imageDetails:widget.imageDetails[index]['url']))); builder: (__) => new ImageZoomPage(
imageName: 'Findings',
imageDetails: widget.imageDetails[index]
['url'])));
/*gridOntap(index);*/ /*gridOntap(index);*/
}, },
child: Container( child: Container(
@ -123,76 +123,115 @@ class _FindingImagesState extends State<FindingImages> {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(widget.imageDetails[index]['url'])
widget.imageDetails[index]['url'])
as ImageProvider, // picked file as ImageProvider, // picked file
fit: BoxFit.fill)), fit: BoxFit.fill)),
child: Stack( child: Stack(children: [
children: [
Positioned( Positioned(
right: 0, right: 0,
child: Container( child: Container(
child: IconButton( child: IconButton(
iconSize: 30, iconSize: 30,
icon: const Icon( icon: const Icon(
Icons.cancel, Icons.delete,
color: Colors.red, color: Colors.red,
), ),
onPressed: () async { onPressed: () async {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) => AlertDialog(
title:
const Text('Do you want to delete image?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment:
MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: () async {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
String fileName = widget.imageDetails[index]['url'].split('/').last; String fileName = widget
.imageDetails[index]['url']
.split('/')
.last;
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["urlType"] = 'findings'; payload["urlType"] = 'findings';
payload["url"] = widget.imageDetails[index]['url']; payload["url"] =
widget.imageDetails[index]['url'];
// bool deleteStatus = await AppSettings.deleteRecordsNew(payload,widget.recordId); // bool deleteStatus = await AppSettings.deleteRecordsNew(payload,widget.recordId);
try { try {
var res = await AppSettings.deleteRecordsNew(payload,widget.recordId); var res =
await AppSettings.deleteRecordsNew(
payload, widget.recordId);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context,
AppSettings.longSuccessToast("Image deleted Successfully"); rootNavigator: true)
.pop();
Navigator.of(context).pop(true);
AppSettings.longSuccessToast(
"Image deleted Successfully");
setState(() { setState(() {
widget.imageDetails = jsonDecode(res)['remainingUrls']; widget.imageDetails =
jsonDecode(res)['remainingUrls'];
}); });
} } catch (e) {
catch(e){
print(e); print(e);
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context,
AppSettings.longFailedToast("Image deletion failed"); rootNavigator: true)
.pop();
Navigator.of(context).pop(true);
AppSettings.longFailedToast(
"Image deletion failed");
} }
}, },
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
),
);
},
), ),
/* color: Colors.pinkAccent, /* color: Colors.pinkAccent,
width: 35, width: 35,
height: 35,*/ height: 35,*/
), ),
)]), )
]),
), ),
//Image.network(widget.imageDetails[index]['url']), //Image.network(widget.imageDetails[index]['url']),
); );
}, },
); )),
} Padding(
else{ padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
return Center( child: CircleAvatar(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('Click below icon to add new findings'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor, backgroundColor: primaryColor,
radius: 40, radius: 40,
child: IconButton( child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
iconSize: 40, iconSize: 40,
icon: const Icon( icon: const Icon(
Icons.add, Icons.add,
@ -220,8 +259,7 @@ class _FindingImagesState extends State<FindingImages> {
}, },
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width * .20,
.20,
), ),
GestureDetector( GestureDetector(
child: Icon( child: Icon(
@ -241,30 +279,33 @@ class _FindingImagesState extends State<FindingImages> {
}); });
}, },
), ),
)
], ],
), ),
) ),
),
],
); );
} } else {
return Center(
} child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
@override children: [
Widget build(BuildContext context) { SizedBox(
return Scaffold( height: MediaQuery.of(context).size.height * .25,
appBar: AppBar( ),
Text('Click below icon to add new findings'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text("Finding Images"), radius: 40,
actions: [
Visibility(
visible: widget.imageDetails.length>0,
child: IconButton( child: IconButton(
iconSize: 30, iconSize: 40,
icon: Icon( icon: const Icon(
Icons.add_task, Icons.add,
color: Colors.white, color: Colors.white,
), ),
onPressed: () async { onPressed: () async {
@ -289,8 +330,8 @@ class _FindingImagesState extends State<FindingImages> {
}, },
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * width:
.20, MediaQuery.of(context).size.width * .20,
), ),
GestureDetector( GestureDetector(
child: Icon( child: Icon(
@ -308,16 +349,20 @@ class _FindingImagesState extends State<FindingImages> {
), ),
); );
}); });
}, },
),) ),
)
], ],
), ),
body:Container( ));
padding: EdgeInsets.all(12.0), }
child: renderUi()), }
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Findings'),
body: Container(padding: EdgeInsets.all(12.0), child: renderUi()),
); );
} }
} }

@ -4,7 +4,7 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:healthcare_user/Reports/allreports.dart'; import 'package:healthcare_user/Reports/allreports.dart';
import 'package:healthcare_user/Reports/order_medicines_new.dart'; import 'package:healthcare_user/trash/order_medicines_new.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/common/zoom_image.dart'; import 'package:healthcare_user/common/zoom_image.dart';
import 'package:healthcare_user/prescriptions/oreder_medicines.dart'; import 'package:healthcare_user/prescriptions/oreder_medicines.dart';
@ -15,8 +15,9 @@ class PrescriptionImages extends StatefulWidget {
var imageDetails; var imageDetails;
var recordId; var recordId;
var familyDetails; var familyDetails;
var details;
PrescriptionImages({this.imageDetails, this.recordId,this.familyDetails}); PrescriptionImages({this.imageDetails, this.recordId,this.familyDetails,this.details});
@override @override
State<PrescriptionImages> createState() => _PrescriptionImagesState(); State<PrescriptionImages> createState() => _PrescriptionImagesState();
@ -98,6 +99,7 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
Widget renderUi() { Widget renderUi() {
if (widget.imageDetails.length != 0) { if (widget.imageDetails.length != 0) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: GridView.builder( child: GridView.builder(
@ -136,9 +138,24 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
child: IconButton( child: IconButton(
iconSize: 30, iconSize: 30,
icon: const Icon( icon: const Icon(
Icons.cancel, Icons.delete,
color: Colors.red, color: Colors.red,
), ),
onPressed: () async {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) => AlertDialog(
title:
const Text('Do you want to delete image?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment:
MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: () async { onPressed: () async {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
@ -155,6 +172,7 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
var res = await AppSettings.deleteRecordsNew(payload,widget.recordId); var res = await AppSettings.deleteRecordsNew(payload,widget.recordId);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop(true);
AppSettings.longSuccessToast("Image deleted Successfully"); AppSettings.longSuccessToast("Image deleted Successfully");
setState(() { setState(() {
widget.imageDetails = jsonDecode(res)['remainingUrls']; widget.imageDetails = jsonDecode(res)['remainingUrls'];
@ -163,9 +181,30 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
catch(e){ catch(e){
print(e); print(e);
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop(true);
AppSettings.longFailedToast("Image deletion failed"); AppSettings.longFailedToast("Image deletion failed");
} }
}, },
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
),
);
},
), ),
), ),
) )
@ -177,41 +216,42 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
}, },
), ),
), ),
TextButton( Padding(
child: const Text( padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
'Order Medicines', child: CircleAvatar(
style: TextStyle(color: primaryColor), backgroundColor: primaryColor,
radius: 40,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
iconSize: 40,
icon: const Icon(
Icons.shopping_cart,
color: Colors.white,
), ),
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new OrderMedicinesPrescriptions(prescriptionDetails:widget.imageDetails,familyDetails: widget.familyDetails,))); builder: (__) => new OrderMedicines(prescriptionDetails:widget.details)));
//signup screen //signup screen
}, },
) ),
], ],
);
} else {
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: MediaQuery.of(context).size.height * .25,
), ),
Text('Click below icon to add new Prescriptions'),
SizedBox(
height: 20,
), ),
CircleAvatar( ),
Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
child: CircleAvatar(
backgroundColor: primaryColor, backgroundColor: primaryColor,
radius: 40, radius: 40,
child: IconButton( child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
iconSize: 40, iconSize: 40,
icon: const Icon( icon: const Icon(
Icons.add, Icons.add,
@ -239,8 +279,8 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
}, },
), ),
SizedBox( SizedBox(
width: width: MediaQuery.of(context).size.width *
MediaQuery.of(context).size.width * .20, .20,
), ),
GestureDetector( GestureDetector(
child: Icon( child: Icon(
@ -258,28 +298,38 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
), ),
); );
}); });
}, },
), ),
)
], ],
), ),
)); ),
} ),
} ],
);
@override } else {
Widget build(BuildContext context) { return Center(
return Scaffold( child: Padding(
appBar: AppBar( padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: MediaQuery.of(context).size.height * .25,
),
Text('Click below icon to add new Prescriptions'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text("Prescriptions"), radius: 40,
actions: [
Visibility(
visible: widget.imageDetails.length > 0,
child: IconButton( child: IconButton(
iconSize: 30, iconSize: 40,
icon: Icon( icon: const Icon(
Icons.add_task, Icons.add,
color: Colors.white, color: Colors.white,
), ),
onPressed: () async { onPressed: () async {
@ -304,8 +354,8 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
}, },
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * width:
.20, MediaQuery.of(context).size.width * .20,
), ),
GestureDetector( GestureDetector(
child: Icon( child: Icon(
@ -323,14 +373,19 @@ class _PrescriptionImagesState extends State<PrescriptionImages> {
), ),
); );
}); });
}, },
), ),
) )
], ],
), ),
));
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppSettings.appBar('Prescriptions'),
body: Container(padding: EdgeInsets.all(12.0), child: renderUi()), body: Container(padding: EdgeInsets.all(12.0), child: renderUi()),
); );
} }

@ -93,7 +93,10 @@ class _ReportImagesState extends State<ReportImages> {
Widget renderUi() { Widget renderUi() {
if(widget.imageDetails.length!=0){ if(widget.imageDetails.length!=0){
return GridView.builder( return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child: GridView.builder(
itemCount: widget.imageDetails.length, itemCount: widget.imageDetails.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3, crossAxisCount: 3,
@ -127,11 +130,26 @@ class _ReportImagesState extends State<ReportImages> {
child: IconButton( child: IconButton(
iconSize: 30, iconSize: 30,
icon: const Icon( icon: const Icon(
Icons.cancel, Icons.delete,
color: Colors.red, color: Colors.red,
), ),
onPressed: () async {
onPressed: () async {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) => AlertDialog(
title:
const Text('Do you want to delete image?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment:
MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: () async {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
String fileName = widget.imageDetails[index]['url'].split('/').last; String fileName = widget.imageDetails[index]['url'].split('/').last;
@ -144,6 +162,7 @@ class _ReportImagesState extends State<ReportImages> {
var res = await AppSettings.deleteRecordsNew(payload,widget.recordId); var res = await AppSettings.deleteRecordsNew(payload,widget.recordId);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop(true);
AppSettings.longSuccessToast("Image deleted Successfully"); AppSettings.longSuccessToast("Image deleted Successfully");
setState(() { setState(() {
widget.imageDetails = jsonDecode(res)['remainingUrls']; widget.imageDetails = jsonDecode(res)['remainingUrls'];
@ -152,9 +171,30 @@ class _ReportImagesState extends State<ReportImages> {
catch(e){ catch(e){
print(e); print(e);
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
Navigator.of(context).pop(true);
AppSettings.longFailedToast("Image deletion failed"); AppSettings.longFailedToast("Image deletion failed");
} }
}, },
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
),
);
},
), ),
/* color: Colors.pinkAccent, /* color: Colors.pinkAccent,
width: 35, width: 35,
@ -167,24 +207,16 @@ class _ReportImagesState extends State<ReportImages> {
//Image.network(widget.imageDetails[index]['url']), //Image.network(widget.imageDetails[index]['url']),
); );
}, },
); )),
} Padding(
else{ padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
return Center( child: CircleAvatar(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('Click below icon to add new Report'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor, backgroundColor: primaryColor,
radius: 40, radius: 40,
child: IconButton( child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
iconSize: 40, iconSize: 40,
icon: const Icon( icon: const Icon(
Icons.add, Icons.add,
@ -231,30 +263,37 @@ class _ReportImagesState extends State<ReportImages> {
), ),
); );
}); });
}, },
), ),
)
], ],
), ),
) ),
),
],
); );
} }
else{
} return Center(
child: Padding(
@override padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
Widget build(BuildContext context) { child: Column(
return Scaffold( crossAxisAlignment: CrossAxisAlignment.center,
appBar:AppBar( children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('Click below icon to add new Report'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text("Report Images"), radius: 40,
actions: [
Visibility(
visible: widget.imageDetails.length>0,
child: IconButton( child: IconButton(
iconSize: 30, iconSize: 40,
icon: Icon( icon: const Icon(
Icons.add_task, Icons.add,
color: Colors.white, color: Colors.white,
), ),
onPressed: () async { onPressed: () async {
@ -298,13 +337,21 @@ class _ReportImagesState extends State<ReportImages> {
), ),
); );
}); });
}, },
),) ),
)
], ],
), ),
)
);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppSettings.appBar('Repoprt Images'),
body: Container(padding: EdgeInsets.all(12.0), child: renderUi()), body: Container(padding: EdgeInsets.all(12.0), child: renderUi()),
); );
} }

File diff suppressed because it is too large Load Diff

@ -5,7 +5,7 @@ import 'package:healthcare_user/Reports/allreports.dart';
import 'package:healthcare_user/common/updateprofile.dart'; import 'package:healthcare_user/common/updateprofile.dart';
import 'package:healthcare_user/emergency.dart'; import 'package:healthcare_user/emergency.dart';
import 'package:healthcare_user/howareufeeling_today.dart'; import 'package:healthcare_user/howareufeeling_today.dart';
import 'package:healthcare_user/invitations.dart'; import 'package:healthcare_user/invitations/invitations.dart';
import 'package:healthcare_user/medicines.dart'; import 'package:healthcare_user/medicines.dart';
import 'package:healthcare_user/my_health.dart'; import 'package:healthcare_user/my_health.dart';
import 'package:healthcare_user/my_medicine_timings.dart'; import 'package:healthcare_user/my_medicine_timings.dart';
@ -14,6 +14,7 @@ import 'package:healthcare_user/report_my_self.dart';
import 'package:healthcare_user/Reports/add_reports.dart'; import 'package:healthcare_user/Reports/add_reports.dart';
import 'package:healthcare_user/seekopinion.dart'; import 'package:healthcare_user/seekopinion.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/updates/update_location.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'dart:ui' as ui; import 'dart:ui' as ui;
@ -280,7 +281,7 @@ class _DashboardState extends State<Dashboard> {
}, },
), ),
Text( Text(
'Reports', 'Records',
style: dashboardTextStyle(), style: dashboardTextStyle(),
), ),
], ],
@ -895,7 +896,13 @@ class _DashboardState extends State<Dashboard> {
style: drawerListItemsTextStyle()), style: drawerListItemsTextStyle()),
], ],
), ),
onTap: () {}, onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const UpdateMyLocation()),
);
},
), ),
Divider( Divider(
color: Colors.grey, color: Colors.grey,

@ -8,7 +8,6 @@ import 'package:http/http.dart' as http;
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'dart:async'; import 'dart:async';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
@ -35,6 +34,10 @@ TextStyle labelTextStyle() {
return TextStyle(color: primaryColor, fontSize: 12); return TextStyle(color: primaryColor, fontSize: 12);
} }
TextStyle labelTextStyleOrderMedicine() {
return TextStyle(color: primaryColor, fontSize: 12,fontWeight: FontWeight.bold);
}
TextStyle haveMotorTextStyle() { TextStyle haveMotorTextStyle() {
return TextStyle( return TextStyle(
color: Colors.red, fontSize: 12, fontWeight: FontWeight.bold); color: Colors.red, fontSize: 12, fontWeight: FontWeight.bold);
@ -44,6 +47,10 @@ TextStyle textButtonStyle() {
return TextStyle(color: primaryColor, fontSize: 15); return TextStyle(color: primaryColor, fontSize: 15);
} }
TextStyle textButtonStyleReports() {
return TextStyle(color: Colors.white, fontSize: 12);
}
TextStyle iconBelowTextStyle() { TextStyle iconBelowTextStyle() {
return TextStyle(fontSize: 10, color: primaryColor); return TextStyle(fontSize: 10, color: primaryColor);
} }
@ -55,6 +62,13 @@ TextStyle valuesTextStyle() {
); );
} }
TextStyle recordDetailsHeading() {
return TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
);
}
TextStyle problemTextStyle() { TextStyle problemTextStyle() {
return TextStyle( return TextStyle(
fontSize: 12, fontSize: 12,
@ -133,7 +147,6 @@ TextStyle wrapTextStyleBlack() {
TextStyle withoutWrapTextStyle() { TextStyle withoutWrapTextStyle() {
return TextStyle( return TextStyle(
color: primaryColor,
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
); );
@ -230,6 +243,7 @@ class AppSettings {
static String sugarCaluculateUrl = host + 'insertSugar'; static String sugarCaluculateUrl = host + 'insertSugar';
static String profilePicUrl = host + 'users/profile-picture'; static String profilePicUrl = host + 'users/profile-picture';
static String updateProfileUrl = host + 'update/currentUser'; static String updateProfileUrl = host + 'update/currentUser';
static String updateLocationUrl = host + 'updateLocation';
static String uploadPicUrl = host + 'uploads'; static String uploadPicUrl = host + 'uploads';
static String getBmiHistoryUrl = host + 'usersbmi'; static String getBmiHistoryUrl = host + 'usersbmi';
static String getBpHistoryUrl = host + 'usersbp'; static String getBpHistoryUrl = host + 'usersbp';
@ -237,6 +251,9 @@ class AppSettings {
static String addMedicineTimingsUrl = host + 'medicine-timing'; static String addMedicineTimingsUrl = host + 'medicine-timing';
static String getMedicineTimingsUrl = host + 'getmedicineztiming'; static String getMedicineTimingsUrl = host + 'getmedicineztiming';
static String findingsUploadPicUrl = host + 'uploads-findings-prescription'; static String findingsUploadPicUrl = host + 'uploads-findings-prescription';
static String addFindingsUrl = host + 'update-uploads-findingsPictureId-prescription';
static String addReportsUrl = host + 'update-uploads-reportsPictureId-prescription';
static String addPrescriptionsUrl = host + 'update-uploads-prescriptionPictureId-prescription';
static String updateFindingsUploadPicUrl = host + 'update-uploads-findings-prescription'; static String updateFindingsUploadPicUrl = host + 'update-uploads-findings-prescription';
static String updateReportsUploadPicUrl = host + 'update-uploads-reports-prescription'; static String updateReportsUploadPicUrl = host + 'update-uploads-reports-prescription';
static String reportsUploadPicUrl = host + 'uploads-reports-prescription'; static String reportsUploadPicUrl = host + 'uploads-reports-prescription';
@ -248,14 +265,15 @@ class AppSettings {
static String getQuotationUrl = host + 'submitPicture'; static String getQuotationUrl = host + 'submitPicture';
static String addPrescriptionUrl = host + 'add-prescription-details'; static String addPrescriptionUrl = host + 'add-prescription-details';
static String addRecordsUrl = host + 'add-record'; static String addRecordsUrl = host + 'add-record';
static String updateRecordsUrl = host + 'records';
static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo'; static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo';
//static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription'; //static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription';
static String getAllPrescriptionsDataUrl = host + 'getAllPrescriptionDetails'; static String getAllPrescriptionsDataUrl = host + 'getAllPrescriptionDetails';
static String getRecordsDataUrl = host + 'getAllRecords'; static String getRecordsDataUrl = host + 'getAllRecords';
static String deleteRecordUrl = host + 'deleteRecord'; static String deleteRecordUrl = host + 'deleteRecord';
static String deleteFindingsUrl = host + 'uploads-findings-prescription'; static String deleteFindingsUrl = host + 'delete-uploads-findings';
static String deletePrescriptionsUrl = host + 'uploads-prescription-prescription'; static String deletePrescriptionsUrl = host + 'delete-prescription';
static String deleteReportsUrl = host + 'uploads-reports-prescription'; static String deleteReportsUrl = host + 'delete-report';
static String deleteRecordsUrl = host + 'delete-url'; static String deleteRecordsUrl = host + 'delete-url';
@ -620,6 +638,25 @@ class AppSettings {
} }
} }
static Future<bool> updateLocation(payload) async {
var uri = Uri.parse(updateLocationUrl + '/' + customerId);
try {
var response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
var _response = json.decode(response.body);
return true;
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<String> getBmiHistory() async { static Future<String> getBmiHistory() async {
var uri = Uri.parse(getBmiHistoryUrl + '/' + customerId); var uri = Uri.parse(getBmiHistoryUrl + '/' + customerId);
@ -748,6 +785,28 @@ class AppSettings {
return response.body; return response.body;
} }
static Future<String> addFindingsGallery(file,pictureId) async {
var request = http.MultipartRequest(
'PUT', Uri.parse(addFindingsUrl + '/' + customerId+"/"+pictureId));
if (file.length > 0) {
for (var i = 0; i < file.length; i++) {
request.files.add(await http.MultipartFile.fromPath('picture', file[i].path));
}}
// request.files.add(await http.MultipartFile.fromPath('picture', images.toString().replaceAll('[', '').replaceAll(']','')));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<String> addFindingsCamera(file,pictureId) async {
var request = http.MultipartRequest('PUT', Uri.parse(addFindingsUrl + '/' + customerId+"/"+pictureId));
request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<String> updateFindingsGallery(file,var recordId) async { static Future<String> updateFindingsGallery(file,var recordId) async {
var request = http.MultipartRequest( var request = http.MultipartRequest(
@ -797,6 +856,28 @@ class AppSettings {
return response.body; return response.body;
} }
static Future<String> addReportsGallery(file,pictureId) async {
var request = http.MultipartRequest(
'PUT', Uri.parse(addReportsUrl + '/' + customerId+"/"+pictureId));
if (file.length > 0) {
for (var i = 0; i < file.length; i++) {
request.files.add(await http.MultipartFile.fromPath('picture', file[i].path));
}}
// request.files.add(await http.MultipartFile.fromPath('picture', images.toString().replaceAll('[', '').replaceAll(']','')));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<String> addReportsCamera(file,pictureId) async {
var request = http.MultipartRequest('PUT', Uri.parse(addReportsUrl + '/' + customerId+"/"+pictureId));
request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<String> updateReportsGallery(file,var recordId) async { static Future<String> updateReportsGallery(file,var recordId) async {
var request = http.MultipartRequest( var request = http.MultipartRequest(
@ -846,6 +927,28 @@ class AppSettings {
return response.body; return response.body;
} }
static Future<String> addPrescriptionsGallery(file,pictureId) async {
var request = http.MultipartRequest(
'PUT', Uri.parse(addPrescriptionsUrl + '/' + customerId+"/"+pictureId));
if (file.length > 0) {
for (var i = 0; i < file.length; i++) {
request.files.add(await http.MultipartFile.fromPath('picture', file[i].path));
}}
// request.files.add(await http.MultipartFile.fromPath('picture', images.toString().replaceAll('[', '').replaceAll(']','')));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<String> addPrescriptionsCamera(file,pictureId) async {
var request = http.MultipartRequest('PUT', Uri.parse(addPrescriptionsUrl + '/' + customerId+"/"+pictureId));
request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<String> updatePrescriptionsGallery(file,var recordId) async { static Future<String> updatePrescriptionsGallery(file,var recordId) async {
var request = http.MultipartRequest( var request = http.MultipartRequest(
@ -1107,6 +1210,38 @@ class AppSettings {
} }
} }
static Future<bool> updateRecord(payload,recordId) async {
var uri = Uri.parse(updateRecordsUrl + '/' + recordId);
var response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
try {
var _response = json.decode(response.body);
print(_response);
return true;
} catch (e) {
print(e);
return false;
}
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
static Future<String> getAllPrescriptions() async { static Future<String> getAllPrescriptions() async {
var uri = Uri.parse(getAllPrescriptionsDataUrl + '/' + customerId); var uri = Uri.parse(getAllPrescriptionsDataUrl + '/' + customerId);
//uri = uri.replace(query: 'customerId=$customerId'); //uri = uri.replace(query: 'customerId=$customerId');
@ -1187,8 +1322,8 @@ class AppSettings {
} }
static Future<String> deleteFindings(fileName) async { static Future<String> deleteFindings(fileName,findingsId) async {
var uri = Uri.parse(deleteFindingsUrl + '/' + customerId+'/'+fileName); var uri = Uri.parse(deleteFindingsUrl + '/' + customerId+'/'+findingsId+'/'+fileName);
try { try {
var response = await http.delete(uri, headers: await buildRequestHeaders()); var response = await http.delete(uri, headers: await buildRequestHeaders());
@ -1216,8 +1351,8 @@ class AppSettings {
} }
} }
static Future<String> deletePrescriptions(fileName) async { static Future<String> deletePrescriptions(fileName,prescriptionId) async {
var uri = Uri.parse(deletePrescriptionsUrl + '/' + customerId+'/'+fileName); var uri = Uri.parse(deletePrescriptionsUrl + '/' + customerId+'/'+prescriptionId+'/'+fileName);
try { try {
var response = await http.delete(uri, headers: await buildRequestHeaders()); var response = await http.delete(uri, headers: await buildRequestHeaders());
@ -1245,8 +1380,8 @@ class AppSettings {
} }
} }
static Future<String> deleteReports(fileName) async { static Future<String> deleteReports(fileName,reportsId) async {
var uri = Uri.parse(deleteReportsUrl + '/' + customerId+'/'+fileName); var uri = Uri.parse(deleteReportsUrl + '/' + customerId+'/'+reportsId+'/'+fileName);
try { try {
var response = await http.delete(uri, headers: await buildRequestHeaders()); var response = await http.delete(uri, headers: await buildRequestHeaders());
@ -1418,20 +1553,6 @@ class AppSettings {
gender = await getData('gender', 'STRING'); gender = await getData('gender', 'STRING');
} }
static void longFailedStyledToast(String message, context) {
showToast(
message,
context: context,
animation: StyledToastAnimation.scale,
reverseAnimation: StyledToastAnimation.fade,
position: StyledToastPosition.bottom,
animDuration: Duration(seconds: 1),
duration: Duration(seconds: 6),
curve: Curves.elasticOut,
reverseCurve: Curves.linear,
backgroundColor: Colors.red,
);
}
static void longSuccessToast(String message) { static void longSuccessToast(String message) {
Fluttertoast.showToast( Fluttertoast.showToast(

@ -1,19 +0,0 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
class Invitations extends StatefulWidget {
const Invitations({Key? key}) : super(key: key);
@override
State<Invitations> createState() => _InvitationsState();
}
class _InvitationsState extends State<Invitations> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Invitations'),
body: Container(),
);
}
}

@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
class Invitations extends StatefulWidget {
const Invitations({Key? key}) : super(key: key);
@override
State<Invitations> createState() => _InvitationsState();
}
class _InvitationsState extends State<Invitations> {
TextEditingController mobileNumberController = TextEditingController();
TextEditingController nameController = TextEditingController();
final FlutterContactPicker _contactPicker = new FlutterContactPicker();
Contact? _contact;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Invitations'),
body: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(10),
child: Column(
children: [
Container(
child: TextFormField(
cursorColor: greyColor,
controller: nameController,
decoration: textFormFieldDecoration(Icons.phone,'Enter Name'),
),
),
SizedBox(height:MediaQuery.of(context).size.height * .02,),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: mobileNumberController,
keyboardType: TextInputType.number,
decoration: textFormFieldDecoration(Icons.phone,'Enter MobileNumber'),
),
),
SizedBox(height:MediaQuery.of(context).size.height * .02,),
Container(
child: Text('Or',style: TextStyle(color: primaryColor,fontWeight: FontWeight.bold,fontSize: 20),),
),
SizedBox(height:MediaQuery.of(context).size.height * .02,),
TextButton(
child: const Text(
'Select from contacts',
style: TextStyle(decoration: TextDecoration.underline,color: primaryColor,fontSize: 20),
),
onPressed: () async{
Contact? contact = await _contactPicker.selectContact();
setState(() {
_contact = contact;
});
},
)
],
)
)))));
}
}

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
@ -14,7 +15,6 @@ import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platf
import 'package:healthcare_user/prescriptions/get_quotations_request_list.dart'; import 'package:healthcare_user/prescriptions/get_quotations_request_list.dart';
import 'package:location/location.dart' as locationmap; import 'package:location/location.dart' as locationmap;
class OrderMedicines extends StatefulWidget { class OrderMedicines extends StatefulWidget {
var prescriptionDetails; var prescriptionDetails;
OrderMedicines({this.prescriptionDetails}); OrderMedicines({this.prescriptionDetails});
@ -113,8 +113,6 @@ class _OrderMedicinesState extends State<OrderMedicines> {
} }
} }
showSelectedPharmaciesDialog() { showSelectedPharmaciesDialog() {
return showDialog( return showDialog(
barrierDismissible: false, barrierDismissible: false,
@ -127,7 +125,10 @@ class _OrderMedicinesState extends State<OrderMedicines> {
height: MediaQuery.of(context).size.height * .50, height: MediaQuery.of(context).size.height * .50,
width: MediaQuery.of(context).size.width * .70, width: MediaQuery.of(context).size.width * .70,
child: ListView.separated( child: ListView.separated(
separatorBuilder: (context, index) => const Divider(height: 4.0,color: Colors.black,), separatorBuilder: (context, index) => const Divider(
height: 4.0,
color: Colors.black,
),
itemCount: selectedPharmacies.length, itemCount: selectedPharmacies.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return ListTile( return ListTile(
@ -156,11 +157,13 @@ class _OrderMedicinesState extends State<OrderMedicines> {
),*/ ),*/
Expanded( Expanded(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .70, width: MediaQuery.of(context).size.width *
.70,
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
selectedPharmacies[index] selectedPharmacies[index]
@ -184,15 +187,17 @@ class _OrderMedicinesState extends State<OrderMedicines> {
.toUpperCase(), .toUpperCase(),
style: wrapTextStyleBlack()), style: wrapTextStyleBlack()),
Visibility( Visibility(
visible: visible: selectedPharmacies[index]
selectedPharmacies[index].description != '', .description !=
'',
child: SizedBox( child: SizedBox(
height: 10, height: 10,
), ),
), ),
Visibility( Visibility(
visible: visible: selectedPharmacies[index]
selectedPharmacies[index].description != '', .description !=
'',
child: Text( child: Text(
selectedPharmacies[index] selectedPharmacies[index]
.description .description
@ -209,16 +214,20 @@ class _OrderMedicinesState extends State<OrderMedicines> {
)), )),
checkColor: Colors.white, checkColor: Colors.white,
activeColor: primaryColor, activeColor: primaryColor,
value: selectedPharmacies[index].isPharmacyInDialogChecked, value:
selectedPharmacies[index].isPharmacyInDialogChecked,
onChanged: (val) { onChanged: (val) {
setState( setState(
() { () {
selectedPharmacies[index].isPharmacyInDialogChecked = val!; selectedPharmacies[index]
.isPharmacyInDialogChecked = val!;
}, },
); );
if (selectedPharmacies[index].isPharmacyInDialogChecked) { if (selectedPharmacies[index]
.isPharmacyInDialogChecked) {
pharmaciesCheckboxesInDialog.add({ pharmaciesCheckboxesInDialog.add({
'pharmacyId': selectedPharmacies[index].pharmacy_id, 'pharmacyId':
selectedPharmacies[index].pharmacy_id,
}); });
} else { } else {
pharmaciesCheckboxesInDialog.removeWhere((e) => pharmaciesCheckboxesInDialog.removeWhere((e) =>
@ -351,7 +360,6 @@ class _OrderMedicinesState extends State<OrderMedicines> {
), ),
), ),
actions: <Widget>[ actions: <Widget>[
Container( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * .06, height: MediaQuery.of(context).size.height * .06,
@ -370,7 +378,9 @@ class _OrderMedicinesState extends State<OrderMedicines> {
}, },
child: const Text('Cancel'), child: const Text('Cancel'),
), ),
SizedBox(width: 10,), SizedBox(
width: 10,
),
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: buttonColors, // background primary: buttonColors, // background
@ -381,52 +391,61 @@ class _OrderMedicinesState extends State<OrderMedicines> {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["prescriptionPictures"]=widget.prescriptionDetails.prescriptionImages; payload["prescriptionPictures"] =
payload["pharmacies"] = pharmaciesCheckboxesInDialog; widget.prescriptionDetails.prescriptionImages;
payload["pharmacies"] =
pharmaciesCheckboxesInDialog;
payload["familyDetails"] = { payload["familyDetails"] = {
"patient_name": widget.prescriptionDetails.patient_name.toString(), "patient_name": widget
"patient_age": int.parse(widget.prescriptionDetails.age.toString()), .prescriptionDetails.patient_name
"patient_gender": widget.prescriptionDetails.gender.toString().toLowerCase(), .toString(),
"patient_age": int.parse(
widget.prescriptionDetails.age.toString()),
"patient_gender": widget
.prescriptionDetails.gender
.toString()
.toLowerCase(),
"patient_address": userAddress "patient_address": userAddress
}; };
bool status = await AppSettings.getQuotation(payload); bool status =
await AppSettings.getQuotation(payload);
if (status) { if (status) {
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true)
AppSettings.longSuccessToast('Quotation request sent successfully'); .pop();
Navigator.pop(context);
AppSettings.longSuccessToast(
'Quotation request sent successfully');
pharmaciesCheckboxesInDialog.clear(); pharmaciesCheckboxesInDialog.clear();
getAllPharmaciesData(dropdownArea);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const GetQuotationRequestsList()), builder: (context) =>
const GetQuotationRequestsList()),
); );
} else {
Navigator.of(context, rootNavigator: true)
.pop();
AppSettings.longFailedToast(
'Get quotation failed try after some time');
} }
else{ } else if (pharmaciesCheckboxesInDialog.length >
Navigator.of(context, rootNavigator: true).pop(); 3) {
AppSettings.longFailedToast('Get quotation failed try after some time'); AppSettings.longFailedToast(
} 'Please select only three pharmacies to get quotation');
} else {
AppSettings.longFailedToast(
} 'Please select at least three pharmacies to get quotation');
else if(pharmaciesCheckboxesInDialog.length>3){
AppSettings.longFailedToast('Please select only three pharmacies to get quotation');
}
else{
AppSettings.longFailedToast('Please select at least three pharmacies to get quotation');
} }
}, },
child: const Text('Get quote'), child: const Text('Get quote'),
) )
], ],
)), )),
], ],
); );
}); });
}); });
} }
@ -435,7 +454,10 @@ class _OrderMedicinesState extends State<OrderMedicines> {
height: MediaQuery.of(context).size.height * .50, height: MediaQuery.of(context).size.height * .50,
width: MediaQuery.of(context).size.width * .70, width: MediaQuery.of(context).size.width * .70,
child: ListView.separated( child: ListView.separated(
separatorBuilder: (context, index) => const Divider(height: 4.0,color: Colors.black,), separatorBuilder: (context, index) => const Divider(
height: 4.0,
color: Colors.black,
),
itemCount: selectedPharmacies.length, itemCount: selectedPharmacies.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return ListTile( return ListTile(
@ -494,14 +516,16 @@ class _OrderMedicinesState extends State<OrderMedicines> {
style: wrapTextStyleBlack()), style: wrapTextStyleBlack()),
Visibility( Visibility(
visible: visible:
selectedPharmacies[index].description != '', selectedPharmacies[index].description !=
'',
child: SizedBox( child: SizedBox(
height: 10, height: 10,
), ),
), ),
Visibility( Visibility(
visible: visible:
selectedPharmacies[index].description != '', selectedPharmacies[index].description !=
'',
child: Text( child: Text(
selectedPharmacies[index] selectedPharmacies[index]
.description .description
@ -525,34 +549,38 @@ class _OrderMedicinesState extends State<OrderMedicines> {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Visibility( Visibility(
visible:selectedPharmacies[index].isPharmacyInDialogChecked==false, visible: selectedPharmacies[index]
.isPharmacyInDialogChecked ==
false,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, // background primary: primaryColor, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async { onPressed: () async {
selectedPharmacies[index].isPharmacyInDialogChecked=true; selectedPharmacies[index]
.isPharmacyInDialogChecked = true;
}, },
child: const Text('Select'), child: const Text('Select'),
),), ),
SizedBox(width: 10,), ),
SizedBox(
width: 10,
),
Visibility( Visibility(
visible: selectedPharmacies[index].isPharmacyInDialogChecked==true, visible: selectedPharmacies[index]
.isPharmacyInDialogChecked ==
true,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, // background primary: primaryColor, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async{ onPressed: () async {},
},
child: const Text('Deselect'), child: const Text('Deselect'),
)) ))
], ],
)), )),
], ],
)), )),
); );
@ -561,10 +589,111 @@ class _OrderMedicinesState extends State<OrderMedicines> {
); );
} }
modelBottomSheet(var obj) {
showModalBottomSheet<void>(
context: context,
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
),
isScrollControlled: true,
builder: (BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.height * .800,
child: Padding(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
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: obj.picture == ''
? AssetImage("images/logo.png")
: NetworkImage(obj.picture)
as ImageProvider, // picked file
fit: BoxFit.contain)),
),
SizedBox(
width: MediaQuery.of(context).size.width * .02,
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width * .70,
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Pharmacy Name:',
style: labelTextStyleOrderMedicine(),
),
Text(obj.pharmacy_name.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: MediaQuery.of(context).size.height *
.01,
),
Text(
'Contact Number:',
style: labelTextStyleOrderMedicine(),
),
Text(obj.contact_number.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: MediaQuery.of(context).size.height *
.01,
),
Text(
'Address:',
style: labelTextStyleOrderMedicine(),
),
Text(obj.pharmacy_address.toUpperCase(),
style: withoutWrapTextStyle()),
Visibility(
visible: obj.description != '',
child: SizedBox(
height:
MediaQuery.of(context).size.height *
.01,
),
),
Visibility(
visible: obj.description != '',
child: Text(
'Description:',
style: labelTextStyleOrderMedicine(),
),
),
Visibility(
visible: obj.description != '',
child: Text(obj.description.toUpperCase(),
style: withoutWrapTextStyle()),
),
],
)),
),
],
)
],
)));
},
);
}
Widget _pharamciesData() { Widget _pharamciesData() {
if (FilteredList.length != 0) { if (FilteredList.length != 0) {
return return Container(
Container(
color: secondaryColor, color: secondaryColor,
child: Column(crossAxisAlignment: CrossAxisAlignment.end, children: [ child: Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
Expanded( Expanded(
@ -580,29 +709,52 @@ class _OrderMedicinesState extends State<OrderMedicines> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Column(
width: MediaQuery.of(context).size.width * .18, children: [
height: MediaQuery.of(context).size.height * .10, Expanded(
child: Container(
width:
MediaQuery.of(context).size.width * .18,
height: MediaQuery.of(context).size.height *
.10,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
image: DecorationImage( image: DecorationImage(
image: FilteredList[index].picture == '' image: FilteredList[index]
.picture ==
''
? AssetImage("images/logo.png") ? AssetImage("images/logo.png")
: NetworkImage( : NetworkImage(FilteredList[
FilteredList[index].picture) index]
.picture)
as ImageProvider, // picked file as ImageProvider, // picked file
fit: BoxFit.contain)), fit: BoxFit.contain)),
), ),
),
TextButton(
onPressed: () {
modelBottomSheet(FilteredList[index]);
},
child: const Text('More details',
style: TextStyle(
color: primaryColor,
fontSize: 12,
)),
)
],
),
SizedBox( SizedBox(
width: 5, width: 5,
), ),
Expanded( Expanded(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .70, width:
MediaQuery.of(context).size.width * .70,
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
FilteredList[index] FilteredList[index]
@ -627,14 +779,16 @@ class _OrderMedicinesState extends State<OrderMedicines> {
style: wrapTextStyleBlack()), style: wrapTextStyleBlack()),
Visibility( Visibility(
visible: visible:
FilteredList[index].description != '', FilteredList[index].description !=
'',
child: SizedBox( child: SizedBox(
height: 10, height: 10,
), ),
), ),
Visibility( Visibility(
visible: visible:
FilteredList[index].description != '', FilteredList[index].description !=
'',
child: Text( child: Text(
FilteredList[index] FilteredList[index]
.description .description
@ -693,56 +847,58 @@ class _OrderMedicinesState extends State<OrderMedicines> {
onPrimary: Colors.black, // foreground onPrimary: Colors.black, // foreground
), ),
onPressed: () async { onPressed: () async {
if (pharmaciesCheckboxes.length == 3) { if (pharmaciesCheckboxes.length == 3) {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["prescriptionPictures"]=widget.prescriptionDetails.prescriptionImages; payload["prescriptionPictures"] =
widget.prescriptionDetails.prescriptionImages;
payload["pharmacies"] = pharmaciesCheckboxes; payload["pharmacies"] = pharmaciesCheckboxes;
payload["familyDetails"] = { payload["familyDetails"] = {
"patient_name": widget.prescriptionDetails.patient_name.toString()??'', "patient_name": widget.prescriptionDetails.patient_name
"patient_age": int.parse(widget.prescriptionDetails.age.toString())??0, .toString() ??
"patient_gender": widget.prescriptionDetails.gender.toString().toLowerCase()??'', '',
"patient_age": int.parse(
widget.prescriptionDetails.age.toString()) ??
0,
"patient_gender": widget.prescriptionDetails.gender
.toString()
.toLowerCase() ??
'',
"patient_address": userAddress ?? '' "patient_address": userAddress ?? ''
}; };
bool status = await AppSettings.getQuotation(payload); bool status = await AppSettings.getQuotation(payload);
if (status) { if (status) {
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast('Quotation request sent successfully'); AppSettings.longSuccessToast(
'Quotation request sent successfully');
pharmaciesCheckboxes.clear(); pharmaciesCheckboxes.clear();
getAllPharmaciesData(dropdownArea);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const GetQuotationRequestsList()), builder: (context) =>
const GetQuotationRequestsList()),
); );
} } else {
else{
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast('Get quotation failed try after some time'); AppSettings.longFailedToast(
} 'Get quotation failed try after some time');
} }
else if(pharmaciesCheckboxes.length>3){ } else if (pharmaciesCheckboxes.length > 3) {
showSelectedPharmaciesDialog(); showSelectedPharmaciesDialog();
} else {
} AppSettings.longFailedToast(
else{ 'Please select at least three pharmacies to get quotation');
AppSettings.longFailedToast('Please select at least three pharmacies to get quotation');
} }
}, },
child: Text('Get quote'), child: Text('Get quote'),
)), )),
), ),
]), ]),
); );
} } else {
else {
return Center( return Center(
child: Padding( child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0), padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
@ -758,28 +914,37 @@ class _OrderMedicinesState extends State<OrderMedicines> {
height: 20, height: 20,
), ),
Text( Text(
'There is an issue at server please try after some time',style:serverIssueTextStyle() ,), 'There is an issue at server please try after some time',
style: serverIssueTextStyle(),
),
], ],
) )
: userAddress==''?Column( : userAddress == ''
? Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
/*Image( /*Image(
image: AssetImage('images/resourceblue.pngs'), image: AssetImage('images/resourceblue.pngs'),
// height: MediaQuery.of(context).size.height * .10, // height: MediaQuery.of(context).size.height * .10,
),*/ ),*/
Icon(Icons.location_on_outlined,color: primaryColor,size: 40,), Icon(
Icons.location_on_outlined,
color: primaryColor,
size: 40,
),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Text( Text(
'Please select location to see near by tankers',style:TextStyle( 'Please select location to see near by tankers',
style: TextStyle(
color: primaryColor, color: primaryColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),), ),
),
], ],
): )
Column( : Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
/*Image( /*Image(
@ -802,8 +967,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
), ),
), ),
], ],
) )));
));
} }
} }
@ -816,9 +980,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
super.initState(); super.initState();
} }
Widget prescriptions(var obj) { Widget prescriptions(var obj) {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * .20, height: MediaQuery.of(context).size.height * .20,
@ -835,10 +997,10 @@ class _OrderMedicinesState extends State<OrderMedicines> {
Navigator.push( Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new ImageZoomPage(imageName:'Prescriptions',imageDetails:obj.prescriptionImages[index]['url']))); builder: (__) => new ImageZoomPage(
imageName: 'Prescriptions',
imageDetails: obj.prescriptionImages[index]
['url'])));
}, },
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .30, width: MediaQuery.of(context).size.width * .30,
@ -847,8 +1009,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(
obj.prescriptionImages[index] obj.prescriptionImages[index]['url'])
['url'])
as ImageProvider, // picked file as ImageProvider, // picked file
fit: BoxFit.fill)), fit: BoxFit.fill)),
), ),
@ -865,7 +1026,6 @@ class _OrderMedicinesState extends State<OrderMedicines> {
); );
}), }),
); );
} }
@override @override
@ -878,7 +1038,8 @@ class _OrderMedicinesState extends State<OrderMedicines> {
children: [ children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: prescriptions(widget.prescriptionDetails),), child: prescriptions(widget.prescriptionDetails),
),
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
@ -892,13 +1053,16 @@ class _OrderMedicinesState extends State<OrderMedicines> {
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
color: primaryColor), color: primaryColor),
)), )),
SizedBox(width: 5,), SizedBox(
width: 5,
),
TextButton( TextButton(
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const GetQuotationRequestsList()), builder: (context) =>
const GetQuotationRequestsList()),
); );
}, },
child: const Text( child: const Text(
@ -909,8 +1073,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
color: primaryColor), color: primaryColor),
)), )),
], ],
) )),
),
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
@ -1083,7 +1246,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor), borderSide: BorderSide(color: greyColor),
), ),
labelText: 'distance', labelText: 'distance in Kms',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -1097,7 +1260,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
items: AreaItems.map((String items) { items: AreaItems.map((String items) {
return DropdownMenuItem( return DropdownMenuItem(
value: items, value: items,
child: Text(items), child: Text(items,style: TextStyle(fontSize: 12),),
); );
}).toList(), }).toList(),
// After selecting the desired option,it will // After selecting the desired option,it will

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:healthcare_user/Reports/add_reports.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/common/zoom_image.dart'; import 'package:healthcare_user/common/zoom_image.dart';
import 'package:healthcare_user/models/pharmacies_model.dart'; import 'package:healthcare_user/models/pharmacies_model.dart';
@ -12,6 +13,7 @@ import 'package:healthcare_user/prescriptions/oreder_medicines.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
import 'package:healthcare_user/models/prescriptions_model.dart'; import 'package:healthcare_user/models/prescriptions_model.dart';
import 'package:intl/intl.dart';
class Prescriptions extends StatefulWidget { class Prescriptions extends StatefulWidget {
const Prescriptions({Key? key}) : super(key: key); const Prescriptions({Key? key}) : super(key: key);
@ -38,6 +40,17 @@ class _PrescriptionsState extends State<Prescriptions> {
var AreaItems = ['2', '5', '10', '25', '50', '100']; var AreaItems = ['2', '5', '10', '25', '50', '100'];
List pharmaciesCheckboxes = []; List pharmaciesCheckboxes = [];
bool isLoading=false; bool isLoading=false;
final ImagePicker imagePicker = ImagePicker();
List imageFileList = [];
List uiPrescriptionImages = [];
TextEditingController searchController = TextEditingController();
TextEditingController dateInput = TextEditingController();
String dropdownSearchType = 'Problem';
var typeOfSearchItems = [
'Problem',
'Doctor',
'Date',
];
Future<void> getAllPharmaciesData(var distance) async { Future<void> getAllPharmaciesData(var distance) async {
isPharmacyDataLoading=true; isPharmacyDataLoading=true;
@ -125,6 +138,81 @@ class _PrescriptionsState extends State<Prescriptions> {
} }
} }
Future<void> getRecordsByProblemName(var problem) async {
isPrescriptionsDataLoading=true;
try {
var response = await AppSettings.getAllRecords();
setState(() {
reportsListOriginal = ((jsonDecode(response)) as List)
.map((dynamic model) {
return ReportsModel.fromJson(model);
}).toList();
reportsList=reportsListOriginal.reversed.toList();
reportsList= reportsListOriginal.where(
(x) => x.problem.toString().toLowerCase().contains(problem.toString().toLowerCase())
).toList();
isPrescriptionsDataLoading = false;
});
} catch (e) {
setState(() {
isPrescriptionsDataLoading = false;
isSereverIssue = true;
});
}
}
Future<void> getRecordsByDoctorName(var doctor) async {
isPrescriptionsDataLoading=true;
try {
var response = await AppSettings.getAllRecords();
setState(() {
reportsListOriginal = ((jsonDecode(response)) as List)
.map((dynamic model) {
return ReportsModel.fromJson(model);
}).toList();
reportsList=reportsListOriginal.reversed.toList();
reportsList= reportsListOriginal.where(
(x) => x.doctorName.toString().toLowerCase().contains(doctor.toString().toLowerCase())
).toList();
isPrescriptionsDataLoading = false;
});
} catch (e) {
setState(() {
isPrescriptionsDataLoading = false;
isSereverIssue = true;
});
}
}
Future<void> getRecordsByDate(var date) async {
isPrescriptionsDataLoading=true;
try {
var response = await AppSettings.getAllRecords();
setState(() {
reportsListOriginal = ((jsonDecode(response)) as List)
.map((dynamic model) {
return ReportsModel.fromJson(model);
}).toList();
reportsList=reportsListOriginal.reversed.toList();
reportsList= reportsListOriginal.where(
(x) => x.date.toString().toLowerCase().contains(date.toString().toLowerCase())
).toList();
isPrescriptionsDataLoading = false;
});
} catch (e) {
setState(() {
isPrescriptionsDataLoading = false;
isSereverIssue = true;
});
}
}
@override @override
void initState() { void initState() {
lat = AppSettings.userLatitude; lat = AppSettings.userLatitude;
@ -170,6 +258,37 @@ class _PrescriptionsState extends State<Prescriptions> {
} }
} }
Future pickImageFromGalleryForUpdate(var recordId) async {
imageFileList = [];
final List<XFile>? selectedImages = await imagePicker.pickMultiImage();
AppSettings.preLoaderDialog(context);
if (selectedImages!.isNotEmpty) {
imageFileList.addAll(selectedImages);
}
var res = await AppSettings.updatePrescriptionsGallery(imageFileList,recordId);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
getAllRecords();
}
Future takeImageFromCameraForUpdate(var recordId) async {
try {
final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.updatePrescriptionsCamera(image,recordId);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
getAllRecords();
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
Widget _pharamciesData() { Widget _pharamciesData() {
if (FilteredList.length != 0) { if (FilteredList.length != 0) {
return Column( return Column(
@ -468,15 +587,18 @@ class _PrescriptionsState extends State<Prescriptions> {
} }
Widget prescriptions(var obj){ Widget prescriptions(var obj){
if(obj.prescriptionImages.length!=0){
return Container( return Container(
//color: secondaryColor,
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * .20, height: MediaQuery.of(context).size.height * .20,
child: ListView.builder( child: Row(
children: [
Expanded(child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: obj.prescriptionImages.length, itemCount: obj.prescriptionImages.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Column( return Row(
children: [ children: [
Card( Card(
child: GestureDetector( child: GestureDetector(
@ -485,11 +607,7 @@ class _PrescriptionsState extends State<Prescriptions> {
Navigator.push( Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new ImageZoomPage(imageName:'Prescriptions',imageDetails:obj.prescriptionImages[index]['url']))); builder: (__) => new ImageZoomPage(imageName:'Prescriptions',imageDetails:obj.prescriptionImages[index]['url'])));},
},
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .30, width: MediaQuery.of(context).size.width * .30,
height: MediaQuery.of(context).size.height * .15, height: MediaQuery.of(context).size.height * .15,
@ -497,21 +615,226 @@ class _PrescriptionsState extends State<Prescriptions> {
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(
obj.prescriptionImages[index] obj.prescriptionImages[index]['url'])
['url'])
as ImageProvider, // picked file as ImageProvider, // picked file
fit: BoxFit.fill)), fit: BoxFit.fill)),
child: Stack(children: [
Positioned(
right: 0,
child: Container(
child: IconButton(
iconSize: 30,
icon: const Icon(
Icons.delete,
color: Colors.red,
),
onPressed: () async {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) => AlertDialog(
title:
const Text('Do you want to delete image?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment:
MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: () async {
AppSettings.preLoaderDialog(context);
String fileName = obj.prescriptionImages[index]['url']
.split('/')
.last;
var payload =
new Map<String, dynamic>();
payload["urlType"] = 'prescription';
payload["url"] = obj.prescriptionImages[index]['url'];
try {
var res = await AppSettings
.deleteRecordsNew(
payload,
obj.recordId);
print(jsonDecode(res));
Navigator.of(context,
rootNavigator: true)
.pop();
Navigator.of(context).pop(true);
AppSettings.longSuccessToast(
"Image deleted Successfully");
setState(() {
obj.prescriptionImages =
jsonDecode(
res)['remainingUrls'];
});
} catch (e) {
print(e);
Navigator.of(context,
rootNavigator: true)
.pop();
Navigator.of(context).pop(true);
AppSettings.longFailedToast(
"Image deletion failed");
}
},
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
),
);
},
),
),
)
]),
),
),
)
],
);
}),),
IconButton(
iconSize: 40,
icon: const Icon(
Icons.add,
color: Colors.green,
),
onPressed: () async {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: primaryColor,
),
onTap: () async {
await takeImageFromCameraForUpdate(obj.recordId);
Navigator.pop(context);
},
),
SizedBox(
width: MediaQuery.of(context).size.width *
.20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
await pickImageFromGalleryForUpdate(obj.recordId);
Navigator.pop(context);
},
),
],
),
),
);
});
},
)
],
)
);
}
else{
return Row(
children: [
IconButton(
iconSize: 40,
icon: const Icon(
Icons.add,
color: Colors.green,
),
onPressed: () async {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: primaryColor,
),
onTap: () async {
await takeImageFromCameraForUpdate(obj.recordId);
Navigator.pop(context);
},
), ),
SizedBox(
width: MediaQuery.of(context).size.width *
.20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
), ),
onTap: () async {
await pickImageFromGalleryForUpdate(obj.recordId);
Navigator.pop(context);
},
), ),
], ],
),
),
); );
}), });
},
),
Text('Add Prescriptions',style: textButtonStyle(),)
],
); );
}
} }
Widget _allPrescriptions(){ Widget _filtereddata(){
if (reportsList.length != 0) { if (reportsList.length != 0) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
@ -521,7 +844,7 @@ class _PrescriptionsState extends State<Prescriptions> {
itemCount: reportsList.length, itemCount: reportsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Visibility( return Visibility(
visible: reportsList[index].prescriptionImages.length!=0, visible: true,
child: Card( child: Card(
//color: prescriptionsList[index].cardColor, //color: prescriptionsList[index].cardColor,
@ -567,10 +890,17 @@ class _PrescriptionsState extends State<Prescriptions> {
SizedBox(height:MediaQuery.of(context).size.height * .02,), SizedBox(height:MediaQuery.of(context).size.height * .02,),
prescriptions(reportsList[index]), prescriptions(reportsList[index]),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(
Icons.shopping_cart,
color: primaryColor,
),
TextButton( TextButton(
child: const Text( child: Text(
'Order Medicines', 'Order Medicines / Other Products',
style: TextStyle(color: primaryColor), style: textButtonStyle(),
), ),
onPressed: () { onPressed: () {
@ -580,6 +910,7 @@ class _PrescriptionsState extends State<Prescriptions> {
builder: (__) => new OrderMedicines(prescriptionDetails:reportsList[index]))); builder: (__) => new OrderMedicines(prescriptionDetails:reportsList[index])));
//signup screen //signup screen
}, },
)],
) )
], ],
), ),
@ -587,6 +918,350 @@ class _PrescriptionsState extends State<Prescriptions> {
)); ));
}) ), }) ),
]); ]);
}
else{
return Padding(padding: EdgeInsets.fromLTRB(60,10,60,10),
child: Column(
children: [
Text('No prescriptions found related to your search'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: Colors.red,
radius: 30,
child: const Icon(
Icons.info,
color: Colors.white,
),
)
],
),);
}
}
Widget _allPrescriptions(){
if(reportsListOriginal.length!=0){
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: DropdownButtonFormField(
// Initial Value
value: dropdownSearchType,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.search,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Search By',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Select Search Type'),
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: typeOfSearchItems.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(() {
dropdownSearchType = newValue!;
});
},
),
),
Visibility(
visible:dropdownSearchType.toString().toLowerCase()=='problem' ,
child: Container(
height: MediaQuery.of(context).size.height * .07,
padding: EdgeInsets.all(5),
child: Center(child: TextField(
cursorColor: primaryColor,
controller: searchController,
onChanged: (string) {
if(string.length>=1){
getRecordsByProblemName(string);
}
else{
getAllRecords();
}
},
decoration: InputDecoration(
prefixIcon: Icon(
Icons.search,
color: primaryColor,
),
/*suffixIcon: Icon(
Icons.clear,
color: greyColor,
),*/
suffixIcon: searchController.text!=''?IconButton(
icon: Icon(
Icons.clear,
color: Colors.red,
),
onPressed: () {
setState(() {
searchController.text='';
});
getAllRecords();
},
):IconButton(
icon: Icon(
Icons.clear,
color: Colors.transparent,
),
onPressed: () {
},
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
//labelText: 'Search by phone number',
hintText: 'Search by problem',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),)
),),
Visibility(
visible:dropdownSearchType.toString().toLowerCase()=='doctor' ,
child: Container(
height: MediaQuery.of(context).size.height * .07,
padding: EdgeInsets.all(5),
child: Center(child: TextField(
cursorColor: primaryColor,
controller: searchController,
onChanged: (string) {
if(string.length>=1){
getRecordsByDoctorName(string);
}
else{
getAllRecords();
}
},
decoration: InputDecoration(
prefixIcon: Icon(
Icons.search,
color: primaryColor,
),
/*suffixIcon: Icon(
Icons.clear,
color: greyColor,
),*/
suffixIcon: searchController.text!=''?IconButton(
icon: Icon(
Icons.clear,
color: Colors.red,
),
onPressed: () {
setState(() {
searchController.text='';
});
getAllRecords();
},
):IconButton(
icon: Icon(
Icons.clear,
color: Colors.transparent,
),
onPressed: () {
},
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
//labelText: 'Search by phone number',
hintText: 'Search by doctor',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),)
),),
Visibility(
visible:dropdownSearchType.toString().toLowerCase()=='date' ,
child: Container(
height: MediaQuery.of(context).size.height * .07,
padding: EdgeInsets.all(5),
child: Center(child: TextField(
cursorColor: primaryColor,
controller: searchController,
onChanged: (string) {
if(string.length>=1){
getRecordsByDate(string);
}
else{
getAllRecords();
}
},
onTap: () async {
DateTime? pickedDate = await showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime(1950),
lastDate: DateTime.now(),
builder: (BuildContext context, Widget? child) {
return Theme(
data: ThemeData.dark().copyWith(
colorScheme: ColorScheme.dark(
primary: buttonColors,
onPrimary: Colors.white,
surface: buttonColors,
onSurface: Colors.white,
),
dialogBackgroundColor: primaryColor,
),
child: child!,
);
},
);
if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() {
searchController.text = formattedDate; //set output date to TextField value.
});
getRecordsByDate(searchController.text);
} else {}
},
decoration: InputDecoration(
prefixIcon: Icon(
Icons.search,
color: primaryColor,
),
suffixIcon: searchController.text!=''?IconButton(
icon: Icon(
Icons.clear,
color: Colors.red,
),
onPressed: () {
setState(() {
searchController.text='';
});
getAllRecords();
},
):IconButton(
icon: Icon(
Icons.clear,
color: Colors.transparent,
),
onPressed: () {
},
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
borderRadius: BorderRadius.circular(30),
),
//labelText: 'Search by phone number',
hintText: 'Search by date',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),)
),
),
Expanded(child: _filtereddata()),
Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
child: CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
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) => AddReports())).then((value) {
getAllRecords();
});
//showBoreAddingDialog();
},
),
/* Padding(
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Text(
'Add Tanks ',
style: TextStyle(color: Colors.white),
),
)*/
],
),
),
),
]);
} }
else{ else{
return Center( return Center(
@ -596,7 +1271,7 @@ class _PrescriptionsState extends State<Prescriptions> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,), SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('No prescriptions added as of now'), Text('Click below icon to add new Record'),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
@ -606,10 +1281,13 @@ class _PrescriptionsState extends State<Prescriptions> {
child: IconButton( child: IconButton(
iconSize: 40, iconSize: 40,
icon: const Icon( icon: const Icon(
Icons.info, Icons.add,
color: Colors.white, color: Colors.white,
), ),
onPressed: () async { onPressed: () async {
Navigator.push(context, MaterialPageRoute(builder: (context) => AddReports())).then((value) {
getAllRecords();
});
}, },
), ),
) )
@ -618,6 +1296,8 @@ class _PrescriptionsState extends State<Prescriptions> {
) )
); );
} }
} }
/**/ /**/

@ -0,0 +1,214 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.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;
import '../google_maps_place_picker_mb/src/models/pick_result.dart';
import '../google_maps_place_picker_mb/src/place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:healthcare_user/google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:healthcare_user/keys.dart';
class UpdateMyLocation extends StatefulWidget {
const UpdateMyLocation({Key? key}) : super(key: key);
@override
State<UpdateMyLocation> createState() => _UpdateMyLocationState();
}
class _UpdateMyLocationState extends State<UpdateMyLocation> {
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;
double lat=0;
double lng=0;
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;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Update My Location'),
body: Padding(
padding: EdgeInsets.all(10),
child: Column(
children: [
Container(
child: Row(
children: [
Text('Current Location :',style: labelTextStyle(),),
SizedBox(width:MediaQuery.of(context).size.width * .02,),
Text(AppSettings.userAddress,style:wrapTextStyleBlack(),)
],
),
),
SizedBox(height:MediaQuery.of(context).size.height * .04,),
Container(
width:double.infinity,
height: MediaQuery.of(context).size.height * .05,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async{
//=============================================================================================
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) async {
setState(() {
selectedPlace = result;
lat=selectedPlace!.geometry!.location.lat;
lng=selectedPlace!.geometry!.location.lng;
/*if(selectedPlace!.types!.length==1){
userAddressCapturingController.text =
selectedPlace!.formattedAddress!;
}
else{
userAddressCapturingController.text =selectedPlace!.name!+', '+selectedPlace!.formattedAddress!;
}*/
Navigator.of(context).pop();
});
var payload = new Map<String, dynamic>();
payload["latitude"] = lat;
payload["longitude"] = lng;
bool updateStatus = await AppSettings.updateLocation(payload);
if(updateStatus){
setState(() {
if(selectedPlace!.types!.length==1){
AppSettings.userAddress =
selectedPlace!.formattedAddress!;
}
else{
AppSettings.userAddress=selectedPlace!.name!+', '+selectedPlace!.formattedAddress!;
}
});
}
else{
AppSettings.longFailedToast(
"Failed to update location");
}
},
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"),
),
],
),
),
),
),
),
);
},
);
}
});
},
child: const Text('Update My Location'),
)),
],
),
)
);
}
}

@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
class UpdatePin extends StatefulWidget {
const UpdatePin({Key? key}) : super(key: key);
@override
State<UpdatePin> createState() => _UpdatePinState();
}
class _UpdatePinState extends State<UpdatePin> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Update Pin'),
body: Container(),
);
}
}

@ -6,9 +6,13 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <file_selector_linux/file_selector_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h> #include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
url_launcher_linux url_launcher_linux
) )

@ -7,6 +7,7 @@ import Foundation
import cloud_firestore import cloud_firestore
import device_info_plus_macos import device_info_plus_macos
import file_selector_macos
import firebase_core import firebase_core
import firebase_messaging import firebase_messaging
import flutter_local_notifications import flutter_local_notifications
@ -19,6 +20,7 @@ import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))

@ -7,14 +7,14 @@ packages:
name: _flutterfire_internals name: _flutterfire_internals
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.2" version: "1.3.6"
archive: archive:
dependency: transitive dependency: transitive
description: description:
name: archive name: archive
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.3.7" version: "3.4.2"
args: args:
dependency: transitive dependency: transitive
description: description:
@ -98,21 +98,21 @@ packages:
name: cloud_firestore name: cloud_firestore
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.8.0" version: "4.9.2"
cloud_firestore_platform_interface: cloud_firestore_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: cloud_firestore_platform_interface name: cloud_firestore_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.15.0" version: "5.16.1"
cloud_firestore_web: cloud_firestore_web:
dependency: transitive dependency: transitive
description: description:
name: cloud_firestore_web name: cloud_firestore_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.6.0" version: "3.7.1"
cloudinary_public: cloudinary_public:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -175,14 +175,14 @@ packages:
name: day_night_time_picker name: day_night_time_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0+1"
dbus: dbus:
dependency: transitive dependency: transitive
description: description:
name: dbus name: dbus
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.7.3" version: "0.7.4"
device_info_plus: device_info_plus:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -238,7 +238,7 @@ packages:
name: dio name: dio
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.2.0+1" version: "5.3.3"
dots_indicator: dots_indicator:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -267,13 +267,41 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.4" version: "6.1.4"
file_selector_linux:
dependency: transitive
description:
name: file_selector_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.2"
file_selector_macos:
dependency: transitive
description:
name: file_selector_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.3+1"
file_selector_platform_interface:
dependency: transitive
description:
name: file_selector_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.0"
file_selector_windows:
dependency: transitive
description:
name: file_selector_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.3"
firebase_core: firebase_core:
dependency: transitive dependency: transitive
description: description:
name: firebase_core name: firebase_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.13.1" version: "2.16.0"
firebase_core_platform_interface: firebase_core_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -287,28 +315,28 @@ packages:
name: firebase_core_web name: firebase_core_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0" version: "2.8.0"
firebase_messaging: firebase_messaging:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: firebase_messaging name: firebase_messaging
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "14.6.2" version: "14.6.8"
firebase_messaging_platform_interface: firebase_messaging_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: firebase_messaging_platform_interface name: firebase_messaging_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.5.2" version: "4.5.7"
firebase_messaging_web: firebase_messaging_web:
dependency: transitive dependency: transitive
description: description:
name: firebase_messaging_web name: firebase_messaging_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.2" version: "3.5.7"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -348,7 +376,7 @@ packages:
name: flutter_lints name: flutter_lints
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.2"
flutter_local_notifications: flutter_local_notifications:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -370,11 +398,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.0.0" version: "5.0.0"
flutter_localizations: flutter_native_contact_picker:
dependency: transitive dependency: "direct dev"
description: flutter description:
source: sdk name: flutter_native_contact_picker
version: "0.0.0" url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
@ -389,20 +419,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
flutter_styled_toast:
dependency: "direct dev"
description:
name: flutter_styled_toast
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
flutter_svg: flutter_svg:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_svg name: flutter_svg
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.3" version: "1.1.6"
flutter_svg_provider: flutter_svg_provider:
dependency: "direct main" dependency: "direct main"
description: description:
@ -440,7 +463,7 @@ packages:
name: geocoding_android name: geocoding_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
geocoding_ios: geocoding_ios:
dependency: transitive dependency: transitive
description: description:
@ -468,35 +491,35 @@ packages:
name: geolocator_android name: geolocator_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.8" version: "4.3.1"
geolocator_apple: geolocator_apple:
dependency: transitive dependency: transitive
description: description:
name: geolocator_apple name: geolocator_apple
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.6" version: "2.3.2"
geolocator_platform_interface: geolocator_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: geolocator_platform_interface name: geolocator_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.7" version: "4.1.0"
geolocator_web: geolocator_web:
dependency: transitive dependency: transitive
description: description:
name: geolocator_web name: geolocator_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.6" version: "2.2.0"
geolocator_windows: geolocator_windows:
dependency: transitive dependency: transitive
description: description:
name: geolocator_windows name: geolocator_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.1" version: "0.1.3"
get: get:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -531,7 +554,7 @@ packages:
name: google_maps_flutter_android name: google_maps_flutter_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.15" version: "2.4.16"
google_maps_flutter_ios: google_maps_flutter_ios:
dependency: transitive dependency: transitive
description: description:
@ -545,14 +568,14 @@ packages:
name: google_maps_flutter_platform_interface name: google_maps_flutter_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.7" version: "2.4.0"
google_maps_flutter_web: google_maps_flutter_web:
dependency: transitive dependency: transitive
description: description:
name: google_maps_flutter_web name: google_maps_flutter_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.0+1" version: "0.5.3"
google_maps_place_picker_mb: google_maps_place_picker_mb:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -594,49 +617,63 @@ packages:
name: image name: image
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.3" version: "3.3.0"
image_picker: image_picker:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.7+5" version: "0.8.9"
image_picker_android: image_picker_android:
dependency: transitive dependency: transitive
description: description:
name: image_picker_android name: image_picker_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.6+19" version: "0.8.7+4"
image_picker_for_web: image_picker_for_web:
dependency: transitive dependency: transitive
description: description:
name: image_picker_for_web name: image_picker_for_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.12" version: "2.2.0"
image_picker_ios: image_picker_ios:
dependency: transitive dependency: transitive
description: description:
name: image_picker_ios name: image_picker_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.7+4" version: "0.8.8"
image_picker_linux:
dependency: transitive
description:
name: image_picker_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
image_picker_macos:
dependency: transitive
description:
name: image_picker_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: image_picker_platform_interface name: image_picker_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.6.4" version: "2.9.0"
imei_plugin: image_picker_windows:
dependency: "direct dev" dependency: transitive
description: description:
name: imei_plugin name: image_picker_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "0.2.1"
intl: intl:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -721,6 +758,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
multi_image_picker: multi_image_picker:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -811,14 +855,14 @@ packages:
name: path_provider_linux name: path_provider_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.11" version: "2.2.0"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: path_provider_platform_interface name: path_provider_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.6" version: "2.1.0"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
@ -832,35 +876,35 @@ packages:
name: permission_handler name: permission_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "10.3.0" version: "10.4.5"
permission_handler_android: permission_handler_android:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_android name: permission_handler_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "10.2.3" version: "10.3.6"
permission_handler_apple: permission_handler_apple:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_apple name: permission_handler_apple
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "9.1.0" version: "9.1.4"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.10.0" version: "3.11.5"
permission_handler_windows: permission_handler_windows:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_windows name: permission_handler_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.2" version: "0.1.3"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -888,14 +932,14 @@ packages:
name: platform name: platform
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.0" version: "3.1.1"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.5"
pointycastle: pointycastle:
dependency: transitive dependency: transitive
description: description:
@ -923,56 +967,56 @@ packages:
name: sanitize_html name: sanitize_html
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.1.0"
shared_preferences: shared_preferences:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.2.0"
shared_preferences_android: shared_preferences_android:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_android name: shared_preferences_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.2.0"
shared_preferences_foundation: shared_preferences_foundation:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_foundation name: shared_preferences_foundation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.2" version: "2.3.3"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_linux name: shared_preferences_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
shared_preferences_platform_interface: shared_preferences_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_platform_interface name: shared_preferences_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
shared_preferences_web: shared_preferences_web:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_web name: shared_preferences_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.2.0"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_windows name: shared_preferences_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
sizer: sizer:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -1047,7 +1091,7 @@ packages:
name: tuple name: tuple
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.2"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -1075,7 +1119,7 @@ packages:
name: url_launcher_android name: url_launcher_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.35" version: "6.0.38"
url_launcher_ios: url_launcher_ios:
dependency: transitive dependency: transitive
description: description:
@ -1096,28 +1140,28 @@ packages:
name: url_launcher_macos name: url_launcher_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.5" version: "3.0.6"
url_launcher_platform_interface: url_launcher_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_platform_interface name: url_launcher_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.3"
url_launcher_web: url_launcher_web:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_web name: url_launcher_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.17" version: "2.0.18"
url_launcher_windows: url_launcher_windows:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_windows name: url_launcher_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.6" version: "3.0.7"
uuid: uuid:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1152,7 +1196,7 @@ packages:
name: xml name: xml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.4.1" version: "6.1.0"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:

@ -38,7 +38,6 @@ dev_dependencies:
url_launcher: ^6.1.9 url_launcher: ^6.1.9
intl: ^0.17.0 intl: ^0.17.0
flutter_svg: ^1.0.1 flutter_svg: ^1.0.1
flutter_styled_toast: ^2.1.3
google_maps_place_picker_mb: ^2.0.0-mb.22 google_maps_place_picker_mb: ^2.0.0-mb.22
flutter_datetime_picker: ^1.5.1 flutter_datetime_picker: ^1.5.1
date_time_picker: ^2.1.0 date_time_picker: ^2.1.0
@ -48,7 +47,6 @@ dev_dependencies:
flutter_local_notifications: ^9.0.2 flutter_local_notifications: ^9.0.2
cloud_firestore: ^4.5.2 cloud_firestore: ^4.5.2
flutter_device_type: ^0.4.0 flutter_device_type: ^0.4.0
imei_plugin: ^1.2.0
device_information: ^0.0.4 device_information: ^0.0.4
device_info_plus: ^3.2.4 device_info_plus: ^3.2.4
overlay_support: ^2.1.0 overlay_support: ^2.1.0
@ -67,6 +65,7 @@ dev_dependencies:
dots_indicator: ^3.0.0 dots_indicator: ^3.0.0
multi_image_picker: ^4.8.1 multi_image_picker: ^4.8.1
charts_flutter: ^0.12.0 charts_flutter: ^0.12.0
flutter_native_contact_picker: ^0.0.4
flutter_icons: flutter_icons:
image_path_ios: 'images/appicon.png' image_path_ios: 'images/appicon.png'

@ -6,12 +6,15 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <file_selector_windows/file_selector_windows.h>
#include <firebase_core/firebase_core_plugin_c_api.h> #include <firebase_core/firebase_core_plugin_c_api.h>
#include <geolocator_windows/geolocator_windows.h> #include <geolocator_windows/geolocator_windows.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FirebaseCorePluginCApiRegisterWithRegistrar( FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
GeolocatorWindowsRegisterWithRegistrar( GeolocatorWindowsRegisterWithRegistrar(

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
firebase_core firebase_core
geolocator_windows geolocator_windows
permission_handler_windows permission_handler_windows

Loading…
Cancel
Save