Add&Offers&Cart Added

dev
suresh 1 year ago
parent 4eb06ee8e5
commit 281bd46f0a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

@ -0,0 +1,276 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:geolocator/geolocator.dart';
import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/models/biddingrequest_model.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:image_picker/image_picker.dart';
import 'package:photo_view/photo_view.dart';
class BiddingRequests extends StatefulWidget {
const BiddingRequests({Key? key}) : super(key: key);
@override
State<BiddingRequests> createState() => _BiddingRequestsState();
}
class _BiddingRequestsState extends State<BiddingRequests> {
String Url = '';
List<BiddingRequestsModel> prescriptionsList = [];
List<BiddingRequestsModel> prescriptionsListOriginal = [];
bool isPrescriptionsDataLoading = false;
bool isSereverIssue = false;
bool isLoading=false;
Future<void> getAllPrescriptions() async {
isPrescriptionsDataLoading=true;
try {
var response = await AppSettings.getAllBiddingRecords();
print(response);
setState(() {
prescriptionsList =
((jsonDecode(response)['data']) as List).map((dynamic model) {
return BiddingRequestsModel.fromJson(model);
}).toList();
isPrescriptionsDataLoading = false;
});
} catch (e) {
setState(() {
isLoading = false;
isPrescriptionsDataLoading = false;
});
}
}
@override
void initState() {
getAllPrescriptions();
//getAllPharmaciesData(dropdownArea);
super.initState();
}
showPicDialog(var imageUrl){
return showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return AlertDialog(
title: const Text(''),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * .10,
height: MediaQuery.of(context).size.height * .50,
child: PhotoView(
imageProvider: NetworkImage(imageUrl) as ImageProvider,
maxScale: PhotoViewComputedScale.contained * 4.0,
minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained,
basePosition: Alignment.center,
)
)
],
),
),
actions: <Widget>[
TextButton(
child: Text('Close', style: textButtonStyle()),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
});
},
);
}
Widget _allPrescriptions(){
if (prescriptionsList.length != 0) {
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:ListView.builder(
padding: EdgeInsets.all(0),
itemCount: prescriptionsList.length,
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
onTap: (){
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new GetMedicines(medicinebookingid:prescriptionsList[index].bidding_bookingid)));
},
child: Card(
//color: prescriptionsList[index].cardColor,
child: Padding(
padding:EdgeInsets.all(8) ,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Container(
width: MediaQuery.of(context).size.width * .18,
height:
MediaQuery.of(context).size.height * .10,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: (AppSettings.updatedImage != null) ? FileImage(AppSettings.updatedImage!) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file
fit: BoxFit.cover)),
/* decoration: BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
image: NetworkImage(prescriptionsList[index].prescription_url) as ImageProvider, // picked file
fit: BoxFit.contain)),*/
),
onTap: (){
// showPicDialog(prescriptionsList[index].prescription_url);
},
),
SizedBox(width:MediaQuery.of(context).size.width * .02,),
Container(
width: MediaQuery.of(context).size.width * .55,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(prescriptionsList[index].custumerid_bidding.toString().toUpperCase(),style: valuesTextStyle()),
Text(prescriptionsList[index].pharmacyid_bidding.toString().toUpperCase(),style: valuesTextStyle()),
Text(prescriptionsList[index].amount_bidding.toString().toUpperCase(),style: valuesTextStyle()),
Text(prescriptionsList[index].bidding_bookingid.toString().toUpperCase(),style: valuesTextStyle()),
],
),
),
Visibility(
//visible:offersviewList[index].orderStatus.toString().toLowerCase()=='pending',
child: Column(
children: [
TextButton(
child: Text(
'Accept',
style: TextStyle(
fontSize: 15,
color:
primaryColor /*FilteredList[index].text_color*/),
),
onPressed: () async {
var payload = new Map<String, dynamic>();
payload["customerId"] = prescriptionsList[index].custumerid_bidding.toLowerCase();
payload["pharmacyId"] =AppSettings.healthpharmaIdsign.toLowerCase();
bool requestStatus =
await AppSettings.getRequestBiddingDetails(
prescriptionsList[index].bidding_bookingid.toLowerCase(),
payload);
if(requestStatus){
AppSettings.longSuccessToast("Request Accepted Successfully");
await getAllPrescriptions();
}
else{
}
},
),
TextButton(
child: Text(
'Reject',
style: TextStyle(
fontSize: 15,
color:
primaryColor /*FilteredList[index].text_color*/),
),
onPressed: () async {
},
),
],
))
],
),
/*TextButton(
child: const Text(
'Order Medicines',
style: TextStyle(color: primaryColor),
),
onPressed: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new OrderMedicines(prescriptionDetails:prescriptionsList[index])));
//signup screen
},
)*/
],
),
),
),
);
}) ),
]);
}
else{
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
],
),
)
);
}
}
/**/
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('BiddingRequests'),
body: isPrescriptionsDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
): _allPrescriptions(),
);
}
}

@ -5,9 +5,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:healthcare_pharmacy/getmedicines.dart'; import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/inactiveoffersview.dart'; import 'package:healthcare_pharmacy/inactiveoffersview.dart';
import 'package:healthcare_pharmacy/medicinecart.dart';
import 'package:healthcare_pharmacy/offers.dart'; import 'package:healthcare_pharmacy/offers.dart';
import 'package:healthcare_pharmacy/offersdata.dart'; import 'package:healthcare_pharmacy/offerstabdata.dart';
import 'package:healthcare_pharmacy/offersview.dart'; import 'package:healthcare_pharmacy/offersview.dart';
import 'package:healthcare_pharmacy/biddingrequests.dart';
import 'package:healthcare_pharmacy/updateprofile.dart'; import 'package:healthcare_pharmacy/updateprofile.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
@ -119,7 +121,22 @@ class _DashboardState extends State<Dashboard> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
CarouselSlider( Container(
height: MediaQuery.of(context).size.height * .250,
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(0),
),
//color: Colors.red,
child: FittedBox(
child:Image(
image: const AssetImage('images/mobilebg2.png'),
),
fit: BoxFit.fill,
)
),
/*CarouselSlider(
options: CarouselOptions( options: CarouselOptions(
height: MediaQuery.of(context).size.height * .250, height: MediaQuery.of(context).size.height * .250,
aspectRatio: 16 / 9, aspectRatio: 16 / 9,
@ -154,7 +171,7 @@ class _DashboardState extends State<Dashboard> {
}, },
); );
}).toList(), }).toList(),
), ),*/
SizedBox(height: 5), SizedBox(height: 5),
Expanded(child: Container( Expanded(child: Container(
padding: EdgeInsets.all(12.0), padding: EdgeInsets.all(12.0),
@ -334,6 +351,7 @@ class _DashboardState extends State<Dashboard> {
MediaQuery.of(context).size.height * .25, MediaQuery.of(context).size.height * .25,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(width: 2 , color: Colors.blueGrey),
image: DecorationImage( image: DecorationImage(
image: (AppSettings.profilePictureUrl != image: (AppSettings.profilePictureUrl !=
'' && '' &&
@ -607,7 +625,7 @@ class _DashboardState extends State<Dashboard> {
Divider( Divider(
color: Colors.grey, color: Colors.grey,
), ),
/*ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [
Image( Image(
@ -618,7 +636,7 @@ class _DashboardState extends State<Dashboard> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Text('InActiveOffersView', style: TextStyle(color: Colors.black)), Text('BiddingRequests', style: TextStyle(color: Colors.black)),
], ],
), ),
onTap: () { onTap: () {
@ -626,7 +644,7 @@ class _DashboardState extends State<Dashboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const InActiveOffersView()), builder: (context) => MedicineCartList()),
); );
@ -635,8 +653,8 @@ class _DashboardState extends State<Dashboard> {
), ),
Divider( Divider(
color: Colors.grey, color: Colors.grey,
),*/ ),
ListTile( /* ListTile(
title: Row( title: Row(
children: const [ children: const [
Image( Image(
@ -655,7 +673,7 @@ class _DashboardState extends State<Dashboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const GetMedicines()), builder: (context) => GetMedicines()),
); );
@ -664,7 +682,7 @@ class _DashboardState extends State<Dashboard> {
), ),
Divider( Divider(
color: Colors.grey, color: Colors.grey,
), ),*/
ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [

@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:healthcare_pharmacy/medicinedetailspage.dart';
import 'package:healthcare_pharmacy/models/GetMedecineDetailsModel.dart'; import 'package:healthcare_pharmacy/models/GetMedecineDetailsModel.dart';
import 'package:healthcare_pharmacy/settings.dart'; import 'package:healthcare_pharmacy/settings.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -11,7 +12,11 @@ import 'package:photo_view/photo_view.dart';
class GetMedicines extends StatefulWidget { class GetMedicines extends StatefulWidget {
const GetMedicines({Key? key}) : super(key: key); var medicinebookingid;
GetMedicines({
this.medicinebookingid
});
@override @override
State<GetMedicines> createState() => _GetMedicinesState(); State<GetMedicines> createState() => _GetMedicinesState();
@ -30,6 +35,8 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
String medicine_salt_composition=''; String medicine_salt_composition='';
String medicine_mrp=''; String medicine_mrp='';
String medicine_primary_use=''; String medicine_primary_use='';
String medbookingid = '';
List medImages=[]; List medImages=[];
@ -79,10 +86,10 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
medbookingid=widget.medicinebookingid;
} }
showPicDialog(var imageUrl){ showPicDialog(var imageUrl){
return showDialog( return showDialog(
context: context, context: context,
@ -124,121 +131,6 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
); );
} }
/*Widget _bindMedicines(){
if (medecineList.length != 0) {
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:ListView.builder(
padding: EdgeInsets.all(0),
itemCount: medecineList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
//color: prescriptionsList[index].cardColor,
child: Padding(
padding:EdgeInsets.all(8) ,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Container(
width: MediaQuery.of(context).size.width * .18,
height:
MediaQuery.of(context).size.height * .10,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
image: DecorationImage(
image: NetworkImage(medImages[0]) as ImageProvider, // picked file
fit: BoxFit.contain)),
),
onTap: (){
showPicDialog(medImages[0]);
},
),
SizedBox(width:MediaQuery.of(context).size.width * .02,),
Container(
width: MediaQuery.of(context).size.width * .55,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(("Name :"+ medicine_name).toString().toUpperCase(),style: valuesTextStyle()),
Text(("Manufacturers :"+ medicine_manufacturers).toString().toUpperCase(),style: valuesTextStyle()),
Text(("Estimate Price :"+ medicine_mrp).toString().toUpperCase(),style: valuesTextStyle()),
Text(("Medicine_Use :"+ medicine_primary_use).toString().toUpperCase(),style: valuesTextStyle()),
],
),
),
],
),
],
),
),
);
}) ),
]);
}
else{
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: isSereverIssue
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 20,
),
Text(
'No medicine found with your search',style:serverIssueTextStyle() ,),
],
)
: userAddress==''?Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.search,color: primaryColor,size: 40,),
SizedBox(
height: 20,
),
Text(
'Please enter atleast 4 letters to continue search',style:TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
),),
],
):
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.dataset_rounded,color: primaryColor,size: 40,),
SizedBox(
height: 20,
),
SizedBox(
height: 20,
),
Text(
'No medicine found with your search',style:serverIssueTextStyle() ,),
],
),
));
}
}*/
Widget _bindMedicines() { Widget _bindMedicines() {
if (medicine_name!='') { if (medicine_name!='') {
return Padding(padding: EdgeInsets.all(10), return Padding(padding: EdgeInsets.all(10),
@ -260,12 +152,14 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
image: NetworkImage(medImages[0]) as ImageProvider, // picked file image: NetworkImage(medImages[0]) as ImageProvider, // picked file
fit: BoxFit.contain)), fit: BoxFit.contain)),
), ),
onTap: (){ onTap: () async {
showPicDialog(medImages[0]); showPicDialog(medImages[0]);
}, },
), ),
GestureDetector(
child: Column(
children: [
Text(("Name :"+ medicine_name), Text(("Name :"+ medicine_name),
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
@ -282,6 +176,23 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
Text(("Medicine_Use :"+ medicine_primary_use), Text(("Medicine_Use :"+ medicine_primary_use),
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
],
),
onTap: () {
/* Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new MedicineDetailsCount()));*/
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new MedicineDetails(name: medicine_name,price: medicine_mrp,bookid:medbookingid)));
},
),
], ],
), ),

@ -114,7 +114,7 @@ class _InActiveOffersViewState extends State<InActiveOffersView> with TickerProv
Text(offersviewList[index].offer_name,style: valuesTextStyle()), Text(offersviewList[index].offer_name,style: valuesTextStyle()),
Text(offersviewList[index].offer_code,style: valuesTextStyle()), Text(offersviewList[index].offer_code,style: valuesTextStyle()),
Text(offersviewList[index].description,style: valuesTextStyle()), Text(offersviewList[index].description,style: valuesTextStyle()),
Text(offersviewList[index].discount_percentage,style: valuesTextStyle()), Text(offersviewList[index].offer,style: valuesTextStyle()),
Text(offersviewList[index].starting_date,style: valuesTextStyle()), Text(offersviewList[index].starting_date,style: valuesTextStyle()),
Text(offersviewList[index].ending_date,style: valuesTextStyle()) Text(offersviewList[index].ending_date,style: valuesTextStyle())

@ -88,7 +88,7 @@ class _LoginState extends State<Login> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const SizedBox( const SizedBox(
height: 15, height: 55,
), ),
Container( Container(
//width: double.infinity, //width: double.infinity,
@ -107,11 +107,7 @@ class _LoginState extends State<Login> {
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
maxLength: 10, maxLength: 10,
decoration: textFormFieldDecoration(Icons.phone,'Enter MobileNumber'), decoration: textFormFieldDecoration(Icons.phone,'Enter MobileNumber'),
),
), ),
const SizedBox(
height: 15,
), ),
Container( Container(
@ -207,13 +203,13 @@ class _LoginState extends State<Login> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => const Dashboard()), builder: (context) => const Dashboard()),
); );
// AppSettings.longSuccessToast("Logged in Successfully"); AppSettings.longSuccessToast("Logged in Successfully");
mobileNumberController.text=''; mobileNumberController.text='';
passwordController.text=''; passwordController.text='';
} else { } else {
Navigator.of(context,rootNavigator: true).pop(); Navigator.of(context,rootNavigator: true).pop();
//AppSettings.longFailedToast("Please enter valid details"); AppSettings.longFailedToast("Please enter valid details");
} }
} }
catch(exception){ catch(exception){
@ -223,14 +219,14 @@ class _LoginState extends State<Login> {
} }
else{ else{
Navigator.of(context,rootNavigator: true).pop(); Navigator.of(context,rootNavigator: true).pop();
// AppSettings.longFailedToast("Please Check internet"); AppSettings.longFailedToast("Please Check internet");
} }
} }
else{ else{
//AppSettings.longFailedToast("Please enter valid details"); AppSettings.longFailedToast("Please enter valid details");
} }
}, },

@ -0,0 +1,340 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/biddingrequests.dart';
import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/maps/app_colors.dart';
import 'package:healthcare_pharmacy/medicinedetailspage.dart';
import 'package:healthcare_pharmacy/models/biddingrequest_model.dart';
import 'package:healthcare_pharmacy/models/cartview_model.dart';
import 'package:healthcare_pharmacy/models/offersview_model.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
class MedicineCartList extends StatefulWidget {
var bookidcart;
MedicineCartList({
this.bookidcart
});
@override
State<MedicineCartList> createState() => _MedicineCartListState();
}
class _MedicineCartListState extends State<MedicineCartList> with TickerProviderStateMixin {
bool isSupplierDataLoading=false;
bool isSereverIssue = false;
bool isSereverIssueConnected = false;
bool isSereverIssuePending = false;
var startdate;
var enddate;
String totalPrice='';
String medicinetime='';
String bookingidstring='';
bool isLoading=false;
List<BiddingCartviewModel> offersviewList = [];
TextEditingController medicine_nameController = TextEditingController();
TextEditingController medicine_quantityController = TextEditingController();
TextEditingController medicine_priceController = TextEditingController();
TextEditingController medicine_timingsController = TextEditingController();
Future<void> getCartViewData() async {
isLoading = true;
try {
var response = await AppSettings.getCartDetails(widget.bookidcart).then((value){
setState(() {
// offersviewList = BiddingCartviewModel.fromJson(response['items']) as List<BiddingCartviewModel>;
offersviewList =
((jsonDecode(value)['items']) as List).map((dynamic model) {
return BiddingCartviewModel.fromJson(model);
}).toList();
totalPrice=jsonDecode(value)['totalPrice'].toString();
print(medicinetime);
print(totalPrice);
isLoading = false;
});
});
print("offersviewListdata${jsonDecode(response)}");
} catch (e) {
setState(() {
isLoading = false;
isSereverIssueConnected = true;
});
}
}
@override
void initState() {
// TODO: implement initState
getCartViewData();
super.initState();
}
Widget renderzUi() {
if (offersviewList.length != 0) {
return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: offersviewList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
child: Padding(
padding: EdgeInsets.all(8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
width: MediaQuery.of(context).size.width * .70,
child: Row(
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text('MedicineName:',
style: labelTextStyle()),
SizedBox(
height: 10,
),
Text(
'Medicine Timings:',
style: labelTextStyle()),
SizedBox(
height: 10,
),
Text('MedicineQuantity:',
style: labelTextStyle()),
SizedBox(
height: 10,
),
Text('MedicinePrice:',
style: labelTextStyle()),
],
),
SizedBox(
width: 10,
),
Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Text(
offersviewList[index].medicinename_bidding!
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
height: 12,
),
Text(
offersviewList[index].medicine_timings![0].medicineTimings!.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
height: 10,
),
Text(
offersviewList[index].quantity_bidding.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
height: 10,
),
Text(
offersviewList[index].price_bidding.toString()
.toUpperCase(),
style: valuesTextStyle()),
SizedBox(
height: 10,
),
],
),
],
)),
),
],
),
),
);
})),
Container(
width: 400,
height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child:TextButton(
onPressed: () {
// Add your button click logic here
},
child: Text(
'Total Price:$totalPrice',
style: TextStyle(
fontSize: 20,
color: AppColors.primaryColor, // Text color
decoration: TextDecoration.underline, // Underline the text
fontWeight: FontWeight.bold, // Bold text
),
),
),),
SizedBox(
height: 10,
),
Container(
width: 400,
height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: () async{
},
child: Text('CheckOut'),
)),
/*Column(
children: [
Padding(padding: const EdgeInsets.fromLTRB(10, 10,10,10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Add More',
style: TextStyle(
color: Colors.white,
),
),
TextButton(
child: const Text(
'Sign Up',
style: TextStyle(fontSize: 15,
decoration: TextDecoration.underline,color: Colors.white),
),
onPressed: () {
*//* Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SignUp()),
);*//*
//signup screen
},
)
],
),)
Container(
width: 400,
height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child:TextButton(
onPressed: () {
// Add your button click logic here
},
child: Text(
'Total Price:$totalPrice',
style: TextStyle(
fontSize: 20,
color: AppColors.primaryColor, // Text color
decoration: TextDecoration.underline, // Underline the text
fontWeight: FontWeight.bold, // Bold text
),
),
),),
SizedBox(
height: 10,
),
Container(
width: 400,
height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: () async{
},
child: Text('CheckOut'),
)),
],
)*/
]);
} 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 Data Found'),
SizedBox(
height: 20,
),
],
),
));
}
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
// Add a back button to the leading property
backgroundColor: primaryColor,
leading: IconButton(
icon: Icon(Icons.arrow_back), // You can use a different back icon if needed
onPressed: () {
// Implement the navigation logic to go back
Navigator.push(
context,
MaterialPageRoute(builder: (context) => BiddingRequests()),
); // This will pop the current route and go back
},
),
title: Text('Cart Details'),
),
body: isLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):renderzUi(),
));
}
}

@ -0,0 +1,339 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:healthcare_pharmacy/medicinecart.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:quantity_input/quantity_input.dart';
import 'package:flutter/services.dart';
import 'dart:io' show File, Platform;
import 'package:location/location.dart' as locationmap;
class MedicineDetails extends StatefulWidget {
var name;
var price;
var bookid;
MedicineDetails({
this.name,this.price,this.bookid
});
@override
State<MedicineDetails> createState() => _deliverboyState();
}
class _deliverboyState extends State<MedicineDetails> {
TextEditingController MedicineNameController = TextEditingController();
TextEditingController MedicineQuantityController = TextEditingController();
TextEditingController MedicinePriceController = TextEditingController();
TextEditingController BookingidController = TextEditingController();
String selectedOptionsText = '';
List medicineCheckboxes = ["BB","AB","BL","AL","BD","AD"];
String medname = '';
String medprice = '';
int initialValue = 0;
double enteredValue = 0.0;
@override
void initState() {
super.initState();
MedicineNameController.text=widget.name;
MedicinePriceController.text=widget.price;
BookingidController.text=widget.bookid;
}
double getTotalAmount() {
return enteredValue * initialValue;
}
void toggleOption(String option) {
setState(() {
if (selectedOptionsText.contains(option)) {
selectedOptionsText = selectedOptionsText
.replaceAll('$option,', '') // Remove option from the string
.replaceAll(', $option', '') // Remove option from the string
.trim(); // Remove leading/trailing spaces
} else {
if (selectedOptionsText.isEmpty) {
selectedOptionsText = option;
} else {
selectedOptionsText += ', $option';
}
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppSettings.appBar('Medicine Details'),
body: SafeArea(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
const SizedBox(
height: 15,
),
Container(
height: MediaQuery.of(context).size.height * .15,
width: double.infinity,
child: Image(
image: const AssetImage('images/logo.png'),
height: MediaQuery.of(context).size.height * .25,
)),
const SizedBox(
height: 15,
),
Container(
//padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: MedicineNameController,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.medical_information,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Medicine Name',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
), //tanker name
),
const SizedBox(
height: 15,
),
ListView.builder(
shrinkWrap: true,
itemCount: (medicineCheckboxes.length / 2).ceil(), // Assuming 2 columns
itemBuilder: (context, index) {
final start = index * 2;
final end = start + 2 > medicineCheckboxes.length
? medicineCheckboxes.length
: start + 2;
return Row(
children: [
for (int i = start; i < end; i++)
Expanded(
child: CheckboxListTile(
value: selectedOptionsText.contains(medicineCheckboxes[i]),
onChanged: (value) => toggleOption(medicineCheckboxes[i]),
title: Text(medicineCheckboxes[i]),
controlAffinity: ListTileControlAffinity.leading,
dense: true,
contentPadding: EdgeInsets.zero,
),
),
],
);
},
),
const SizedBox(
height: 5,
),
Container(
//padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: MedicineQuantityController,
readOnly: true,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.production_quantity_limits,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Medicine Quantity',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
), //tanker name
),
//phone number
const SizedBox(
height: 5,
),
Container(
//padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: MedicinePriceController,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.currency_rupee,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Medicine Price',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
), //tanker name
), //alternative phone number
const SizedBox(
height: 5,
),
Container(
height: MediaQuery.of(context).size.height * .1,
width: MediaQuery.of(context).size.width * .5,
child: Column(
children: [
QuantityInput(
label: 'Select Medicine Quntity',
value: initialValue,
iconColor: Colors.white,
buttonColor: primaryColor,
onChanged: (value) {
setState(() {
enteredValue = double.tryParse(value) ?? 0.0;
initialValue = int.parse(value.replaceAll(',', ''));
MedicineQuantityController.text=initialValue.toString();
// MedicinePriceController.text= '${getTotalAmount()}';
});
}
),
]
) //tanker name
), //alternative phone number
const SizedBox(
height: 5,
),
Container(
width: MediaQuery.of(context).size.width * .99,
height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: () async {
if (MedicineNameController.text != '' &&
MedicineQuantityController.text != ''&&
MedicinePriceController.text != ''
) {
AppSettings.preLoaderDialog(context);
/* var payload = new Map<String, dynamic>();
payload["mbookingId"] = BookingidController.text.toString();
payload["items"]=[{
"medicinename":MedicineNameController.text.toString(),
"quantity":MedicineQuantityController.text.toString(),
"price":MedicinePriceController.text.toString()
}];
print("responcedata${payload.toString()}");*/
var response = await AppSettings.addToCart(BookingidController.text,MedicineQuantityController.text,
MedicinePriceController.text,MedicineNameController.text,selectedOptionsText);
//String response= await addToCart("OR1690969760576127","10","300","Dolo650");
//print("response$response");
try {
if(response.statusCode==200){
var msg=jsonDecode(response.body)['message'];
print(msg);
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longSuccessToast(
"Medicine Added to Cart Successfully");
/* MedicineNameController.text = '';
MedicineQuantityController.text = '';
MedicinePriceController.text = '';
//BookingidController.text = '';*/
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MedicineCartList(bookidcart:BookingidController.text.toString())),
);
}
else{
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast("Medicine Not Added to Cart Successfully");
}
/* try {
if (medicineStatus) {
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longSuccessToast(
"Medicine Added to Cart Successfully");
*//* MedicineNameController.text = '';
MedicineQuantityController.text = '';
MedicinePriceController.text = '';
//BookingidController.text = '';*//*
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MedicineCartList(bookidcart:BookingidController.text.toString())),
);
//Navigator.of(context).pushNamed('/tanksview');
} else {
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast("Medicine Not Added to Cart Successfully");
}*/
} catch (exception) {
print(exception);
}
}
else {
AppSettings.longFailedToast("Please enter valid details");
}
},
child: const Text(
'NEXT',
style: TextStyle(
fontSize: 25,
),
),
)),
],
),
)),
);
}
}

@ -22,9 +22,9 @@ class GetMedecineDetailsModel {
GetMedecineDetailsModel rtvm = new GetMedecineDetailsModel(); GetMedecineDetailsModel rtvm = new GetMedecineDetailsModel();
rtvm.name = json['name'] ?? ''; rtvm.name = json['name'] ?? '';
rtvm.manufacturers = json['manufacturers'] ?? ''; rtvm.manufacturers = json['manufacturers'].toString() ?? '';
rtvm.salt_composition = json['salt_composition'] ?? ''; rtvm.salt_composition = json['salt_composition'].toString() ?? '';
rtvm.mrp = json['mrp'] ?? ''; rtvm.mrp = json['mrp'].toString() ?? '';
rtvm.primary_use = json['primary_use'] ??''; rtvm.primary_use = json['primary_use'] ??'';
rtvm.picture = json['picture'] ?? ''; rtvm.picture = json['picture'] ?? '';

@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
class BiddingRequestsModel {
String custumerid_bidding = '';
String pharmacyid_bidding='';
String amount_bidding='';
String bidding_bookingid='';
Color cardColor=Colors.white;
BiddingRequestsModel();
factory BiddingRequestsModel.fromJson(Map<String, dynamic> json){
BiddingRequestsModel rtvm = new BiddingRequestsModel();
rtvm.custumerid_bidding = json['customerId'].toString() ??'';
rtvm.pharmacyid_bidding = json['pharmacyId'].toString() ?? '';
rtvm.amount_bidding = json['biddingAmount'].toString() ?? '';
rtvm.bidding_bookingid = json['bookingId'].toString() ?? '';
// rtvm.prescription_url = json['pictureUrl'][0] ?? '';
return rtvm;
}
}

@ -0,0 +1,57 @@
import 'dart:convert';
List<BiddingCartviewModel> biddingCartviewModelFromJson(String str) => List<BiddingCartviewModel>.from(json.decode(str).map((x) => BiddingCartviewModel.fromJson(x)));
String biddingCartviewModelToJson(List<BiddingCartviewModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class BiddingCartviewModel {
String? id;
String? medicinename_bidding ;
int? quantity_bidding;
double? price_bidding;
List<MedicineTiming>? medicine_timings;
BiddingCartviewModel({
this.id,
this.medicinename_bidding ,
this.quantity_bidding,
this.price_bidding,
this.medicine_timings,
});
factory BiddingCartviewModel.fromJson(Map<String, dynamic> json) => BiddingCartviewModel(
id: json["_id"],
medicinename_bidding : json["medicinename"],
quantity_bidding: json["quantity"],
price_bidding: json["price"]?.toDouble(),
medicine_timings: json["medicine_timings"] == null ? [] : List<MedicineTiming>.from(json["medicine_timings"]!.map((x) => MedicineTiming.fromJson(x))),
);
Map<String, dynamic> toJson() => {
"_id": id,
"medicinename": medicinename_bidding ,
"quantity": quantity_bidding,
"price": price_bidding,
"medicine_timings": medicine_timings == null ? [] : List<dynamic>.from(medicine_timings!.map((x) => x.toJson())),
};
}
class MedicineTiming {
String? id;
String? medicineTimings;
MedicineTiming({
this.id,
this.medicineTimings,
});
factory MedicineTiming.fromJson(Map<String, dynamic> json) => MedicineTiming(
id: json["_id"],
medicineTimings: json["medicine_timings"],
);
Map<String, dynamic> toJson() => {
"_id": id,
"medicine_timings": medicineTimings,
};
}

@ -5,7 +5,7 @@ class GetOffersDetailsModel {
String offer_name = ''; String offer_name = '';
String offer_code = ''; String offer_code = '';
String description = ''; String description = '';
String discount_percentage=''; String offer='';
String starting_date=''; String starting_date='';
Color cardColor=Colors.white; Color cardColor=Colors.white;
String ending_date=''; String ending_date='';
@ -20,7 +20,7 @@ class GetOffersDetailsModel {
rtvm.offer_name = json['offer_name'] ?? ''; rtvm.offer_name = json['offer_name'] ?? '';
rtvm.offer_code = json['offer_code'] ?? ''; rtvm.offer_code = json['offer_code'] ?? '';
rtvm.description = json['description'] ?? ''; rtvm.description = json['description'] ?? '';
rtvm.discount_percentage = json['discount_percentage'] ?? ''; rtvm.offer = json['offer'] ?? '';
rtvm.starting_date = json['starting_date'] ??''; rtvm.starting_date = json['starting_date'] ??'';
rtvm.ending_date = json['ending_date'] ??''; rtvm.ending_date = json['ending_date'] ??'';

@ -18,7 +18,7 @@ class _offersState extends State<offers> {
TextEditingController offer_nameController = TextEditingController(); TextEditingController offer_nameController = TextEditingController();
TextEditingController offer_codeController = TextEditingController(); TextEditingController offer_codeController = TextEditingController();
TextEditingController descriptionController = TextEditingController(); TextEditingController descriptionController = TextEditingController();
TextEditingController discount_percentageController = TextEditingController(); TextEditingController offerController = TextEditingController();
TextEditingController starting_dateController = TextEditingController(); TextEditingController starting_dateController = TextEditingController();
TextEditingController ending_dateController = TextEditingController(); TextEditingController ending_dateController = TextEditingController();
var selIOS; var selIOS;
@ -145,12 +145,12 @@ class _offersState extends State<offers> {
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: discount_percentageController, controller: offerController,
keyboardType: TextInputType.number, keyboardType: TextInputType.text,
maxLength: 2, textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.percent_outlined, Icons.local_offer,
color: primaryColor, color: primaryColor,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
@ -161,7 +161,7 @@ class _offersState extends State<offers> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
), ),
labelText: 'Enter Percentage', labelText: 'Enter Offer',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -321,7 +321,7 @@ class _offersState extends State<offers> {
if (offer_nameController.text != '' && if (offer_nameController.text != '' &&
offer_codeController.text != '' && offer_codeController.text != '' &&
descriptionController.text != ''&& descriptionController.text != ''&&
discount_percentageController.text != ''&& offerController.text != ''&&
starting_dateController.text != '' && starting_dateController.text != '' &&
ending_dateController.text != '') { ending_dateController.text != '') {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
@ -330,7 +330,7 @@ class _offersState extends State<offers> {
payload["offer_name"] = offer_nameController.text.toString(); payload["offer_name"] = offer_nameController.text.toString();
payload["offer_code"] = offer_codeController.text.toString(); payload["offer_code"] = offer_codeController.text.toString();
payload["description"] = descriptionController.text.toString();; payload["description"] = descriptionController.text.toString();;
payload["discount_percentage"] = discount_percentageController.text.toString(); payload["offer"] = offerController.text.toString();
payload["starting_date"] = starting_dateController.text.toString(); payload["starting_date"] = starting_dateController.text.toString();
payload["ending_date"] = ending_dateController.text.toString(); payload["ending_date"] = ending_dateController.text.toString();
payload["offer_status"] ="active"; payload["offer_status"] ="active";

@ -475,7 +475,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
Text('OfferName :',style: labelTextStyle()), Text('OfferName :',style: labelTextStyle()),
Text('OfferCode :',style: labelTextStyle()), Text('OfferCode :',style: labelTextStyle()),
Text('OfferDes :' ,style: labelTextStyle()), Text('OfferDes :' ,style: labelTextStyle()),
Text('OfferDis(%) :' ,style: labelTextStyle()), Text('offer :' ,style: labelTextStyle()),
Text('StartDate :',style: labelTextStyle()), Text('StartDate :',style: labelTextStyle()),
Text('EndDate :' ,style: labelTextStyle()), Text('EndDate :' ,style: labelTextStyle()),
@ -489,7 +489,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
Text(activeOffersList[index].offer_name,style: valuesTextStyle()), Text(activeOffersList[index].offer_name,style: valuesTextStyle()),
Text(activeOffersList[index].offer_code,style: valuesTextStyle()), Text(activeOffersList[index].offer_code,style: valuesTextStyle()),
Text(activeOffersList[index].description,style: valuesTextStyle()), Text(activeOffersList[index].description,style: valuesTextStyle()),
Text(activeOffersList[index].discount_percentage,style: valuesTextStyle()), Text(activeOffersList[index].offer,style: valuesTextStyle()),
Text(activeOffersList[index].starting_date,style: valuesTextStyle()), Text(activeOffersList[index].starting_date,style: valuesTextStyle()),
Text(activeOffersList[index].ending_date,style: valuesTextStyle()) Text(activeOffersList[index].ending_date,style: valuesTextStyle())
@ -507,59 +507,78 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
showUpdateOfferDialog(activeOffersList[index]); showUpdateOfferDialog(activeOffersList[index]);
}, },
),), ),),
Expanded(child:IconButton( Expanded(
icon: const Icon(Icons.hide_source_rounded,color: primaryColor,), child: Row(
children: [
onPressed: () async{ Text(''),
Switch(
value: false, // Replace this with your actual property
onChanged: (newValue) async {
if (newValue) {
// Show your AlertDialog for confirmation
showDialog( showDialog(
//if set to true allow to close popup by tapping out of the popup
//barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) => AlertDialog( builder: (BuildContext context) => AlertDialog(
title: const Text('Do you want In_Active Offer??', title: Text(
'Do you want to In_Activate the offer?',
style: TextStyle( style: TextStyle(
color: primaryColor, color: primaryColor,
fontSize: 16, fontSize: 16,
)), ),
),
actionsAlignment: MainAxisAlignment.spaceBetween, actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [ actions: [
TextButton( TextButton(
onPressed: () async { onPressed: () async {
bool deleteOfferStatus = await AppSettings.deleteOffers(activeOffersList[index].offer_code); bool deleteOfferStatus =
await AppSettings.deleteOffers(
activeOffersList[index].offer_code);
if (deleteOfferStatus) { if (deleteOfferStatus) {
getActiveOffersViewData(); getActiveOffersViewData();
AppSettings.longSuccessToast('Offer In_Active Successfully!!'); AppSettings.longSuccessToast(
'Offer In_Active Successfully!!');
getInactiveOffersViewData(); getInactiveOffersViewData();
Navigator.of(context).pop(true); // Update the isActive property
}
else{ } else {
AppSettings.longFailedToast('Offer In_Active failed'); AppSettings.longFailedToast('Offer In_Active failed');
} }
Navigator.of(context).pop(true);
}, },
child: const Text('Yes', child: const Text(
'Yes',
style: TextStyle( style: TextStyle(
color: primaryColor, color: primaryColor,
fontSize: 18, fontSize: 18,
)), ),
),
), ),
TextButton( TextButton(
onPressed: () { onPressed: () {
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
}, },
child: const Text('No', child: const Text(
'No',
style: TextStyle( style: TextStyle(
color: primaryColor, color: primaryColor,
fontSize: 18, fontSize: 18,
)), ),
),
), ),
], ],
), ),
); );
} else {
// Handle the case where the user wants to undo the In_Activation
// Update the isActive property
//m;./ activeOffersList[index].isActive = false;
// You might want to add code to revert the In_Activation in your data model here
}
}, },
),) ),
],
),
),
], ],
@ -691,7 +710,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
Text(inactiveOffersList[index].offer_name,style: valuesTextStyle()), Text(inactiveOffersList[index].offer_name,style: valuesTextStyle()),
Text(inactiveOffersList[index].offer_code,style: valuesTextStyle()), Text(inactiveOffersList[index].offer_code,style: valuesTextStyle()),
Text(inactiveOffersList[index].description,style: valuesTextStyle()), Text(inactiveOffersList[index].description,style: valuesTextStyle()),
Text(inactiveOffersList[index].discount_percentage,style: valuesTextStyle()), Text(inactiveOffersList[index].offer,style: valuesTextStyle()),
Text(inactiveOffersList[index].starting_date,style: valuesTextStyle()), Text(inactiveOffersList[index].starting_date,style: valuesTextStyle()),
Text(inactiveOffersList[index].ending_date,style: valuesTextStyle()) Text(inactiveOffersList[index].ending_date,style: valuesTextStyle())

@ -454,7 +454,7 @@ class _OffersViewState extends State<OffersView> with TickerProviderStateMixin {
Text(offersviewList[index].offer_name,style: valuesTextStyle()), Text(offersviewList[index].offer_name,style: valuesTextStyle()),
Text(offersviewList[index].offer_code,style: valuesTextStyle()), Text(offersviewList[index].offer_code,style: valuesTextStyle()),
Text(offersviewList[index].description,style: valuesTextStyle()), Text(offersviewList[index].description,style: valuesTextStyle()),
Text(offersviewList[index].discount_percentage,style: valuesTextStyle()), Text(offersviewList[index].offer,style: valuesTextStyle()),
Text(offersviewList[index].starting_date,style: valuesTextStyle()), Text(offersviewList[index].starting_date,style: valuesTextStyle()),
Text(offersviewList[index].ending_date,style: valuesTextStyle()) Text(offersviewList[index].ending_date,style: valuesTextStyle())

@ -1,3 +1,5 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -144,6 +146,7 @@ class AppSettings {
static double userLatitude = 0; static double userLatitude = 0;
static double userLongitude = 0; static double userLongitude = 0;
static String healthpharmaIdsign = ''; static String healthpharmaIdsign = '';
static String healthpharmastaticid = '123456789';
static String profileImage = ''; static String profileImage = '';
static List<String> storedPreferenceValidKeys = ['pharmacyname', 'access_token']; static List<String> storedPreferenceValidKeys = ['pharmacyname', 'access_token'];
static String preloadText = 'Please wait'; static String preloadText = 'Please wait';
@ -179,6 +182,15 @@ class AppSettings {
static String deleteOffersDataUrl = host + 'deleteOffer'; static String deleteOffersDataUrl = host + 'deleteOffer';
static String reactiveOffersDataUrl = host + 'reactiveOffer'; static String reactiveOffersDataUrl = host + 'reactiveOffer';
static String medecineDataUrl = host + 'medicine'; static String medecineDataUrl = host + 'medicine';
static String getAllBiddingDataUrl = host + 'getBiddingRequests';
static String getRequestBiddingDataUrl = host + 'biddingRequest';
static String addToCartDataUrl = host + 'cart/add';
static String getCartDataUrl = host + 'cart/total-price';
@ -440,6 +452,181 @@ class AppSettings {
return ''; return '';
} }
} }
static Future<String> getCartDetails(bookingId) async {
//path parameter
var uri = Uri.parse(getCartDataUrl + '/' + bookingId);
var response = await http.get(uri, headers: await buildRequestHeaders());
var responcedatatemp=jsonDecode(response.body);
print("responcedata$responcedatatemp");
print("responcedata$bookingId");
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<http.Response> addToCart(String orderId, String quantity, String price,String mName,String mtimings) async {
var headers = {
'Content-Type': 'application/json'
};
var body=json.encode({
"bookingId": orderId,
"items": [
{
"medicinename": mName,
"quantity": quantity,
"price": price,
"medicine_timings":[
{
"medicine_timings":mtimings
}
]
}
]
});
print("Timintgs"+body.toString());
var uri = Uri.parse(addToCartDataUrl);
var response = await http.post(
uri,
headers: headers,
body: body,
);
return response;
}
/* static Future<bool> addToCart(payload) async {
var response = await http.post(Uri.parse(addToCartDataUrl),
body: json.encode(payload),
headers: {'Content-type': 'application/json'});
if (response.statusCode == 200) {
try {
var _response = jsonDecode(response.body);
print("responcedata$_response");
return true;
*//* if (_response['items']['error'] == false) {
return true;
} else {
return false;
}*//*
} catch (e) {
// display error toast
return false;
}
} else {
return false;
}
}*/
static Future<String> getAllBiddingRecords() async {
//path parameter
var uri = Uri.parse(getAllBiddingDataUrl + '/' + healthpharmaIdsign);
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 '';
}
}
//getRequestBiddingDataUrl
/*static Future<bool> getRequestBiddingDetails( bookingId) async {
var uri = Uri.parse(getRequestBiddingDataUrl + '/' +bookingId );
try {
var response = await http.put(uri, headers: await buildRequestHeaders());
var responcedatatemp=jsonDecode(response.body);
print("responcedata$responcedatatemp");
print("responcedata$bookingId");
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.put(uri, headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}*/
static Future<bool> getRequestBiddingDetails(var bookingId,payload) async {
var response = await http.put(Uri.parse(getRequestBiddingDataUrl + '/' + bookingId),
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
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.put(Uri.parse(getRequestBiddingDataUrl + '/' + bookingId),
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
static Future<String> getinactiveOffers() async { static Future<String> getinactiveOffers() async {
//path parameter //path parameter
var uri = Uri.parse(getOffersinActiveDataUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(getOffersinActiveDataUrl + '/' + healthpharmaIdsign);
@ -650,6 +837,8 @@ class AppSettings {
static Future<bool> updateProfilePicture(payload) async { static Future<bool> updateProfilePicture(payload) async {
var uri = Uri.parse(profilePicUrl + '/' + pharmacyId); var uri = Uri.parse(profilePicUrl + '/' + pharmacyId);
var response = await http.post(uri, var response = await http.post(uri,

@ -168,12 +168,12 @@ class _SignUpState extends State<SignUp> {
image: const AssetImage('images/logo.png'), image: const AssetImage('images/logo.png'),
height: MediaQuery.of(context).size.height * .18, height: MediaQuery.of(context).size.height * .18,
)), )),
SizedBox( SizedBox(
height: 05, height: 10,
), ),
Container( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10), // Set the desired width
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: nameController, controller: nameController,
@ -181,9 +181,7 @@ class _SignUpState extends State<SignUp> {
decoration: textFormFieldDecoration(Icons.person,'Name'), decoration: textFormFieldDecoration(Icons.person,'Name'),
), ),
), //name ), //name
SizedBox(
height: 05,
),
Container( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
@ -194,9 +192,7 @@ class _SignUpState extends State<SignUp> {
), ),
), ),
const SizedBox(
height: 5,
),
Container( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
@ -209,9 +205,7 @@ class _SignUpState extends State<SignUp> {
), ),
), //mobile ), //mobile
const SizedBox(
height: 5,
),
Container( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
@ -222,9 +216,7 @@ class _SignUpState extends State<SignUp> {
), ),
), ),
const SizedBox(
height: 5,
),
GestureDetector( GestureDetector(
child: Container( child: Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),

@ -117,7 +117,7 @@ class _UpdateprofileState extends State<UpdateProfile> {
height: MediaQuery.of(context).size.height * .15, height: MediaQuery.of(context).size.height * .15,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(width: 5, color: Colors.blueGrey), border: Border.all(width: 2, color: Colors.blueGrey),
image: DecorationImage( image: DecorationImage(
image: (AppSettings.profilePictureUrl != ''&& AppSettings.profilePictureUrl != 'null') ? NetworkImage(AppSettings.profilePictureUrl) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file image: (AppSettings.profilePictureUrl != ''&& AppSettings.profilePictureUrl != 'null') ? NetworkImage(AppSettings.profilePictureUrl) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file
fit: BoxFit.fitWidth)), fit: BoxFit.fitWidth)),
@ -301,22 +301,28 @@ class _UpdateprofileState extends State<UpdateProfile> {
payload["emails"] = [{"email":emailController.text.toString()}]; payload["emails"] = [{"email":emailController.text.toString()}];
payload["description"] = descriptionController.text.toString(); payload["description"] = descriptionController.text.toString();
bool signUpStatus = await AppSettings.updatePharmaData(payload); bool signUpStatus = await AppSettings.updatePharmaData(payload);
try{ AppSettings.longSuccessToast("Pharmacy Profile Updated !!");
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Dashboard()),
);
/* try{
if (signUpStatus) { if (signUpStatus) {
Navigator.pop(context); Navigator.pop(context);
AppSettings.longSuccessToast("Pharmacy Profile Updated !!");
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Dashboard()), MaterialPageRoute(builder: (context) => Dashboard()),
); );
AppSettings.longSuccessToast("Pharmacy Profile Updated !!");
} else { } else {
AppSettings.longFailedToast("Pharmacy Profile Not Updated !!"); //AppSettings.longFailedToast("Pharmacy Profile Not Updated !!");
} }
} }
catch(exception){ catch(exception){
print(exception); print(exception);
AppSettings.longFailedToast("Please enter valid details"); AppSettings.longFailedToast("Please enter valid details");
} }*/
}, },
child: Text('Update'), child: Text('Update'),
) )

@ -868,6 +868,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.5" version: "6.0.5"
quantity_input:
dependency: "direct dev"
description:
name: quantity_input
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
sanitize_html: sanitize_html:
dependency: transitive dependency: transitive
description: description:

@ -62,7 +62,7 @@ dev_dependencies:
cloudinary_public: ^0.21.0 cloudinary_public: ^0.21.0
carousel_slider: ^4.2.1 carousel_slider: ^4.2.1
photo_view: ^0.14.0 photo_view: ^0.14.0
quantity_input: ^1.0.2
flutter_icons: flutter_icons:

Loading…
Cancel
Save