offers module added

master
Sneha 8 months ago
parent 08bf881f28
commit 942703ed32

@ -18,6 +18,7 @@ class AddReports extends StatefulWidget {
} }
class _AddReportsState extends State<AddReports> { class _AddReportsState extends State<AddReports> {
TextEditingController doctorNameController = TextEditingController(); TextEditingController doctorNameController = TextEditingController();
TextEditingController hospitalNameController = TextEditingController(); TextEditingController hospitalNameController = TextEditingController();
TextEditingController problemController = TextEditingController(); TextEditingController problemController = TextEditingController();
@ -33,7 +34,6 @@ class _AddReportsState extends State<AddReports> {
List uiFindingsImages = []; List uiFindingsImages = [];
List uiReportsImages = []; List uiReportsImages = [];
List uiPrescriptionImages = []; List uiPrescriptionImages = [];
Map<String,dynamic> findings={}; Map<String,dynamic> findings={};
List<Asset> images = <Asset>[]; List<Asset> images = <Asset>[];
String _error = 'No Error Dectected'; String _error = 'No Error Dectected';
@ -47,7 +47,6 @@ class _AddReportsState extends State<AddReports> {
String? problemCategory; String? problemCategory;
String? gender; String? gender;
var doctorNameVariable; var doctorNameVariable;
List<GetConnectedDoctorsModel> connectedDoctorsListOriginal = []; List<GetConnectedDoctorsModel> connectedDoctorsListOriginal = [];
Future<void> getAllConnectedDoctors() async { Future<void> getAllConnectedDoctors() async {
@ -55,7 +54,7 @@ class _AddReportsState extends State<AddReports> {
var response = await AppSettings.getAllConnectedDoctors(); var response = await AppSettings.getAllConnectedDoctors();
setState(() { setState(() {
connectedDoctorsListOriginal = ((jsonDecode(response)) as List) connectedDoctorsListOriginal = ((jsonDecode(response)['doctors']) as List)
.map((dynamic model) { .map((dynamic model) {
return GetConnectedDoctorsModel.fromJson(model); return GetConnectedDoctorsModel.fromJson(model);
}).toList(); }).toList();
@ -73,7 +72,6 @@ class _AddReportsState extends State<AddReports> {
super.initState(); super.initState();
} }
Future pickImageFromGallery() async { Future pickImageFromGallery() async {
imageFileList = []; imageFileList = [];
final List<XFile>? selectedImages = await imagePicker.pickMultiImage(); final List<XFile>? selectedImages = await imagePicker.pickMultiImage();
@ -351,8 +349,8 @@ class _AddReportsState extends State<AddReports> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(child: connectedDoctorsListOriginal.length!=0?DropdownButtonFormField( Container(
// Initial Value child: connectedDoctorsListOriginal.length!=0?DropdownButtonFormField(
value: doctorNameVariable, value: doctorNameVariable,
isExpanded: true, isExpanded: true,
decoration: const InputDecoration( decoration: const InputDecoration(
@ -397,7 +395,8 @@ class _AddReportsState extends State<AddReports> {
doctorNameVariable = newValue; doctorNameVariable = newValue;
}); });
}, },
):IconButton( ):
IconButton(
onPressed: () { onPressed: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => AddDoctor())).then((value) { Navigator.push(context, MaterialPageRoute(builder: (context) => AddDoctor())).then((value) {
getAllConnectedDoctors(); getAllConnectedDoctors();
@ -409,90 +408,15 @@ class _AddReportsState extends State<AddReports> {
size: 40, size: 40,
), ),
),), ),),
Visibility(
visible: connectedDoctorsListOriginal.length!=0,
child: Container(child: DropdownButtonFormField(
// Initial Value
value: doctorNameVariable,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.person,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Select Doctor',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Please Select Doctor'),
// Down Arrow Icon
//icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: connectedDoctorsListOriginal.map((items) {
return DropdownMenuItem(
value: items,
child: Text(
items.doctor_name,
style: TextStyle(
fontSize: 16,
),
textAlign: TextAlign.center,
));
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: ( newValue) {
setState(() {
doctorNameVariable = newValue;
});
},
),),
),
SizedBox(
height: MediaQuery.of(context).size.height * .02,
),
/* Container(
child: TextFormField(
cursorColor: greyColor,
controller: doctorNameController,
textCapitalization: TextCapitalization.words,
decoration: textFormFieldDecoration(
Icons.person, 'Enter Doctor name'),
),
),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * .02, height: MediaQuery.of(context).size.height * .02,
), ),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: hospitalNameController,
textCapitalization: TextCapitalization.words,
decoration: textFormFieldDecoration(
Icons.location_city_outlined, 'Enter Hospital name'),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * .02,
),*/
Container( Container(
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: problemController, controller: problemController,
textCapitalization: TextCapitalization.words, textCapitalization: TextCapitalization.words,
decoration: textFormFieldDecoration( decoration: textFormFieldDecorationGrey(
Icons.report_problem, 'Enter Problem'), Icons.report_problem, 'Enter Problem'),
), ),
), ),
@ -503,7 +427,7 @@ class _AddReportsState extends State<AddReports> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: dateInput, controller: dateInput,
decoration: textFormFieldDecoration( decoration: textFormFieldDecorationGrey(
Icons.calendar_today, 'Enter Date'), Icons.calendar_today, 'Enter Date'),
readOnly: true, readOnly: true,
onTap: () async { onTap: () async {
@ -546,7 +470,8 @@ class _AddReportsState extends State<AddReports> {
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * .02, height: MediaQuery.of(context).size.height * .02,
), ),
Text('Select Problem Category',style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 14),), Text('Select Problem Category',
style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 14),),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -577,7 +502,8 @@ class _AddReportsState extends State<AddReports> {
), ),
], ],
), ),
Text('Select Problem For',style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 14),), Text('Select Problem For',
style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 14),),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -608,7 +534,6 @@ class _AddReportsState extends State<AddReports> {
), ),
], ],
), ),
Visibility( Visibility(
visible: visible:
prescriptionFor.toString().toLowerCase() == 'others', prescriptionFor.toString().toLowerCase() == 'others',
@ -690,6 +615,7 @@ class _AddReportsState extends State<AddReports> {
], ],
), ),
), ),
/*findings*/ /*findings*/
Visibility( Visibility(
visible: uiFindingsImages.length == 0, visible: uiFindingsImages.length == 0,
@ -1241,6 +1167,7 @@ class _AddReportsState extends State<AddReports> {
child: const Text('Add Prescriptions'), child: const Text('Add Prescriptions'),
), ),
), ),
Container( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * .06, height: MediaQuery.of(context).size.height * .06,
@ -1250,7 +1177,7 @@ class _AddReportsState extends State<AddReports> {
onPrimary: Colors.black, // foreground onPrimary: Colors.black, // foreground
), ),
onPressed: () async { onPressed: () async {
if (problemController.text != '' && if (doctorNameVariable!=''&&problemController.text != '' &&
dateInput.text != '' && dateInput.text != '' &&
prescriptionFor != ''&&problemCategory!='') { prescriptionFor != ''&&problemCategory!='') {
String _name = ''; String _name = '';

@ -12,6 +12,7 @@ import 'package:healthcare_user/my_connections/all_connections.dart';
import 'package:healthcare_user/my_connections/dynamic_code_doctor.dart'; import 'package:healthcare_user/my_connections/dynamic_code_doctor.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';
import 'package:healthcare_user/orders/quotations.dart';
import 'package:healthcare_user/prescriptions/prescriptions.dart'; import 'package:healthcare_user/prescriptions/prescriptions.dart';
import 'package:healthcare_user/report_problem/report_my_self.dart'; import 'package:healthcare_user/report_problem/report_my_self.dart';
import 'package:healthcare_user/Reports/add_reports.dart'; import 'package:healthcare_user/Reports/add_reports.dart';
@ -1011,6 +1012,35 @@ class _DashboardState extends State<Dashboard> {
Divider( Divider(
color: Colors.grey, color: Colors.grey,
), ),
ListTile(
title: Row(
children: [
Image(
image: const AssetImage('images/updatemylocation.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
const SizedBox(
width: 10,
),
const SizedBox(
width: 10,
),
Text('Quotations',
style: drawerListItemsTextStyle()),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AllQuotations()),
);
},
),
Divider(
color: Colors.grey,
),
ListTile( ListTile(
title: Row( title: Row(
children: [ children: [

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_user/common/dashboard.dart';
import 'package:healthcare_user/common/login.dart'; import 'package:healthcare_user/common/login.dart';
import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/common/settings.dart';
class OtpScreen extends StatefulWidget { class OtpScreen extends StatefulWidget {
@ -179,7 +180,7 @@ class _OtpScreenState extends State<OtpScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const Login()), builder: (context) => const Dashboard()),
); );
} }
else{ else{

@ -171,15 +171,15 @@ TextStyle drawerHeaderTextStyle() {
TextStyle drawerHeaderTextStyleNew() { TextStyle drawerHeaderTextStyleNew() {
return TextStyle(color: Colors.black, fontSize: 15); return TextStyle(color: Colors.black, fontSize: 15);
} }
TextStyle radioHeadingTextStyle() { TextStyle radioHeadingTextStyle() {
return TextStyle(color: Colors.white); return TextStyle(color: Colors.white);
} }
TextStyle radioItemsTextStyle() { TextStyle radioItemsTextStyle() {
return TextStyle(color: Colors.white,fontSize: 11); return TextStyle(color: Colors.white,fontSize: 11);
} }
InputDecoration textFormFieldDecoration(IconData icon, var text) { InputDecoration textFormFieldDecoration(IconData icon, var text) {
return InputDecoration( return InputDecoration(
filled: true, filled: true,
@ -223,7 +223,6 @@ InputDecoration textFormFieldDecorationGrey(IconData icon, var text) {
); );
} }
InputDecoration textFormFieldDecorationBMI(IconData icon, var text) { InputDecoration textFormFieldDecorationBMI(IconData icon, var text) {
return InputDecoration( return InputDecoration(
//filled: true, //filled: true,
@ -247,6 +246,7 @@ InputDecoration textFormFieldDecorationBMI(IconData icon, var text) {
} }
final GlobalKey<State> preloaderWindowKey = new GlobalKey<State>(); final GlobalKey<State> preloaderWindowKey = new GlobalKey<State>();
Future<void> preloaderWindow(BuildContext context) async { Future<void> preloaderWindow(BuildContext context) async {
try { try {
Dialogs.showLoadingDialog(context, preloaderWindowKey); Dialogs.showLoadingDialog(context, preloaderWindowKey);
@ -338,7 +338,6 @@ class AppSettings {
static String updateRecordsUrl = host + 'records'; static String updateRecordsUrl = host + 'records';
static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo'; static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo';
static String uploadReportMyselfPictureUrl = host + 'reportProblemPicture'; static String uploadReportMyselfPictureUrl = host + 'reportProblemPicture';
//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';
@ -354,8 +353,13 @@ class AppSettings {
static String getAllReportProblemDetalisUrl = host + 'userreport'; static String getAllReportProblemDetalisUrl = host + 'userreport';
static String deleteReportMySelfProblemUrl = host + 'deleteReportProblem'; static String deleteReportMySelfProblemUrl = host + 'deleteReportProblem';
static String getAllConnectedDoctorsDataUrl = host + 'connected-doctors'; static String getAllConnectedDoctorsDataUrl = host + 'connected-doctors';
static String getAllQuotationsDataUrl = host + 'getquotationsofUser';
static String getAllCartItemsUrl = host + 'getcartofParticularPharmacyAndUser';
static String getAllOffersUnderPharmacyDataUrl = host + 'getActivePharmacyOfferdata';
static String addDoctorUrl = host + 'user/connect-doctors'; static String addDoctorUrl = host + 'user/connect-doctors';
static String getDynamicCodeDataUrl = host + 'getDoctorInfo'; static String getDynamicCodeDataUrl = host + 'getDoctorInfo';
static String orderNowUrl = host + 'OrderNow';
static File? updatedImage; static File? updatedImage;
@ -554,8 +558,23 @@ class AppSettings {
body: json.encode(payload), body: json.encode(payload),
headers: {'Content-type': 'application/json'}); headers: {'Content-type': 'application/json'});
if (response.statusCode == 200) { if (response.statusCode == 200) {
return true; try {
} else { var _response = json.decode(response.body);
print(_response['simplydata']['error']);
if (_response['simplydata']['error'] == false) {
await saveAvailableReportAndLocationsInMemory(_response);
//await saveProfilePic(_response);
return true;
} else {
return false;
}
} catch (e) {
// display error toast
return false;
}
}
else {
return false; return false;
} }
} }
@ -1005,6 +1024,7 @@ class AppSettings {
var response = await http.Response.fromStream(res); var response = await http.Response.fromStream(res);
return response.body; return response.body;
} }
static Future<String> uploadBloodGroupImage(file) async { static Future<String> uploadBloodGroupImage(file) async {
var request = http.MultipartRequest( var request = http.MultipartRequest(
'POST', Uri.parse(uploadBloodGroupPicUrl + '/' + customerId)); 'POST', Uri.parse(uploadBloodGroupPicUrl + '/' + customerId));
@ -1235,13 +1255,6 @@ class AppSettings {
/*End*/ /*End*/
static Future<String> uploadImageForReports(file) async { static Future<String> uploadImageForReports(file) async {
var request = http.MultipartRequest( var request = http.MultipartRequest(
@ -1256,7 +1269,6 @@ class AppSettings {
return response.body; return response.body;
} }
static Future<String> uploadImageForFindingsCamera(file) async { static Future<String> uploadImageForFindingsCamera(file) async {
var request = http.MultipartRequest( var request = http.MultipartRequest(
@ -1267,7 +1279,6 @@ class AppSettings {
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));
@ -1277,7 +1288,6 @@ class AppSettings {
return response.body; return response.body;
} }
static Future<String> uploadReportMyselfPicture(file) async { static Future<String> uploadReportMyselfPicture(file) async {
var request = http.MultipartRequest('POST', Uri.parse(uploadReportMyselfPictureUrl + '/' + customerId)); var request = http.MultipartRequest('POST', Uri.parse(uploadReportMyselfPictureUrl + '/' + customerId));
@ -1472,7 +1482,6 @@ class AppSettings {
} }
} }
static Future<bool> addRecords(payload) async { static Future<bool> addRecords(payload) async {
var uri = Uri.parse(addRecordsUrl + '/' + customerId); var uri = Uri.parse(addRecordsUrl + '/' + customerId);
var response = await http.post(uri, var response = await http.post(uri,
@ -1561,7 +1570,6 @@ class AppSettings {
} }
} }
static Future<String> getAllRecords() async { static Future<String> getAllRecords() async {
var uri = Uri.parse(getRecordsDataUrl + '/' + customerId); var uri = Uri.parse(getRecordsDataUrl + '/' + customerId);
//uri = uri.replace(query: 'customerId=$customerId'); //uri = uri.replace(query: 'customerId=$customerId');
@ -1586,7 +1594,6 @@ class AppSettings {
} }
} }
static Future<bool> deleteRecord(recordId) async { static Future<bool> deleteRecord(recordId) async {
var uri = Uri.parse(deleteRecordUrl + '/' + recordId); var uri = Uri.parse(deleteRecordUrl + '/' + recordId);
@ -1616,7 +1623,6 @@ class AppSettings {
} }
} }
static Future<String> deleteFindings(fileName,findingsId) async { static Future<String> deleteFindings(fileName,findingsId) async {
var uri = Uri.parse(deleteFindingsUrl + '/' + customerId+'/'+findingsId+'/'+fileName); var uri = Uri.parse(deleteFindingsUrl + '/' + customerId+'/'+findingsId+'/'+fileName);
@ -1878,7 +1884,6 @@ class AppSettings {
} }
} }
static Future<bool> addReportMySelfProblem(payload) async { static Future<bool> addReportMySelfProblem(payload) async {
var uri = Uri.parse(addReportMySelfProblemUrl + '/' + customerId); var uri = Uri.parse(addReportMySelfProblemUrl + '/' + customerId);
var response = await http.post(uri, var response = await http.post(uri,
@ -1988,6 +1993,78 @@ class AppSettings {
} }
} }
static Future<String> getAllQuotations() async {
var uri = Uri.parse(getAllQuotationsDataUrl + '/' + 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> getAllCartItems(bookingId,payload) async {
var uri = Uri.parse(getAllCartItemsUrl + '/' +bookingId );
//uri = uri.replace(query: 'customerId=$customerId');
var response = await http.put(uri,body: json.encode(payload), 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.put(uri,body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else {
return '';
}
} else {
return '';
}
} else {
return '';
}
}
static Future<String> getAllOffersUnderPharmacy(pharmacyId) async {
var uri = Uri.parse(getAllOffersUnderPharmacyDataUrl + '/' + pharmacyId);
//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<bool> addDoctor(payload) async { static Future<bool> addDoctor(payload) async {
var uri = Uri.parse(addDoctorUrl + '/' + customerId); var uri = Uri.parse(addDoctorUrl + '/' + customerId);
var response = await http.post(uri, var response = await http.post(uri,
@ -2044,6 +2121,37 @@ class AppSettings {
} }
} }
static Future<bool> orderNow(payload,bookinId) async {
var uri = Uri.parse(orderNowUrl + '/' + bookinId+ '/' + customerId);
var response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 201) {
try {
var _response = json.decode(response.body);
print(_response);
return true;
} catch (e) {
// display error toast
return false;
}
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
/*Apis ends here*/ /*Apis ends here*/
@ -2055,7 +2163,7 @@ class AppSettings {
await saveData( await saveData(
'access_token', input['simplydata']['access_token'], 'STRING'); 'access_token', input['simplydata']['access_token'], 'STRING');
await saveData('phone', input['simplydata']['phone'], 'STRING'); await saveData('phone', input['simplydata']['phone'], 'STRING');
await saveData('email', input['simplydata']['email'][0]['email'], 'STRING'); await saveData('email', input['simplydata']['email'][0]['email']??'', 'STRING');
await saveData('customerId', input['simplydata']['customerId'], 'STRING'); await saveData('customerId', input['simplydata']['customerId'], 'STRING');
await saveData('profile', input['simplydata']['picture'], 'STRING'); await saveData('profile', input['simplydata']['picture'], 'STRING');
await saveData('user_address', input['simplydata']['address1'], 'STRING'); await saveData('user_address', input['simplydata']['address1'], 'STRING');
@ -2134,7 +2242,6 @@ class AppSettings {
} }
} }
static void longSuccessToast(String message) { static void longSuccessToast(String message) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: message, msg: message,
@ -2273,4 +2380,5 @@ class AppSettings {
});*/ });*/
}); });
} }
} }

@ -19,7 +19,7 @@ void main() async{
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Water Management', title: 'Health Care',
theme: new ThemeData( theme: new ThemeData(
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
), ),

@ -0,0 +1,35 @@
class CartItemsModel {
String medicine_name='';
String quantity='';
String price='';
List items=[];
CartItemsModel();
factory CartItemsModel.fromJson(Map<String, dynamic> json){
CartItemsModel rtvm = new CartItemsModel();
//rtvm.items=json['items']??[];
rtvm.medicine_name = json['medicinename']?? '';
rtvm.quantity =json['quantity'].toString()?? '';
rtvm.price = json['price'].toString()?? '';
return rtvm;
}
}

@ -0,0 +1,32 @@
import 'package:flutter/material.dart';
class GetAllOffersModel {
String description='';
String name='';
String code='';
String category='';
String startDate='';
String endDate='';
String picture='';
String pharmacy_id='';
bool isChecked=false;
GetAllOffersModel();
factory GetAllOffersModel.fromJson(Map<String, dynamic> json){
GetAllOffersModel rtvm = new GetAllOffersModel();
rtvm.description = json['description'] ?? '';
rtvm.name = json['offer_name'] ?? '';
rtvm.code = json['offer_code'] ?? '';
rtvm.category = json['category'] ?? '';
rtvm.startDate = json['starting_date'] ?? '';
rtvm.endDate = json['ending_date'] ?? '';
rtvm.picture = json['picture'][0]['url'] ?? '';
return rtvm;
}
}

@ -0,0 +1,38 @@
class GetAllQuotationsModel {
String bookingId='';
String pharmacyId='';
String pharmacyName='';
String pharmacyContactNumber='';
String pharmacy_address='';
List prescriptionImages=[];
GetAllQuotationsModel();
factory GetAllQuotationsModel.fromJson(Map<String, dynamic> json){
GetAllQuotationsModel rtvm = new GetAllQuotationsModel();
rtvm.bookingId = json['bookingId'] ?? '';
rtvm.pharmacyId = json['pharmacyId'] ?? '';
if(json['pharmacyInfo']!=null){
rtvm.pharmacyName = json['pharmacyInfo']['pharmacyname'] ?? '';
rtvm.pharmacyContactNumber = json['pharmacyInfo']['profile']['contactNumber'] ?? '';
rtvm.pharmacy_address = json['pharmacyInfo']['profile']['pharmacy_address'] ?? '';
}
else{
rtvm.pharmacyName = '';
rtvm.pharmacyContactNumber = '';
rtvm.pharmacy_address ='';
}
return rtvm;
}
}

@ -0,0 +1,79 @@
import 'dart:convert';
List<GetOffersDetailsModel> listdadFromJson(String str) => List<GetOffersDetailsModel >.from(json.decode(str).map((x) => GetOffersDetailsModel .fromJson(x)));
String listdadToJson(List<GetOffersDetailsModel > data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class GetOffersDetailsModel {
String ? description;
String ? starting_date;
String ? ending_date;
String ? offer_code;
List<Picture> picture;
String ? offer_name;
String ? category;
String ? pharmacyId;
String request_status='';
GetOffersDetailsModel ({
required this.description,
required this.starting_date,
required this.ending_date,
required this.offer_code,
required this.picture,
required this.offer_name ,
required this.category ,
required this.pharmacyId ,
required this.request_status ,
});
factory GetOffersDetailsModel .fromJson(Map<String, dynamic> json) => GetOffersDetailsModel (
description: json["description"],
starting_date: json["starting_date"],
ending_date: json["ending_date"],
offer_code: json["offer_code"],
category: json["category"],
picture: List<Picture>.from(json["picture"].map((x) => Picture.fromJson(x))),
offer_name : json["offer_name"],
pharmacyId : json["pharmacyId"],
request_status : json["request_status"],
);
Map<String, dynamic> toJson() => {
"description": description,
"starting_date": starting_date,
"ending_date": ending_date,
"offer_code": offer_code,
"picture": List<dynamic>.from(picture.map((x) => x.toJson())),
"offer_name": offer_name,
"category": category,
"pharmacyId": pharmacyId,
"request_status": request_status,
};
}
class Picture {
String id;
String url;
Picture({
required this.id,
required this.url,
});
factory Picture.fromJson(Map<String, dynamic> json) => Picture(
id: json["_id"],
url: json["url"],
);
Map<String, dynamic> toJson() => {
"_id": id,
"url": url,
};
}

@ -132,6 +132,7 @@ class _AddDoctorState extends State<AddDoctor> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: nameController, controller: nameController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person, Icons.person,
@ -252,6 +253,7 @@ class _AddDoctorState extends State<AddDoctor> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: qualificationController, controller: qualificationController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.quickreply, Icons.quickreply,
@ -277,6 +279,7 @@ class _AddDoctorState extends State<AddDoctor> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: specializationController, controller: specializationController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.folder_special, Icons.folder_special,
@ -319,6 +322,7 @@ class _AddDoctorState extends State<AddDoctor> {
TextFormField( TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: hospitalNameController1, controller: hospitalNameController1,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.location_city, Icons.location_city,
@ -342,6 +346,7 @@ class _AddDoctorState extends State<AddDoctor> {
TextFormField( TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: practiceAddressController1, controller: practiceAddressController1,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.location_on, Icons.location_on,
@ -397,6 +402,7 @@ class _AddDoctorState extends State<AddDoctor> {
TextFormField( TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: hospitalNameController2, controller: hospitalNameController2,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.location_city, Icons.location_city,
@ -420,6 +426,7 @@ class _AddDoctorState extends State<AddDoctor> {
TextFormField( TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: practiceAddressController2, controller: practiceAddressController2,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.location_on, Icons.location_on,
@ -475,6 +482,7 @@ class _AddDoctorState extends State<AddDoctor> {
TextFormField( TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: hospitalNameController3, controller: hospitalNameController3,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.location_city, Icons.location_city,
@ -498,6 +506,7 @@ class _AddDoctorState extends State<AddDoctor> {
TextFormField( TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: practiceAddressController3, controller: practiceAddressController3,
textCapitalization: TextCapitalization.words,
onChanged:(val) { onChanged:(val) {
}, },

@ -74,107 +74,86 @@ class _AllConnectionsState extends State<AllConnections>
//color: prescriptionsList[index].cardColor, //color: prescriptionsList[index].cardColor,
child: Padding( child: Padding(
padding:EdgeInsets.all(8) , padding:EdgeInsets.all(10) ,
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(
'Doctor Name',
style: labelTextStyle(),
),
Container( SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Specialization',
child: Row( style: labelTextStyle(),
children: [ ),
Column( SizedBox(height:MediaQuery.of(context).size.height * .01,),
mainAxisAlignment: MainAxisAlignment.start, Text(
crossAxisAlignment: CrossAxisAlignment.start, 'Qualification',
children: [ style: labelTextStyle(),
Text( ),
'Doctor Name', SizedBox(height:MediaQuery.of(context).size.height * .01,),
style: labelTextStyle(), Text(
), 'Hospital',
SizedBox(height:MediaQuery.of(context).size.height * .01,), style: labelTextStyle(),
Text( ),
'Hospital',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Specialization',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Qualification',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
],
),
SizedBox(width:MediaQuery.of(context).size.width * .01,),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
],
),
SizedBox(width:MediaQuery.of(context).size.width * .01,),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(connectedDoctorsListOriginal[index].doctor_name.toString().toUpperCase(),style: valuesTextStyle()),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
connectedDoctorsListOriginal[index].hospital_name,
style: valuesTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
connectedDoctorsListOriginal[index].specialization,
style: valuesTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
connectedDoctorsListOriginal[index].qualification,
style: valuesTextStyle(),
),
],
),
],
),
],
),
SizedBox(width:MediaQuery.of(context).size.width * .01,),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
), ),
], ],
),
SizedBox(width:MediaQuery.of(context).size.width * .01,),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(connectedDoctorsListOriginal[index].doctor_name.toString().toUpperCase(),style: valuesTextStyle()),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
connectedDoctorsListOriginal[index].specialization,
style: valuesTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
connectedDoctorsListOriginal[index].qualification,
style: valuesTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
connectedDoctorsListOriginal[index].hospital_name,
style: valuesTextStyle(),
),
],
), ),
], ],
), ),

@ -0,0 +1,345 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/common/zoom_image.dart';
import 'package:healthcare_user/models/cart_items_model.dart';
import 'package:healthcare_user/models/get_all_offers_model.dart';
import 'package:healthcare_user/models/get_connected_doctors_model.dart';
import 'package:healthcare_user/models/get_offer_details_model.dart';
import 'package:healthcare_user/my_connections/add-doctor.dart';
import 'package:healthcare_user/orders/cart-items.dart';
import '../models/get_all_quotations.dart';
class CartItems extends StatefulWidget {
var myObject;
CartItems({this.myObject});
@override
State<CartItems> createState() => _CartItemsState();
}
class _CartItemsState extends State<CartItems>
with TickerProviderStateMixin {
late TabController _controller;
bool isDataLoading = false;
bool isOffersLoading = false;
bool isSereverIssue = false;
String bookingId='';
String totalCartPrice='';
String totalCartPriceAfterDiscount='';
final List<Tab> topTabs = <Tab>[
Tab(
child: Text(
'Pending',
style: TextStyle(fontSize: 14),
)),
Tab(
child: Text(
'Completed',
style: TextStyle(fontSize: 14),
)),
];
List<CartItemsModel> cartItemsList = [];
@override
void initState() {
_controller = TabController(vsync: this, length: topTabs.length);
getAllCartItems();
super.initState();
}
Future<void> getAllCartItems() async {
isDataLoading = true;
try {
var payload = new Map<String, dynamic>();
payload["pharmacyId"] = widget.myObject.pharmacyId;
payload["customerId"] =AppSettings.customerId;
var response = await AppSettings.getAllCartItems(widget.myObject.bookingId,payload);
setState(() {
cartItemsList =
((jsonDecode(response)['data'][0]['items']) as List).map((dynamic model) {
return CartItemsModel.fromJson(model);
}).toList();
cartItemsList = cartItemsList.reversed.toList();
bookingId=jsonDecode(response)['data'][0]['bookingId'];
totalCartPrice=jsonDecode(response)['data'][0]['totalCartPrice'].toString();
totalCartPriceAfterDiscount=jsonDecode(response)['data'][0]['totalCartPriceAfterDiscount'].toString();
isDataLoading = false;
});
} catch (e) {
setState(() {
isDataLoading = false;
isSereverIssue = true;
});
}
}
Widget _cartItems() {
if (cartItemsList.length != 0) {
return Column(
children: [
Expanded(child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: cartItemsList.length,
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
onTap: () async{
},
child: Card(
//color: prescriptionsList[index].cardColor,
child: Padding(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Medicine Name',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
'Quantity',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
'Price',
style: labelTextStyle(),
),
],
),
SizedBox(
width: MediaQuery.of(context).size.width * .01,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
':',
style: labelTextStyle(),
),
],
),
SizedBox(
width: MediaQuery.of(context).size.width * .01,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
cartItemsList[index]
.medicine_name
.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
cartItemsList[index].quantity,
style: valuesTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
cartItemsList[index]
.price
,
style: valuesTextStyle(),
),
],
),
],
),
],
)),
),
);
})),
Container(
width:double.infinity,
height: MediaQuery.of(context).size.height * .06,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Total cart price: $totalCartPrice'),
Text('Total cart price after discount: $totalCartPriceAfterDiscount'),
],
),
)),
SizedBox(height:MediaQuery.of(context).size.height * .02,),
Container(
width:double.infinity,
height: MediaQuery.of(context).size.height * .06,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
AppSettings.preLoaderDialog(context);
bool isOnline = await AppSettings.internetConnectivity();
if(isOnline){
var payload = new Map<String, dynamic>();
payload["user"] = {"profile": {"firstName": AppSettings.userName.toString(),
"lastName": '',
"contactNumber": AppSettings.phoneNumber.toString(),
"address1": AppSettings.userAddress.toString(),
"address2": AppSettings.detailedAddress.toString(),
"country": ''
},};
payload["pharmacies"] = [
{
"pharmacyId": widget.myObject.pharmacyId.toString(),
"pharmacyname": widget.myObject.pharmacyName.toString(),
"phone":widget.myObject.pharmacyContactNumber.toString(),
"profile": "?"
}
];
payload["prescriptionPicture"] =
{
"pictureUrl": [
"string"
]
};
payload["amount"] =
{
"biddingAmount": totalCartPriceAfterDiscount!='null'?int.parse(totalCartPriceAfterDiscount):0,
"totalAmount": totalCartPrice!='null'?int.parse(totalCartPrice):0,
"discountAmount":0,
};
bool orderStatus = await AppSettings.orderNow(payload,widget.myObject.bookingId);
try {
if(orderStatus){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast("order placed successfully");
}
else{
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast("failed to order");
}
} catch (exception) {
print(exception);
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast("failed to order");
}
}
else{
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast(
"Please check your internet");
}
},
child: Text('Order now'),
)),
],
);
} 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('No Cart items found'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () async {},
),
)
],
),
));
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Cart Items'),
backgroundColor: primaryColor,
),
body: Container(
child: Padding(
padding: EdgeInsets.all(10),
child: isDataLoading
? Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
)
: _cartItems(),
),
),
);
}
}

@ -0,0 +1,805 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_user/common/settings.dart';
import 'package:healthcare_user/common/zoom_image.dart';
import 'package:healthcare_user/models/get_all_offers_model.dart';
import 'package:healthcare_user/models/get_connected_doctors_model.dart';
import 'package:healthcare_user/models/get_offer_details_model.dart';
import 'package:healthcare_user/my_connections/add-doctor.dart';
import 'package:healthcare_user/orders/cart-items.dart';
import '../models/get_all_quotations.dart';
class AllQuotations extends StatefulWidget {
const AllQuotations({Key? key}) : super(key: key);
@override
State<AllQuotations> createState() => _AllQuotationsState();
}
class _AllQuotationsState extends State<AllQuotations>
with TickerProviderStateMixin {
late TabController _controller;
bool isDataLoading = false;
bool isOffersLoading = false;
bool isSereverIssue = false;
final List<Tab> topTabs = <Tab>[
Tab(
child: Text(
'Pending',
style: TextStyle(fontSize: 14),
)),
Tab(
child: Text(
'Completed',
style: TextStyle(fontSize: 14),
)),
];
List<GetAllQuotationsModel> quotationsListOriginal = [];
List<GetAllOffersModel> offersListOriginal = [];
List<GetOffersDetailsModel> offersList = [];
List pharmaciesCheckboxes = [];
List pharmaciesCheckboxesInDialog = [];
List selectedPharmacies = [];
@override
void initState() {
_controller = TabController(vsync: this, length: topTabs.length);
getAllQuotations();
super.initState();
}
Future<void> getAllQuotations() async {
isDataLoading = true;
try {
var response = await AppSettings.getAllQuotations();
setState(() {
quotationsListOriginal =
((jsonDecode(response)['data']) as List).map((dynamic model) {
return GetAllQuotationsModel.fromJson(model);
}).toList();
quotationsListOriginal = quotationsListOriginal.reversed.toList();
isDataLoading = false;
});
} catch (e) {
setState(() {
isDataLoading = false;
isSereverIssue = true;
});
}
}
Future<void> getAllOffers(pharmacyId) async {
isOffersLoading = true;
try {
var response = await AppSettings.getAllOffersUnderPharmacy(pharmacyId);
setState(() {
offersListOriginal =
((jsonDecode(response)['data']) as List).map((dynamic model) {
return GetAllOffersModel.fromJson(model);
}).toList();
offersListOriginal = offersListOriginal.reversed.toList();
isOffersLoading = false;
});
} catch (e) {
setState(() {
isOffersLoading = false;
isSereverIssue = true;
});
}
}
Widget _pendingQuotations() {
if (quotationsListOriginal.length != 0) {
return ListView.builder(
padding: EdgeInsets.all(0),
itemCount: quotationsListOriginal.length,
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
onTap: () async{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CartItems(myObject: quotationsListOriginal[index],)),
);
},
child: Card(
//color: prescriptionsList[index].cardColor,
child: Padding(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Booking Id',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
'Pharmacy Name',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
'Pharmacy ContactNumber',
style: labelTextStyle(),
),
],
),
SizedBox(
width: MediaQuery.of(context).size.width * .01,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
':',
style: labelTextStyle(),
),
],
),
SizedBox(
width: MediaQuery.of(context).size.width * .01,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
quotationsListOriginal[index]
.bookingId
.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
quotationsListOriginal[index].pharmacyName,
style: valuesTextStyle(),
),
SizedBox(
height:
MediaQuery.of(context).size.height * .01,
),
Text(
quotationsListOriginal[index]
.pharmacyContactNumber,
style: valuesTextStyle(),
),
],
),
],
),
/*ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColors, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
await getAllOffers(quotationsListOriginal[index]
.pharmacyId
.toString());
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
child: isOffersLoading
? Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
)
: _offersData(),
);
});
},
child: Text('Check Offers'),
),*/
],
)),
),
);
});
} 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('No pending quotations'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () async {},
),
)
],
),
));
}
}
Widget _offers() {
if (offersListOriginal.length != 0) {
return ListView.builder(
padding: EdgeInsets.all(10),
itemCount: offersListOriginal.length,
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
onTap: () {},
child: Card(
//color: prescriptionsList[index].cardColor,
child: Padding(
padding: EdgeInsets.all(10),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Row(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Booking Id',
style: labelTextStyle(),
),
/*
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Specialization',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Qualification',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
'Hospital',
style: labelTextStyle(),
),*/
],
),
SizedBox(
width: MediaQuery.of(context).size.width * .01,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
':',
style: labelTextStyle(),
),
/* SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
':',
style: labelTextStyle(),
),*/
],
),
SizedBox(
width: MediaQuery.of(context).size.width * .01,
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
offersListOriginal[index]
.description
.toString()
.toUpperCase(),
style: valuesTextStyle()),
/* SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
quotationsListOriginal[index].specialization,
style: valuesTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
quotationsListOriginal[index].qualification,
style: valuesTextStyle(),
),
SizedBox(height:MediaQuery.of(context).size.height * .01,),
Text(
quotationsListOriginal[index].hospital_name,
style: valuesTextStyle(),
),*/
],
),
],
),
],
)),
),
);
});
} 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('No pending quotations'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.info,
color: Colors.white,
),
onPressed: () async {},
),
)
],
),
));
}
}
Widget _offersData() {
if (offersListOriginal.length != 0) {
return Container(
color: Colors.white60,
child: Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
Expanded(
child: GridView.builder(
itemCount: offersListOriginal.length,
itemBuilder: (context, index) {
return Card(
color: Colors.white,
elevation: 3.0,
child: CheckboxListTile(
title: Padding(
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
Expanded(
child: GestureDetector(
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) =>
new ImageZoomPage(
imageName: 'Reports',
imageDetails:
offersListOriginal[
index]
.picture)));
},
child: Container(
width: MediaQuery.of(context).size.width *
.18,
height:
MediaQuery.of(context).size.height *
.10,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
image: offersListOriginal[index]
.picture ==
''
? AssetImage(
"images/logo.png")
: NetworkImage(
offersListOriginal[
index]
.picture)
as ImageProvider, // picked file
fit: BoxFit.contain)),
),
),
),
],
),
SizedBox(
width: 5,
),
Expanded(
child: Container(
//width: MediaQuery.of(context).size.width * .70,
child: Row(
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Name',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
'Code',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
'Description',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
'Category',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
'Start Date',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
'End Date',
style: labelTextStyle(),
),
],
),
SizedBox(
width: MediaQuery.of(context).size.width *
.01,
),
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
':',
style: labelTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
':',
style: labelTextStyle(),
),
],
),
SizedBox(
width: MediaQuery.of(context).size.width *
.01,
),
Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
offersListOriginal[index]
.name
.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
offersListOriginal[index].code,
style: valuesTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
offersListOriginal[index].description,
style: valuesTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
offersListOriginal[index].category,
style: valuesTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
offersListOriginal[index].startDate,
style: valuesTextStyle(),
),
SizedBox(
height: MediaQuery.of(context)
.size
.height *
.01,
),
Text(
offersListOriginal[index].endDate,
style: valuesTextStyle(),
),
],
),
],
),
),
),
],
)),
checkColor: Colors.white,
activeColor: primaryColor,
value: offersListOriginal[index].isChecked,
onChanged: (val) {
setState(
() {
offersListOriginal[index].isChecked = val!;
},
);
/*if (offersListOriginal[index].isChecked) {
pharmaciesCheckboxes.add({
'pharmacyId': offersListOriginal[index].pharmacy_id,
});
selectedPharmacies.add(offersListOriginal[index]);
} else {
pharmaciesCheckboxes.removeWhere((e) =>
e['pharmacyId'].toString().toUpperCase() ==
offersListOriginal[index]
.pharmacy_id
.toString()
.toUpperCase());
selectedPharmacies.remove(offersListOriginal[index]);
}*/
},
),
);
},
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 1, //.size.width * .33,
childAspectRatio: MediaQuery.of(context).size.width /
(MediaQuery.of(context).size.height / 5)),
),
),
]),
);
} else {
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: isSereverIssue
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image(
image: AssetImage('images/serverissue.png'),
// height: MediaQuery.of(context).size.height * .10,
),
SizedBox(
height: 20,
),
Text(
'There is an issue at server please try after some time',
style: serverIssueTextStyle(),
),
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
/*Image(
image: AssetImage('images/resourceblue.pngs'),
// height: MediaQuery.of(context).size.height * .10,
),*/
Icon(
Icons.info,
color: primaryColor,
size: 40,
),
SizedBox(
height: 20,
),
Text(
'No offers available',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
),
),
],
)));
}
}
Widget _pharmacies() {
return Container();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('All Quotations'),
backgroundColor: primaryColor,
bottom: TabBar(
controller: _controller,
tabs: topTabs,
indicatorColor: buttonColors,
unselectedLabelColor: Colors.white60,
indicatorWeight: 2,
),
),
body: Container(
child: TabBarView(controller: _controller, children: [
Padding(
padding: EdgeInsets.all(10),
child: isDataLoading
? Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
)
: _pendingQuotations(),
),
Padding(
padding: EdgeInsets.all(10),
)
]),
),
);
}
}

@ -42,6 +42,8 @@ class _ReportMySelfState extends State<ReportMySelf> {
String recordingTime = '0:0'; // to store value String recordingTime = '0:0'; // to store value
bool isRecording = false; bool isRecording = false;
String problemPictureUrl=''; String problemPictureUrl='';
DateTime now=DateTime.now();
String formattedDate = '';
void initializer() async { void initializer() async {
pathToAudio = '/sdcard/Download/temp.wav'; pathToAudio = '/sdcard/Download/temp.wav';
@ -58,9 +60,17 @@ class _ReportMySelfState extends State<ReportMySelf> {
await Permission.manageExternalStorage.request(); await Permission.manageExternalStorage.request();
} }
void initialDate(){
setState(() {
formattedDate=DateFormat('dd-MM-yyyy').format(now);
});
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
initialDate();
dateInput.text=formattedDate;
_controller = VideoPlayerController.networkUrl( _controller = VideoPlayerController.networkUrl(
Uri.parse(videoUrl,), Uri.parse(videoUrl,),
); );
@ -287,7 +297,7 @@ class _ReportMySelfState extends State<ReportMySelf> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
), ),
labelText: 'Enter problem name', labelText: 'Enter problem (if any)',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -769,7 +779,7 @@ class _ReportMySelfState extends State<ReportMySelf> {
}, },
child: const Text('Report a problem'), child: const Text('Save this in report my self'),
)), )),

@ -195,7 +195,7 @@ class _UpdateMyLocationState extends State<UpdateMyLocation> {
cursorColor: greyColor, cursorColor: greyColor,
controller: userAddressDescriptionController, controller: userAddressDescriptionController,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
decoration: textFormFieldDecoration(Icons.plagiarism_outlined,'Address Description (Ex: Flat No)'), decoration: textFormFieldDecorationGrey(Icons.plagiarism_outlined,'Address Description (Ex: Flat No)'),
), ),
), ),

Loading…
Cancel
Save