Merge remote-tracking branch 'origin/master'

dev
suresh 1 year ago
commit 7eff1d0057

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 952 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 887 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 B

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -726,7 +726,7 @@ class _DashboardState extends State<Dashboard> {
title: Row( title: Row(
children: [ children: [
Image( Image(
image: const AssetImage('images/myconnections.png'), image: const AssetImage('images/reportmyself.png'),
height: 25, height: 25,
width: 25, width: 25,
fit: BoxFit.fill), fit: BoxFit.fill),

@ -35,7 +35,8 @@ TextStyle labelTextStyle() {
} }
TextStyle haveMotorTextStyle() { TextStyle haveMotorTextStyle() {
return TextStyle(color: Colors.red, fontSize: 12,fontWeight: FontWeight.bold); return TextStyle(
color: Colors.red, fontSize: 12, fontWeight: FontWeight.bold);
} }
TextStyle textButtonStyle() { TextStyle textButtonStyle() {
@ -60,9 +61,11 @@ TextStyle startAndStopHeading() {
color: primaryColor, color: primaryColor,
); );
} }
Text capacitySuffixText() { Text capacitySuffixText() {
return Text('in Ltrs.'); return Text('in Ltrs.');
} }
Text dimensionSuffixText() { Text dimensionSuffixText() {
return Text('in fts'); return Text('in fts');
} }
@ -86,28 +89,51 @@ TextStyle serverIssueTextStyle() {
} }
TextStyle bottomSheetValuesTextStyle() { TextStyle bottomSheetValuesTextStyle() {
return TextStyle(fontSize: 12,fontWeight: FontWeight.bold,overflow: TextOverflow.ellipsis,); return TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
);
} }
TextStyle wrapTextStyle() { TextStyle wrapTextStyle() {
return TextStyle(color:primaryColor,fontSize: 12,fontWeight: FontWeight.bold,overflow: TextOverflow.ellipsis,); return TextStyle(
color: primaryColor,
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
);
} }
TextStyle wrapTextStyleBlack() { TextStyle wrapTextStyleBlack() {
return TextStyle(color:Colors.black,fontSize: 12,fontWeight: FontWeight.bold,overflow: TextOverflow.ellipsis,); return TextStyle(
color: Colors.black,
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
);
} }
TextStyle withoutWrapTextStyle() { TextStyle withoutWrapTextStyle() {
return TextStyle(color:primaryColor,fontSize: 12,fontWeight: FontWeight.bold,); return TextStyle(
color: primaryColor,
fontSize: 12,
fontWeight: FontWeight.bold,
);
} }
TextStyle bmiTextStyle() { TextStyle bmiTextStyle() {
return TextStyle(color:primaryColor,fontSize: 16,fontWeight: FontWeight.bold,); return TextStyle(
color: primaryColor,
fontSize: 16,
fontWeight: FontWeight.bold,
);
} }
TextStyle drawerListItemsTextStyle() { TextStyle drawerListItemsTextStyle() {
return TextStyle(color: Colors.white); return TextStyle(color: Colors.white);
} }
TextStyle drawerHeaderTextStyle() { TextStyle drawerHeaderTextStyle() {
return TextStyle(color: Colors.white, fontSize: 15); return TextStyle(color: Colors.white, fontSize: 15);
} }
@ -116,8 +142,6 @@ TextStyle drawerHeaderTextStyleNew(){
return TextStyle(color: Colors.black, fontSize: 15); return TextStyle(color: Colors.black, fontSize: 15);
} }
InputDecoration textFormFieldDecoration(IconData icon, var text) { InputDecoration textFormFieldDecoration(IconData icon, var text) {
return InputDecoration( return InputDecoration(
filled: true, filled: true,
@ -134,8 +158,8 @@ InputDecoration textFormFieldDecoration(IconData icon,var text){
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
), ),
labelText: text, labelText: text,
labelStyle: labelStyle: TextStyle(
TextStyle(color: Colors.black, //<-- SEE HERE color: Colors.black, //<-- SEE HERE
), ),
); );
} }
@ -173,8 +197,8 @@ class AppSettings {
static String long = "", lat = ""; static String long = "", lat = "";
late StreamSubscription<Position> positionStream; late StreamSubscription<Position> positionStream;
static String fcmId = ''; static String fcmId = '';
static String serverToken='AAAAA66BLaA:APA91bHcmbyiNN8hCL-t-M9oH-u7ZMOl74fcImMM2DQZLgdyY98Wu9XxME-CTPcjpjU6Yy48ouxISrOMb9lpa3PJofh8qciUKMNxV2al-bDvGvPP_VVaH0mrTHzR56hdkGy1Zl-0frDO'; static String serverToken =
'AAAAA66BLaA:APA91bHcmbyiNN8hCL-t-M9oH-u7ZMOl74fcImMM2DQZLgdyY98Wu9XxME-CTPcjpjU6Yy48ouxISrOMb9lpa3PJofh8qciUKMNxV2al-bDvGvPP_VVaH0mrTHzR56hdkGy1Zl-0frDO';
//api urls //api urls
static String host = 'http://35.200.129.165:4000/api/'; static String host = 'http://35.200.129.165:4000/api/';
@ -197,21 +221,12 @@ class AppSettings {
static String getMedicineTimingsUrl = host + 'getmedicineztiming'; static String getMedicineTimingsUrl = host + 'getmedicineztiming';
static String prescriptionUploadPicUrl = host + 'uploads-precription'; static String prescriptionUploadPicUrl = host + 'uploads-precription';
static String getAllpharmaciesDataUrl = host + 'getAllPharmacylist'; static String getAllpharmaciesDataUrl = host + 'getAllPharmacylist';
static String getAllQuotationRequestsUrl = host + 'userprecription';
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 reportMySelfVideoUploadUrl = host + 'reportProblemVideo'; static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo';
static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription'; static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription';
static File? updatedImage; static File? updatedImage;
static String image = ''; static String image = '';
static String profilePictureUrl = ''; static String profilePictureUrl = '';
@ -234,8 +249,6 @@ class AppSettings {
); );
} }
/* Preloader */ /* Preloader */
static GlobalKey<State> preLoaderKey = new GlobalKey<State>(); static GlobalKey<State> preLoaderKey = new GlobalKey<State>();
static Future<void> preLoaderDialog(BuildContext context) async { static Future<void> preLoaderDialog(BuildContext context) async {
@ -260,7 +273,8 @@ class AppSettings {
return _headers; return _headers;
} }
static Future<Map<String, String>> buildPutRequestHeadersForResetToken() async { static Future<Map<String, String>>
buildPutRequestHeadersForResetToken() async {
Map<String, String> _headers = new Map<String, String>(); Map<String, String> _headers = new Map<String, String>();
return _headers; return _headers;
} }
@ -370,21 +384,23 @@ class AppSettings {
} }
static Future<bool> sendSms(payload) async { static Future<bool> sendSms(payload) async {
var response=await http.post(Uri.parse(sendSmsUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'}); var response = await http.post(Uri.parse(sendSmsUrl),
body: json.encode(payload),
headers: {'Content-type': 'application/json'});
if (response.statusCode == 200) { if (response.statusCode == 200) {
return true; return true;
} } else {
else{
return false; return false;
} }
} }
static Future<bool> phoneVerification(payload) async { static Future<bool> phoneVerification(payload) async {
var response=await http.post(Uri.parse(phoneVerificationUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'}); var response = await http.post(Uri.parse(phoneVerificationUrl),
body: json.encode(payload),
headers: {'Content-type': 'application/json'});
if (response.statusCode == 200) { if (response.statusCode == 200) {
return true; return true;
} } else {
else{
return false; return false;
} }
} }
@ -524,9 +540,7 @@ class AppSettings {
// display error toast // display error toast
return false; return false;
} }
} } else if (response.statusCode == 401) {
else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken(); bool status = await AppSettings.resetToken();
if (status) { if (status) {
response = await http.post(uri, response = await http.post(uri,
@ -539,9 +553,7 @@ class AppSettings {
} else { } else {
return false; return false;
} }
} } else {
else {
return false; return false;
} }
} }
@ -549,10 +561,8 @@ class AppSettings {
static Future<bool> updateProfile(payload) async { static Future<bool> updateProfile(payload) async {
var uri = Uri.parse(updateProfileUrl + '/' + customerId); var uri = Uri.parse(updateProfileUrl + '/' + customerId);
try { try {
var response = await http.put( var response = await http.put(uri,
uri, body: json.encode(payload), headers: await buildRequestHeaders());
body: json.encode(payload),
headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {
var _response = json.decode(response.body); var _response = json.decode(response.body);
@ -655,41 +665,38 @@ class AppSettings {
}*/ }*/
static Future<http.StreamedResponse> uploadImageHTTP(file) async { static Future<http.StreamedResponse> uploadImageHTTP(file) async {
var request = http.MultipartRequest(
var request = http.MultipartRequest('POST', Uri.parse(uploadPicUrl + '/' + customerId)); 'POST', Uri.parse(uploadPicUrl + '/' + customerId));
request.files.add(await http.MultipartFile.fromPath('picture', file.path)); request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send(); var res = await request.send();
return res; return res;
} }
static Future<String> uploadImageHTTPNew(file) async {
var request = http.MultipartRequest('POST', Uri.parse(uploadPicUrl + '/' + customerId)); static Future<String> uploadImageHTTPNew(file) async {
var request = http.MultipartRequest(
'POST', Uri.parse(uploadPicUrl + '/' + customerId));
request.files.add(await http.MultipartFile.fromPath('picture', file.path)); request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send(); var res = await request.send();
var response = await http.Response.fromStream(res); var response = await http.Response.fromStream(res);
return response.body; return response.body;
} }
static Future<String> uploadImageHTTPForPrescriptions(file) async { static Future<String> uploadImageHTTPForPrescriptions(file) async {
var request = http.MultipartRequest(
var request = http.MultipartRequest('POST', Uri.parse(prescriptionUploadPicUrl + '/' + customerId)); 'POST', Uri.parse(prescriptionUploadPicUrl + '/' + customerId));
request.files.add(await http.MultipartFile.fromPath('picture', file.path)); request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send(); var res = await request.send();
var response = await http.Response.fromStream(res); var response = await http.Response.fromStream(res);
return response.body; return response.body;
} }
static Future<String> uploadVideoInReportMySelf(file) async { static Future<String> uploadVideoInReportMySelf(file) async {
var request = http.MultipartRequest(
var request = http.MultipartRequest('POST', Uri.parse(reportMySelfVideoUploadUrl + '/' + customerId)); 'POST', Uri.parse(reportMySelfVideoUploadUrl + '/' + customerId));
request.files.add(await http.MultipartFile.fromPath('video', file.path)); request.files.add(await http.MultipartFile.fromPath('video', file.path));
var res = await request.send(); var res = await request.send();
var response = await http.Response.fromStream(res); var response = await http.Response.fromStream(res);
return response.body; return response.body;
} }
static Future<String> getAllpharmacies() async { static Future<String> getAllpharmacies() async {
@ -716,6 +723,30 @@ class AppSettings {
} }
} }
static Future<String> getAllQuotationRequests() async {
var uri = Uri.parse(getAllQuotationRequestsUrl+'/'+customerId);
//uri = uri.replace(query: 'customerId=$customerId');
var response = await http.get(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.get(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else {
return '';
}
} else {
return '';
}
} else {
return '';
}
}
static Future<String> addMedicineTimings(payload) async { static Future<String> addMedicineTimings(payload) async {
var uri = Uri.parse(addMedicineTimingsUrl + '/' + customerId); var uri = Uri.parse(addMedicineTimingsUrl + '/' + customerId);
@ -766,10 +797,8 @@ class AppSettings {
static Future<bool> getQuotation(payload) async { static Future<bool> getQuotation(payload) async {
var uri = Uri.parse(getQuotationUrl + '/' + customerId); var uri = Uri.parse(getQuotationUrl + '/' + customerId);
var response = await http.post( var response = await http.post(uri,
uri, body: json.encode(payload), headers: await buildRequestHeaders());
body: json.encode(payload),
headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {
try { try {
@ -783,10 +812,8 @@ class AppSettings {
} else if (response.statusCode == 401) { } else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken(); bool status = await AppSettings.resetToken();
if (status) { if (status) {
response = await http.post( response = await http.post(uri,
uri, body: json.encode(payload), headers: await buildRequestHeaders());
body: json.encode(payload),
headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {
return true; return true;
} else { } else {
@ -802,10 +829,8 @@ class AppSettings {
static Future<bool> addPrescription(payload) async { static Future<bool> addPrescription(payload) async {
var uri = Uri.parse(addPrescriptionUrl + '/' + customerId); var uri = Uri.parse(addPrescriptionUrl + '/' + customerId);
var response = await http.post( var response = await http.post(uri,
uri, body: json.encode(payload), headers: await buildRequestHeaders());
body: json.encode(payload),
headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {
try { try {
@ -819,10 +844,8 @@ class AppSettings {
} else if (response.statusCode == 401) { } else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken(); bool status = await AppSettings.resetToken();
if (status) { if (status) {
response = await http.post( response = await http.post(uri,
uri, body: json.encode(payload), headers: await buildRequestHeaders());
body: json.encode(payload),
headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {
return true; return true;
} else { } else {
@ -860,8 +883,6 @@ class AppSettings {
} }
} }
/*Apis ends here*/ /*Apis ends here*/
//save data local //save data local
@ -936,6 +957,7 @@ class AppSettings {
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.0); fontSize: 16.0);
} }
static void longSuccessToast1(String message) { static void longSuccessToast1(String message) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: message, msg: message,
@ -944,8 +966,7 @@ class AppSettings {
timeInSecForIosWeb: 1, timeInSecForIosWeb: 1,
backgroundColor: Colors.green, backgroundColor: Colors.green,
textColor: Colors.white, textColor: Colors.white,
fontSize: 16.0 fontSize: 16.0);
);
} }
static void longFailedToast(String message) { static void longFailedToast(String message) {

@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
class GetQuotationsRequsetListModel {
String pharmacy_name = '';
String customer_id = '';
String patient_name = '';
double patient_age =0;
String patient_gender = '';
String patient_address = '';
String status='';
String picture='';
String contact_number='';
String pharmacy_address='';
String pharmacy_id='';
String registration_number='';
String description='';
String starting_price='';
Color text_color=Colors.black;
double lat=0;
double lng=0;
bool isChecked=false;
bool isPharmacyInDialogChecked=false;
GetQuotationsRequsetListModel();
factory GetQuotationsRequsetListModel.fromJson(Map<String, dynamic> json){
GetQuotationsRequsetListModel rtvm = new GetQuotationsRequsetListModel();
rtvm.customer_id = json['customerId'] ?? '';
rtvm.patient_name= json['user']['familyDetails']['patient_name']??'';
rtvm.patient_age= json['user']['familyDetails']['patient_age']??0;
rtvm.patient_gender= json['user']['familyDetails']['patient_gender']??'';
rtvm.patient_address= json['user']['familyDetails']['patient_address']??'';
return rtvm;
}
}

@ -15,6 +15,7 @@ class PharmaciesModel {
double lat=0; double lat=0;
double lng=0; double lng=0;
bool isChecked=false; bool isChecked=false;
bool isPharmacyInDialogChecked=false;
PharmaciesModel(); PharmaciesModel();
@ -30,8 +31,8 @@ class PharmaciesModel {
rtvm.starting_price = json['startingPrice'] ?? ''; rtvm.starting_price = json['startingPrice'] ?? '';
rtvm.picture = json['picture'] ?? ''; rtvm.picture = json['picture'] ?? '';
rtvm.status = json['status'] ?? ''; rtvm.status = json['status'] ?? '';
rtvm.lat = json['latitude'] ?? 0; rtvm.lat = json['latitude'] ?? 0.0;
rtvm.lng = json['longitude'] ??0; rtvm.lng = json['longitude'] ??0.0;
return rtvm; return rtvm;
} }

@ -366,6 +366,9 @@ class _MyMedicineTimingsState extends State<MyMedicineTimings> {
onPressed: () async { onPressed: () async {
editTimingsDialog(); editTimingsDialog();
/*Navigator.push(context, MaterialPageRoute(builder: (context) => EditMedicineTimings())).then((value) {
getMedicineTimingsList();
});*/
}, },
child: const Text('Edit'), child: const Text('Edit'),
), ),

@ -0,0 +1,60 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/models/get_quotation_requests_list_model.dart';
class GetQuotationRequestsList extends StatefulWidget {
const GetQuotationRequestsList({Key? key}) : super(key: key);
@override
State<GetQuotationRequestsList> createState() => _GetQuotationRequestsListState();
}
class _GetQuotationRequestsListState extends State<GetQuotationRequestsList> {
bool isLoading = false;
bool isSereverIssue = false;
List<GetQuotationsRequsetListModel> quotationRequestsList = [];
Future<void> getAllQuotationRequestsList() async {
isLoading = true;
try {
var resopnse = await AppSettings.getAllQuotationRequests();
setState(() {
quotationRequestsList = ((jsonDecode(resopnse)) as List)
.map((dynamic model) {
return GetQuotationsRequsetListModel.fromJson(model);
}).toList();
isLoading = false;
});
} catch (e) {
setState(() {
isLoading = false;
isSereverIssue = true;
});
}
}
@override
void initState() {
getAllQuotationRequestsList();
super.initState();
}
Widget renderUi(){
return Container();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Quotation Requests'),
body: renderUi(),
);
}
}

@ -10,6 +10,7 @@ import 'package:healthcare_user/keys.dart';
import 'package:healthcare_user/models/pharmacies_model.dart'; import 'package:healthcare_user/models/pharmacies_model.dart';
import 'package:google_maps_flutter_android/google_maps_flutter_android.dart'; import 'package:google_maps_flutter_android/google_maps_flutter_android.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.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;
@ -29,6 +30,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
//String dropdownType = 'Tank'; //String dropdownType = 'Tank';
var AreaItems = ['2', '5', '10', '25', '50', '100']; var AreaItems = ['2', '5', '10', '25', '50', '100'];
List pharmaciesCheckboxes = []; List pharmaciesCheckboxes = [];
List pharmaciesCheckboxesInDialog = [];
List selectedPharmacies = []; List selectedPharmacies = [];
bool isLoading = false; bool isLoading = false;
bool isSereverIssue = false; bool isSereverIssue = false;
@ -68,6 +70,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
Future<void> getAllPharmaciesData(var distance) async { Future<void> getAllPharmaciesData(var distance) async {
isLoading = true; isLoading = true;
selectedPharmacies=[];
try { try {
var pharmacyResponse = await AppSettings.getAllpharmacies(); var pharmacyResponse = await AppSettings.getAllpharmacies();
@ -110,74 +113,447 @@ class _OrderMedicinesState extends State<OrderMedicines> {
} }
showListOfSelectedPharmacies() async {
showSelectedPharmaciesDialog(){
return showDialog( return showDialog(
context: context,
barrierDismissible: false, barrierDismissible: false,
context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder( return StatefulBuilder(builder: (context, setState) {
builder: (BuildContext context, StateSetter setState) { return AlertDialog(
title: Text('Selected Pharmacies'),
return Container( content: Container(
height: 300.0, // Change as per your requirement height: MediaQuery.of(context).size.height * .50,
width: 300.0, // Change as per your requirement width: MediaQuery.of(context).size.width * .70,
child: ListView.builder( child:ListView.separated(
shrinkWrap: true, separatorBuilder: (context, index) => const Divider(height: 4.0,color: Colors.black,),
itemCount: 5, itemCount: selectedPharmacies.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return ListTile( return ListTile(
title: Text('Gujarat, India'), title: CheckboxListTile(
title: Padding(
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
/*Container(
width: MediaQuery.of(context).size.width * .18,
height: MediaQuery.of(context).size.height * .10,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
image: selectedPharmacies[index].picture == ''
? AssetImage("images/logo.png")
: NetworkImage(
selectedPharmacies[index].picture)
as ImageProvider, // picked file
fit: BoxFit.contain)),
),
SizedBox(
width: 5,
),*/
Expanded(
child: Container(
width: MediaQuery.of(context).size.width * .70,
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
selectedPharmacies[index]
.pharmacy_name
.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: 10,
),
Text(
selectedPharmacies[index]
.contact_number
.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: 10,
),
Text(
selectedPharmacies[index]
.pharmacy_address
.toUpperCase(),
style: wrapTextStyleBlack()),
Visibility(
visible:
selectedPharmacies[index].description != '',
child: SizedBox(
height: 10,
),
),
Visibility(
visible:
selectedPharmacies[index].description != '',
child: Text(
selectedPharmacies[index]
.description
.toUpperCase(),
style: wrapTextStyleBlack()),
),
SizedBox(
height: 10,
),
],
)),
),
],
)),
checkColor: Colors.white,
activeColor: primaryColor,
value: selectedPharmacies[index].isPharmacyInDialogChecked,
onChanged: (val) {
setState(
() {
selectedPharmacies[index].isPharmacyInDialogChecked = val!;
},
); );
if (selectedPharmacies[index].isPharmacyInDialogChecked) {
pharmaciesCheckboxesInDialog.add({
'pharmacyId': selectedPharmacies[index].pharmacy_id,
});
} else {
pharmaciesCheckboxesInDialog.removeWhere((e) =>
e['pharmacyId'].toString().toUpperCase() ==
selectedPharmacies[index]
.pharmacy_id
.toString()
.toUpperCase());
}
}, },
), ),
); /*Padding(
/* return AlertDialog( padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
title: const Text('Selected pharmacies'), child: Column(
content: SingleChildScrollView( children: [
child: Expanded( Row(
child: ListView.builder( mainAxisAlignment: MainAxisAlignment.start,
itemCount: selectedPharmacies.length, crossAxisAlignment: CrossAxisAlignment.start,
itemBuilder: (context, index) { children: [
return Card( Container(
width: MediaQuery.of(context).size.width * .18,
height: MediaQuery.of(context).size.height * .10,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
image: selectedPharmacies[index].picture == ''
? AssetImage("images/logo.png")
: NetworkImage(
selectedPharmacies[index].picture)
as ImageProvider, // picked file
fit: BoxFit.contain)),
),
SizedBox(
width: 5,
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width * .70,
child: Column( child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(selectedPharmacies[index].pharmacy_name) Text(
selectedPharmacies[index]
.pharmacy_name
.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: 10,
),
Text(
selectedPharmacies[index]
.contact_number
.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: 10,
),
Text(
selectedPharmacies[index]
.pharmacy_address
.toUpperCase(),
style: wrapTextStyleBlack()),
Visibility(
visible:
selectedPharmacies[index].description != '',
child: SizedBox(
height: 10,
),
),
Visibility(
visible:
selectedPharmacies[index].description != '',
child: Text(
selectedPharmacies[index]
.description
.toUpperCase(),
style: wrapTextStyleBlack()),
),
SizedBox(
height: 10,
),
], ],
)),
), ),
);}, ],
), ),
) Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * .06,
padding: const EdgeInsets.all(10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Visibility(
visible:selectedPharmacies[index].isPharmacyInDialogChecked==false,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
), ),
actions: <Widget>[ onPressed: () async{
TextButton( selectedPharmacies[index].isPharmacyInDialogChecked=true;
child: Text('Cancel', style: textButtonStyle()),
onPressed: () {
Navigator.of(context).pop();
}, },
child: const Text('Select'),
),),
SizedBox(width: 10,),
Visibility(
visible: selectedPharmacies[index].isPharmacyInDialogChecked==true,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
), ),
TextButton(
child: Text('Get quote', style: textButtonStyle()),
onPressed: () async{ onPressed: () async{
Navigator.of(context).pop();
}, },
), child: const Text('Deselect'),
))
], ],
);*/ )),
});
],
)),*/
);
}, },
),
),
actions: <Widget>[
Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * .06,
padding: const EdgeInsets.all(10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async{
Navigator.pop(context);
},
child: const Text('Cancel'),
),
SizedBox(width: 10,),
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async{
if(pharmaciesCheckboxesInDialog.length==3){
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["picture"] = widget.prescriptionDetails.prescription_url.toString();
payload["pharmacies"] = pharmaciesCheckboxesInDialog;
payload["familyDetails"] = {
"patient_name": widget.prescriptionDetails.patient_name.toString(),
"patient_age": int.parse(widget.prescriptionDetails.age.toString()),
"patient_gender": widget.prescriptionDetails.gender,
"patient_address": userAddress
};
bool status = await AppSettings.getQuotation(payload);
if(status){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast('Quotation request sent successfully');
pharmaciesCheckboxesInDialog.clear();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const GetQuotationRequestsList()),
); );
} }
else{
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast('Get quotation failed try after some time');
}
}
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'),
)
],
)),
],
);
});
});
}
Widget setupAlertDialoadContainer() { Widget setupAlertDialoadContainer() {
return Container( return Container(
height: 300.0, // Change as per your requirement height: MediaQuery.of(context).size.height * .50,
width: 300.0, // Change as per your requirement width: MediaQuery.of(context).size.width * .70,
child: ListView.builder( child:ListView.separated(
shrinkWrap: true, separatorBuilder: (context, index) => const Divider(height: 4.0,color: Colors.black,),
itemCount: 5, itemCount: selectedPharmacies.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return ListTile( return ListTile(
title: Text('Gujarat, India'), title: Padding(
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Column(
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: selectedPharmacies[index].picture == ''
? AssetImage("images/logo.png")
: NetworkImage(
selectedPharmacies[index].picture)
as ImageProvider, // picked file
fit: BoxFit.contain)),
),
SizedBox(
width: 5,
),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width * .70,
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
selectedPharmacies[index]
.pharmacy_name
.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: 10,
),
Text(
selectedPharmacies[index]
.contact_number
.toUpperCase(),
style: wrapTextStyleBlack()),
SizedBox(
height: 10,
),
Text(
selectedPharmacies[index]
.pharmacy_address
.toUpperCase(),
style: wrapTextStyleBlack()),
Visibility(
visible:
selectedPharmacies[index].description != '',
child: SizedBox(
height: 10,
),
),
Visibility(
visible:
selectedPharmacies[index].description != '',
child: Text(
selectedPharmacies[index]
.description
.toUpperCase(),
style: wrapTextStyleBlack()),
),
SizedBox(
height: 10,
),
],
)),
),
],
),
Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * .06,
padding: const EdgeInsets.all(10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Visibility(
visible:selectedPharmacies[index].isPharmacyInDialogChecked==false,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: () async{
selectedPharmacies[index].isPharmacyInDialogChecked=true;
},
child: const Text('Select'),
),),
SizedBox(width: 10,),
Visibility(
visible: selectedPharmacies[index].isPharmacyInDialogChecked==true,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: () async{
},
child: const Text('Deselect'),
))
],
)),
],
)),
); );
}, },
), ),
@ -319,7 +695,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
if(pharmaciesCheckboxes.length==3){ if(pharmaciesCheckboxes.length==3){
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["picture"] = widget.prescriptionDetails.prescription_url.toString(); payload["picture"] = widget.prescriptionDetails.prescription_url.toString();
@ -327,22 +703,30 @@ class _OrderMedicinesState extends State<OrderMedicines> {
payload["familyDetails"] = { payload["familyDetails"] = {
"patient_name": widget.prescriptionDetails.patient_name.toString(), "patient_name": widget.prescriptionDetails.patient_name.toString(),
"patient_age": int.parse(widget.prescriptionDetails.age.toString()), "patient_age": int.parse(widget.prescriptionDetails.age.toString()),
"patient_gender": widget.prescriptionDetails.gender, "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();
AppSettings.longSuccessToast('Quotation request sent successfully'); AppSettings.longSuccessToast('Quotation request sent successfully');
pharmaciesCheckboxes.clear();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const GetQuotationRequestsList()),
);
} }
else{ else{
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){
showListOfSelectedPharmacies(); showSelectedPharmaciesDialog();
} }
else{ else{
@ -488,7 +872,9 @@ class _OrderMedicinesState extends State<OrderMedicines> {
)), )),
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: TextButton( child: Row(
children: [
TextButton(
onPressed: () {}, onPressed: () {},
child: const Text( child: const Text(
'Want to order non prescribed items?', 'Want to order non prescribed items?',
@ -497,6 +883,24 @@ class _OrderMedicinesState extends State<OrderMedicines> {
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
color: primaryColor), color: primaryColor),
)), )),
SizedBox(width: 5,),
TextButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const GetQuotationRequestsList()),
);
},
child: const Text(
'Requests',
style: TextStyle(
fontSize: 15,
decoration: TextDecoration.underline,
color: primaryColor),
)),
],
)
), ),
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -659,7 +1063,7 @@ class _OrderMedicinesState extends State<OrderMedicines> {
isExpanded: true, isExpanded: true,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.area_chart, Icons.location_on_outlined,
color: primaryColor, color: primaryColor,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(

@ -9,11 +9,48 @@ class Reports extends StatefulWidget {
} }
class _ReportsState extends State<Reports> { class _ReportsState extends State<Reports> {
TextEditingController doctorNameController = TextEditingController();
TextEditingController hospitalNameController = TextEditingController();
TextEditingController problemController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppSettings.appBar('Reports'), appBar: AppSettings.appBar('Reports'),
body: Container(), body: Container(
child: Padding(
padding: EdgeInsets.all(10),
child: Column(
children: [
Container(
child: TextFormField(
cursorColor: greyColor,
controller: doctorNameController,
decoration: textFormFieldDecoration(Icons.person,'Enter Doctor name'),
),
),
SizedBox(height:MediaQuery.of(context).size.height * .02,),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: hospitalNameController,
decoration: textFormFieldDecoration(Icons.location_city_outlined,'Enter Hospital name'),
),
),
SizedBox(height:MediaQuery.of(context).size.height * .02,),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: problemController,
decoration: textFormFieldDecoration(Icons.edit,'Enter Problem'),
),
),
],
),
),
),
); );
} }
} }

Loading…
Cancel
Save