Offerimage,companyoffers,getpharmacies updated

dev
suresh 1 year ago
parent 281bd46f0a
commit f95edc4365

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

@ -0,0 +1,466 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
import 'package:image_picker/image_picker.dart';
class CompanyOffers extends StatefulWidget {
const CompanyOffers({Key? key}) : super(key: key);
@override
State<CompanyOffers> createState() => _CompanyOffersState();
}
class _CompanyOffersState extends State<CompanyOffers> {
TextEditingController offer_nameController = TextEditingController();
TextEditingController offer_codeController = TextEditingController();
TextEditingController descriptionController = TextEditingController();
TextEditingController eligiblepharma_Controller = TextEditingController();
TextEditingController starting_dateController = TextEditingController();
TextEditingController ending_dateController = TextEditingController();
var selIOS;
final ImagePicker _picker = ImagePicker();
String offerUrl='';
Future pickImageFromGallery() async {
try {
final image = await _picker.pickImage(source: ImageSource.gallery);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.offeruploadImageHTTPNew(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
AppSettings.offerPictureUrl = jsonDecode(res)['picture'];
});
AppSettings.saveData('offer', jsonDecode(res)['picture'], 'STRING');
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
Future takeImageFromCamera() async {
try {
final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.offeruploadImageHTTPNew(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
//AppSettings.offerPictureUrl = jsonDecode(res)['picture']['url'];
offerUrl=jsonDecode(res)['picture'][0]['url'];
});
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppSettings.appBar('Cteate Offers'),
body: Stack(children: <Widget>[
GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: SafeArea(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
SizedBox(
height: 20,
),
Container(child: GestureDetector(
child: Container(
width: MediaQuery.of(context).size.width * .60,
height: MediaQuery.of(context).size.height * .15,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
border: Border.all(width: 2, color: Colors.blueGrey),
image: DecorationImage(
image: (offerUrl!= ''&&
offerUrl!= 'null') ?
NetworkImage(offerUrl) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file
fit: BoxFit.fitWidth)),
),
onTap: () {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: primaryColor,
),
onTap: () async {
await takeImageFromCamera();
Navigator.pop(context);
},
),
SizedBox(
width:
MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
await pickImageFromGallery();
Navigator.pop(context);
},
),
],
),
),
);
});
},
),),
SizedBox(
height: 05,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: offer_nameController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.person,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Enter Offer Name',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
), //name
SizedBox(
height: 05,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: offer_codeController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.numbers,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Enter Offer Code',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
const SizedBox(
height: 5,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: descriptionController,
textCapitalization: TextCapitalization.words,
keyboardType: TextInputType.multiline,
maxLines: null,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.description,
color:primaryColor,
),
contentPadding: const EdgeInsets.symmetric(vertical:40.0, horizontal:30.0),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter Offer Description',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: eligiblepharma_Controller,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.local_pharmacy,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
labelText: 'Enter Eligible Pharmacies',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
), //mobile
const SizedBox(
height: 5,
),
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
readOnly: true,
cursorColor: greyColor,
controller: starting_dateController,
decoration: InputDecoration(
labelText: 'Select Start Date',
prefixIcon: const Icon(Icons.date_range, color: primaryColor,),
labelStyle: const TextStyle(
color: greyColor, //<-- SEE HERE
),
border: const OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
suffixIcon: IconButton(
icon: Icon(
Icons.date_range,
),
onPressed: () async {
DatePicker.showDatePicker(
context,
dateFormat: 'dd MMMM yyyy',
initialDateTime: DateTime.now(),
minDateTime:DateTime.now(),
maxDateTime: DateTime.now().add(Duration(days: 365)),
onMonthChangeStartWithFirstDate: true,
pickerMode: DateTimePickerMode.datetime,
pickerTheme: DateTimePickerTheme(
// backgroundColor: Colors.white,
cancelTextStyle: labelTextStyle(),
confirmTextStyle: labelTextStyle(),
// showTitle: true,
//title: Text('Pick date and time'),
itemTextStyle: valuesTextStyle(),
),
onConfirm: (dateTime, List<int> index)async {
DateTime selectdate = dateTime;
setState(() {
selIOS = DateFormat('dd-MMM-yyyy').format(selectdate);
});
if(selIOS!=''){
setState(() {
starting_dateController.text=selIOS.toString();
});
}
else {
AppSettings.longFailedToast('please select date');
}
},
);
},
),
),
),
),
const SizedBox(
height: 5,
),
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
readOnly: true,
cursorColor: greyColor,
controller: ending_dateController,
decoration: InputDecoration(
labelText: 'Select End Date',
prefixIcon: const Icon(Icons.date_range, color: primaryColor,),
labelStyle: const TextStyle(
color: greyColor, //<-- SEE HERE
),
border: const OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: primaryColor),
),
suffixIcon: IconButton(
icon: Icon(
Icons.date_range,
),
onPressed: () async {
DatePicker.showDatePicker(
context,
dateFormat: 'dd MMMM yyyy',
initialDateTime: DateTime.now(),
minDateTime:DateTime.now(),
maxDateTime: DateTime.now().add(Duration(days: 365)),
onMonthChangeStartWithFirstDate: true,
pickerMode: DateTimePickerMode.datetime,
pickerTheme: DateTimePickerTheme(
// backgroundColor: Colors.white,
cancelTextStyle: labelTextStyle(),
confirmTextStyle: labelTextStyle(),
// showTitle: true,
//title: Text('Pick date and time'),
itemTextStyle: valuesTextStyle(),
),
onConfirm: (dateTime, List<int> index)async {
DateTime selectdate = dateTime;
setState(() {
selIOS = DateFormat('dd-MMM-yyyy').format(selectdate);
});
if(selIOS!=''){
setState(() {
ending_dateController.text=selIOS.toString();
});
}
else {
AppSettings.longFailedToast('please select date');
}
},
);
},
),
),
),
),//address description
const SizedBox(
height:15,
),
Container(
width:MediaQuery.of(context).size.width * .99,
height: 55,
padding: const EdgeInsets.fromLTRB(3, 0, 3, 0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: buttonColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: () async {
if (offer_nameController.text != '' &&
offer_codeController.text != '' &&
descriptionController.text != ''&&
starting_dateController.text != '' &&
ending_dateController.text != '') {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["offer_name"] = offer_nameController.text.toString();
payload["offer_code"] = offer_codeController.text.toString();
payload["description"] = descriptionController.text.toString();
payload["pharmacies_eligible"] = eligiblepharma_Controller.text.toString();
payload["starting_date"] = starting_dateController.text.toString();
payload["ending_date"] = ending_dateController.text.toString();
payload["offer_status"] ="active";
bool offerStatus = await AppSettings.createCompanyOffers(payload);
try{
if (offerStatus) {
Navigator.pop(context);
Navigator.of(context,rootNavigator: true).pop();
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Dashboard()),
);
AppSettings.longSuccessToast("Company Offer Created Succesfully!!");
} else {
AppSettings.longFailedToast("Fields should not be empty !!");
}
}
catch(exception){
print(exception);
AppSettings.longFailedToast("Please enter valid details");
}
} else {
AppSettings.longFailedToast("Company Offer Not Created!!");
}
},
child: Text('Create'),
)),//login button
],
),
)),
),
])), );
}
}

@ -1,9 +1,14 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:healthcare_pharmacy/dashboard.dart'; import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/settings.dart'; import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
import 'package:image_picker/image_picker.dart';
class offers extends StatefulWidget { class offers extends StatefulWidget {
@ -18,11 +23,52 @@ 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 offerController = TextEditingController();
TextEditingController starting_dateController = TextEditingController(); TextEditingController starting_dateController = TextEditingController();
TextEditingController ending_dateController = TextEditingController(); TextEditingController ending_dateController = TextEditingController();
var selIOS; var selIOS;
final ImagePicker _picker = ImagePicker();
String offerUrl='';
Future pickImageFromGallery() async {
try {
final image = await _picker.pickImage(source: ImageSource.gallery);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.offeruploadImageHTTPNew(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
AppSettings.offerPictureUrl = jsonDecode(res)['picture'];
});
AppSettings.saveData('offer', jsonDecode(res)['picture'], 'STRING');
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
Future takeImageFromCamera() async {
try {
final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return;
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.offeruploadImageHTTPNew(image);
print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() {
//AppSettings.offerPictureUrl = jsonDecode(res)['picture']['url'];
offerUrl=jsonDecode(res)['picture'][0]['url'];
});
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -43,13 +89,62 @@ class _offersState extends State<offers> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Container( Container(child: GestureDetector(
//width: double.infinity, child: Container(
child: Image( width: MediaQuery.of(context).size.width * .60,
image: const AssetImage('images/logo.png'), height: MediaQuery.of(context).size.height * .15,
height: MediaQuery.of(context).size.height * .18, decoration: BoxDecoration(
)), shape: BoxShape.rectangle,
border: Border.all(width: 2, color: Colors.blueGrey),
image: DecorationImage(
image: (offerUrl!= ''&&
offerUrl!= 'null') ?
NetworkImage(offerUrl) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file
fit: BoxFit.fitWidth)),
),
onTap: () {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return SizedBox(
height: 200,
child: Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: Icon(
Icons.camera_alt_outlined,
size: 100,
color: primaryColor,
),
onTap: () async {
await takeImageFromCamera();
Navigator.pop(context);
},
),
SizedBox(
width:
MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
await pickImageFromGallery();
Navigator.pop(context);
},
),
],
),
),
);
});
},
),),
SizedBox( SizedBox(
height: 05, height: 05,
), ),
@ -58,7 +153,7 @@ class _offersState extends State<offers> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: offer_nameController, controller: offer_nameController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person, Icons.person,
@ -87,7 +182,7 @@ class _offersState extends State<offers> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: offer_codeController, controller: offer_codeController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.numbers, Icons.numbers,
@ -111,24 +206,30 @@ class _offersState extends State<offers> {
const SizedBox( const SizedBox(
height: 5, height: 5,
), ),
Container( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: descriptionController, controller: descriptionController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.words,
keyboardType: TextInputType.multiline,
maxLines: null,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.description, Icons.description,
color: primaryColor, color:primaryColor,
), ),
contentPadding: const EdgeInsets.symmetric(vertical:40.0, horizontal:30.0),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)), borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: greyColor),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: greyColor),
), ),
labelText: 'Enter Offer Description', labelText: 'Enter Offer Description',
labelStyle: TextStyle( labelStyle: TextStyle(
@ -136,23 +237,19 @@ class _offersState extends State<offers> {
), ),
), ),
), ),
), //mobile
const SizedBox(
height: 5,
), ),
Container( /* Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: offerController, controller: descriptionController,
keyboardType: TextInputType.text,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.local_offer, Icons.description,
color: primaryColor, color: primaryColor,
), ),
contentPadding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 30.0),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)), borderSide: BorderSide(color: primaryColor)),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
@ -161,17 +258,16 @@ class _offersState extends State<offers> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: primaryColor), borderSide: BorderSide(color: primaryColor),
), ),
labelText: 'Enter Offer', labelText: 'Enter Offer Description',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
), ),
), ),
), ),*/ //mobile
const SizedBox( const SizedBox(
height: 5, height: 5,
), ),
Container( Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField( child: TextFormField(
@ -199,7 +295,7 @@ class _offersState extends State<offers> {
onPressed: () async { onPressed: () async {
DatePicker.showDatePicker( DatePicker.showDatePicker(
context, context,
dateFormat: 'dd MMMM yyyy HH:mm', dateFormat: 'dd MMMM yyyy',
initialDateTime: DateTime.now(), initialDateTime: DateTime.now(),
minDateTime:DateTime.now(), minDateTime:DateTime.now(),
maxDateTime: DateTime.now().add(Duration(days: 365)), maxDateTime: DateTime.now().add(Duration(days: 365)),
@ -216,7 +312,7 @@ class _offersState extends State<offers> {
onConfirm: (dateTime, List<int> index)async { onConfirm: (dateTime, List<int> index)async {
DateTime selectdate = dateTime; DateTime selectdate = dateTime;
setState(() { setState(() {
selIOS = DateFormat('dd-MMM-yyyy - HH:mm').format(selectdate); selIOS = DateFormat('dd-MMM-yyyy').format(selectdate);
}); });
if(selIOS!=''){ if(selIOS!=''){
@ -267,7 +363,7 @@ class _offersState extends State<offers> {
onPressed: () async { onPressed: () async {
DatePicker.showDatePicker( DatePicker.showDatePicker(
context, context,
dateFormat: 'dd MMMM yyyy HH:mm', dateFormat: 'dd MMMM yyyy',
initialDateTime: DateTime.now(), initialDateTime: DateTime.now(),
minDateTime:DateTime.now(), minDateTime:DateTime.now(),
maxDateTime: DateTime.now().add(Duration(days: 365)), maxDateTime: DateTime.now().add(Duration(days: 365)),
@ -284,7 +380,7 @@ class _offersState extends State<offers> {
onConfirm: (dateTime, List<int> index)async { onConfirm: (dateTime, List<int> index)async {
DateTime selectdate = dateTime; DateTime selectdate = dateTime;
setState(() { setState(() {
selIOS = DateFormat('dd-MMM-yyyy - HH:mm').format(selectdate); selIOS = DateFormat('dd-MMM-yyyy').format(selectdate);
}); });
if(selIOS!=''){ if(selIOS!=''){
@ -321,7 +417,6 @@ class _offersState extends State<offers> {
if (offer_nameController.text != '' && if (offer_nameController.text != '' &&
offer_codeController.text != '' && offer_codeController.text != '' &&
descriptionController.text != ''&& descriptionController.text != ''&&
offerController.text != ''&&
starting_dateController.text != '' && starting_dateController.text != '' &&
ending_dateController.text != '') { ending_dateController.text != '') {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
@ -330,7 +425,6 @@ 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["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";

@ -3,10 +3,12 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:healthcare_pharmacy/companyoffrers.dart';
import 'package:healthcare_pharmacy/getallpharmacies.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/medicinecart.dart';
import 'package:healthcare_pharmacy/offers.dart'; import 'package:healthcare_pharmacy/createoffers.dart';
import 'package:healthcare_pharmacy/offerstabdata.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/biddingrequests.dart';
@ -644,7 +646,7 @@ class _DashboardState extends State<Dashboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => MedicineCartList()), builder: (context) => BiddingRequests()),
); );
@ -654,7 +656,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(
@ -665,7 +667,7 @@ class _DashboardState extends State<Dashboard> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Text('Get Medicines', style: TextStyle(color: Colors.black)), Text('Company Offers', style: TextStyle(color: Colors.black)),
], ],
), ),
onTap: () { onTap: () {
@ -673,7 +675,7 @@ class _DashboardState extends State<Dashboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => GetMedicines()), builder: (context) => CompanyOffers()),
); );
@ -682,7 +684,33 @@ class _DashboardState extends State<Dashboard> {
), ),
Divider( Divider(
color: Colors.grey, color: Colors.grey,
),*/ ),
ListTile(
title: Row(
children: const [
Image(
image: const AssetImage('images/inactive.png'),
height: 25,
width: 25,
fit: BoxFit.fill),
const SizedBox(
width: 10,
),
Text('GetAllPharmacies', style: TextStyle(color: Colors.black)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GetAllPharmacies()),
);
},
),
Divider(
color: Colors.grey,
),
ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [

@ -0,0 +1,271 @@
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/maps/app_colors.dart';
import 'package:healthcare_pharmacy/models/biddingrequest_model.dart';
import 'package:healthcare_pharmacy/models/companyoffer_model.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:image_picker/image_picker.dart';
import 'package:photo_view/photo_view.dart';
class GetAllPharmacies extends StatefulWidget {
const GetAllPharmacies({Key? key}) : super(key: key);
@override
State<GetAllPharmacies> createState() => _GetAllPharmaciesState();
}
class _GetAllPharmaciesState extends State<GetAllPharmacies> {
String Url = '';
List<GetAllPharmacyModel> pharmacyList = [];
List<GetAllPharmacyModel> prescriptionsListOriginal = [];
bool isPrescriptionsDataLoading = false;
bool isSereverIssue = false;
bool isLoading=false;
List<String> checked = [];
Future<void> getAllPharmacies() async {
isPrescriptionsDataLoading=true;
try {
var response = await AppSettings.getPharmacyData();
print(response);
setState(() {
pharmacyList =
((jsonDecode(response)['data']) as List).map((dynamic model) {
return GetAllPharmacyModel.fromJson(model);
}).toList();
isPrescriptionsDataLoading = false;
});
} catch (e) {
setState(() {
isLoading = false;
isPrescriptionsDataLoading = false;
});
}
}
@override
void initState() {
getAllPharmacies();
//getAllPharmaciesData(dropdownArea);
super.initState();
}
void _onCheckboxChanged(String id, bool value) {
setState(() {
if (value) {
checked.add(id);
} else {
checked.remove(id);
}
});
}
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 _allPharmacies() {
if (pharmacyList.length != 0) {
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: pharmacyList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
child: Padding(
padding: EdgeInsets.all(8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
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,
),
),
),
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(
pharmacyList[index].pharmacyname_offer
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
Text(
pharmacyList[index].pharmacyId_offer
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
Text(
pharmacyList[index].phone_offer
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
Text(
pharmacyList[index].description_offer
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
],
),
),
Checkbox(
value: checked.contains(
pharmacyList[index].pharmacyId_offer.toString()),
onChanged: (value) {
_onCheckboxChanged(
pharmacyList[index].pharmacyId_offer.toString(),
value ?? false);
},
),
],
),
),
);
},
),
),
/* 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:$checked.toString()',
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{
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(checked.toString()),
),
);
},
child: Text('Submit'),
)),
],
);
} 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('All Pharmacies'),
body: isPrescriptionsDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
): _allPharmacies(),
);
}
}

@ -36,15 +36,11 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
String medicine_mrp=''; String medicine_mrp='';
String medicine_primary_use=''; String medicine_primary_use='';
String medbookingid = ''; String medbookingid = '';
List medImages=[]; List medImages=[];
Future<void> getAllMedecineData(var medicineName) async { Future<void> getAllMedecineData(var medicineName) async {
FilteredList=[]; FilteredList=[];
isMedecineDataLoading = true; isMedecineDataLoading = true;
try { try {
var medecineResponse = await AppSettings.getAllMedecines(medicineName); var medecineResponse = await AppSettings.getAllMedecines(medicineName);

@ -1,7 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/models/offersview_model.dart'; import 'package:healthcare_pharmacy/models/offersview_model.dart';
import 'package:healthcare_pharmacy/offers.dart'; import 'package:healthcare_pharmacy/createoffers.dart';
import 'package:healthcare_pharmacy/settings.dart'; import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';

@ -122,7 +122,7 @@ class _LoginState extends State<Login> {
labelText: 'Password', labelText: 'Password',
prefixIcon: const Icon(Icons.password, color: greyColor,), prefixIcon: const Icon(Icons.password, color: greyColor,),
labelStyle: const TextStyle( labelStyle: const TextStyle(
color: primaryColor, fontWeight: FontWeight.bold//<-- SEE HERE color: Color(0xFF7A7575), fontWeight: FontWeight.bold//<-- SEE HERE
), ),
border: const OutlineInputBorder( border: const OutlineInputBorder(
borderSide: BorderSide(color: primaryColor)), borderSide: BorderSide(color: primaryColor)),

@ -320,11 +320,12 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
leading: IconButton( leading: IconButton(
icon: Icon(Icons.arrow_back), // You can use a different back icon if needed icon: Icon(Icons.arrow_back), // You can use a different back icon if needed
onPressed: () { onPressed: () {
Navigator.of(context).pop();
// Implement the navigation logic to go back // Implement the navigation logic to go back
Navigator.push( /* Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => BiddingRequests()), MaterialPageRoute(builder: (context) => GetMedicines()),
); // This will pop the current route and go back );*/ // This will pop the current route and go back
}, },
), ),
title: Text('Cart Details'), title: Text('Cart Details'),

@ -0,0 +1,27 @@
import 'package:flutter/material.dart';
class GetAllPharmacyModel {
String pharmacyname_offer = '';
String phone_offer='';
String description_offer='';
String pharmacyId_offer='';
Color cardColor=Colors.white;
GetAllPharmacyModel();
factory GetAllPharmacyModel.fromJson(Map<String, dynamic> json){
GetAllPharmacyModel rtvm = new GetAllPharmacyModel();
rtvm.pharmacyname_offer = json['pharmacyname'].toString() ??'';
rtvm.phone_offer = json['phone'].toString() ?? '';
rtvm.description_offer = json['description'].toString() ?? '';
rtvm.pharmacyId_offer = json['pharmacyId'].toString() ?? '';
// rtvm.prescription_url = json['pictureUrl'][0] ?? '';
return rtvm;
}
}

@ -2,8 +2,9 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/maps/app_colors.dart';
import 'package:healthcare_pharmacy/models/offersview_model.dart'; import 'package:healthcare_pharmacy/models/offersview_model.dart';
import 'package:healthcare_pharmacy/offers.dart'; import 'package:healthcare_pharmacy/createoffers.dart';
import 'package:healthcare_pharmacy/settings.dart'; import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
@ -102,7 +103,6 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
updateOfferNameController.text = object.offer_name; updateOfferNameController.text = object.offer_name;
updateOfferCodeController.text = object.offer_code; updateOfferCodeController.text = object.offer_code;
updateOfferDescriptionController.text = object.description; updateOfferDescriptionController.text = object.description;
updateDiscountController.text = object.discount_percentage;
updateOfferStartDateController.text=object.starting_date; updateOfferStartDateController.text=object.starting_date;
updateOfferEndDateController.text=object.ending_date; updateOfferEndDateController.text=object.ending_date;
return showDialog( return showDialog(
@ -121,7 +121,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: updateOfferNameController, controller: updateOfferNameController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person, Icons.person,
@ -135,7 +135,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor), borderSide: BorderSide(color: greyColor),
), ),
labelText: 'Enter offer name', labelText: 'Offer name',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -151,7 +151,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: updateOfferCodeController, controller: updateOfferCodeController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.numbers, Icons.numbers,
@ -165,7 +165,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor), borderSide: BorderSide(color: greyColor),
), ),
labelText: 'Enter Offer Code', labelText: 'Offer Code',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -180,7 +180,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: updateOfferDescriptionController, controller: updateOfferDescriptionController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.words,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.description, Icons.description,
@ -194,37 +194,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor), borderSide: BorderSide(color: greyColor),
), ),
labelText: 'Enter Offer Description', labelText: 'Offer Description',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
), //tanker name
),
const SizedBox(
height: 20,
),
Container(
//padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
cursorColor: greyColor,
maxLength: 2,
controller: updateDiscountController,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.percent_outlined,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter Offer Discount',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
@ -249,10 +219,10 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
onPressed: () async { onPressed: () async {
DatePicker.showDatePicker( DatePicker.showDatePicker(
context, context,
dateFormat: 'dd MMMM yyyy HH:mm', dateFormat: 'dd MMMM yyyy',
initialDateTime: DateTime.now(), initialDateTime: DateTime.now(),
minDateTime:DateTime.now(), minDateTime:DateTime.now(),
maxDateTime: DateTime.now().add(Duration(days: 15)), maxDateTime: DateTime.now().add(Duration(days: 365)),
onMonthChangeStartWithFirstDate: true, onMonthChangeStartWithFirstDate: true,
pickerMode: DateTimePickerMode.datetime, pickerMode: DateTimePickerMode.datetime,
pickerTheme: DateTimePickerTheme( pickerTheme: DateTimePickerTheme(
@ -266,7 +236,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
onConfirm: (dateTime, List<int> index)async { onConfirm: (dateTime, List<int> index)async {
DateTime selectdate = dateTime; DateTime selectdate = dateTime;
setState(() { setState(() {
startdate = DateFormat('dd-MMM-yyyy - HH:mm').format(selectdate); startdate = DateFormat('dd-MMM-yyyy').format(selectdate);
}); });
if(startdate!=''){ if(startdate!=''){
@ -275,7 +245,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
}); });
} }
else { else {
AppSettings.longFailedToast('please select date'); AppSettings.longFailedToast('Select start date');
} }
}, },
); );
@ -308,7 +278,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
cursorColor: greyColor, cursorColor: greyColor,
controller: updateOfferEndDateController, controller: updateOfferEndDateController,
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Select End Date', labelText: 'Select end Date',
prefixIcon: IconButton( prefixIcon: IconButton(
icon: Icon( icon: Icon(
Icons.date_range, Icons.date_range,
@ -317,10 +287,10 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
onPressed: () async { onPressed: () async {
DatePicker.showDatePicker( DatePicker.showDatePicker(
context, context,
dateFormat: 'dd MMMM yyyy HH:mm', dateFormat: 'dd MMMM yyyy',
initialDateTime: DateTime.now(), initialDateTime: DateTime.now(),
minDateTime:DateTime.now(), minDateTime:DateTime.now(),
maxDateTime: DateTime.now().add(Duration(days: 15)), maxDateTime: DateTime.now().add(Duration(days: 365)),
onMonthChangeStartWithFirstDate: true, onMonthChangeStartWithFirstDate: true,
pickerMode: DateTimePickerMode.datetime, pickerMode: DateTimePickerMode.datetime,
pickerTheme: DateTimePickerTheme( pickerTheme: DateTimePickerTheme(
@ -334,7 +304,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
onConfirm: (dateTime, List<int> index)async { onConfirm: (dateTime, List<int> index)async {
DateTime selectdate = dateTime; DateTime selectdate = dateTime;
setState(() { setState(() {
enddate = DateFormat('dd-MMM-yyyy - HH:mm').format(selectdate); enddate = DateFormat('dd-MMM-yyyy').format(selectdate);
}); });
if(enddate!=''){ if(enddate!=''){
@ -343,7 +313,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
}); });
} }
else { else {
AppSettings.longFailedToast('please select date'); AppSettings.longFailedToast('Select end date');
} }
}, },
); );
@ -390,7 +360,6 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
payload["offer_name"] = updateOfferNameController.text.toString(); payload["offer_name"] = updateOfferNameController.text.toString();
payload["offer_code"] = updateOfferCodeController.text.toString(); payload["offer_code"] = updateOfferCodeController.text.toString();
payload["description"] = updateOfferDescriptionController.text.toString(); payload["description"] = updateOfferDescriptionController.text.toString();
payload["discount_percentage"] = updateDiscountController.text.toString();
payload["starting_date"] = updateOfferStartDateController.text.toString(); payload["starting_date"] = updateOfferStartDateController.text.toString();
payload["ending_date"] = updateOfferEndDateController.text.toString(); payload["ending_date"] = updateOfferEndDateController.text.toString();
payload["offer_status"] ="active"; payload["offer_status"] ="active";
@ -404,7 +373,6 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
updateOfferNameController.text = ''; updateOfferNameController.text = '';
updateOfferCodeController.text = ''; updateOfferCodeController.text = '';
updateOfferDescriptionController.text = ''; updateOfferDescriptionController.text = '';
updateDiscountController.text = '';
updateOfferStartDateController.text = ''; updateOfferStartDateController.text = '';
updateOfferEndDateController.text = ''; updateOfferEndDateController.text = '';
@ -451,69 +419,130 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
itemCount: activeOffersList.length, itemCount: activeOffersList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Card( return Card(
margin: EdgeInsets.all(8.0),
color: activeOffersList[index].cardColor, child: ListTile(
child: Padding( contentPadding: EdgeInsets.all(8.0),
padding:EdgeInsets.all(8) , leading: CircleAvatar(
child: Row( backgroundImage: AssetImage('images/logo.png'), // Replace with your image path
mainAxisAlignment: MainAxisAlignment.spaceBetween, radius: 30, // Adjust the radius as needed
crossAxisAlignment: CrossAxisAlignment.center, ),
children: [ title: RichText(
text: TextSpan(
Container( style: DefaultTextStyle.of(context).style,
//width: MediaQuery.of(context).size.width * .55, children: <TextSpan>[
child: Column( TextSpan(
children: [ text: 'Name: ',
Row( style: TextStyle(
mainAxisAlignment: MainAxisAlignment.start, color: Colors.black,
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: FontWeight.bold,
children: [ ),
Column( ),
mainAxisAlignment: MainAxisAlignment.start, TextSpan(
crossAxisAlignment: CrossAxisAlignment.start, text: activeOffersList[index].offer_name,
children: [ style: TextStyle(
Text('OfferName :',style: labelTextStyle()), color: primaryColor,
Text('OfferCode :',style: labelTextStyle()), ),
Text('OfferDes :' ,style: labelTextStyle()), ),
Text('offer :' ,style: labelTextStyle()),
Text('StartDate :',style: labelTextStyle()),
Text('EndDate :' ,style: labelTextStyle()),
], ],
), ),
SizedBox(width: 5,), ),
Column( subtitle: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(activeOffersList[index].offer_name,style: valuesTextStyle()), // ... (other RichText widgets for Code, Description, Start Date, End Date)
Text(activeOffersList[index].offer_code,style: valuesTextStyle()), RichText(
Text(activeOffersList[index].description,style: valuesTextStyle()), text: TextSpan(
Text(activeOffersList[index].offer,style: valuesTextStyle()), style: DefaultTextStyle.of(context).style,
Text(activeOffersList[index].starting_date,style: valuesTextStyle()), children: <TextSpan>[
Text(activeOffersList[index].ending_date,style: valuesTextStyle()) TextSpan(
text: 'Code: ',
], style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: activeOffersList[index].offer_code,
style: TextStyle(
color: primaryColor, // Change the color for description content
),
), ),
], ],
), ),
),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Description: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: activeOffersList[index].description,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
], ],
), ),
), ),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Start Date: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: activeOffersList[index].starting_date,
Expanded(child:IconButton( style: TextStyle(
icon: const Icon(Icons.edit,color: primaryColor,), color:primaryColor, // Change the color for description content
),
),
],
),
),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'End Date :',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: activeOffersList[index].ending_date,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(Icons.edit),
onPressed: () { onPressed: () {
showUpdateOfferDialog(activeOffersList[index]); showUpdateOfferDialog(activeOffersList[index]);
}, },
),), ),
Expanded(
child: Row(
children: [
Text(''),
Switch( Switch(
value: false, // Replace this with your actual property value: false, // Replace with your actual property
onChanged: (newValue) async { onChanged: (newValue) {
if (newValue) { if (newValue) {
// Show your AlertDialog for confirmation // Show your AlertDialog for confirmation
showDialog( showDialog(
@ -574,17 +603,21 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
//m;./ activeOffersList[index].isActive = false; //m;./ activeOffersList[index].isActive = false;
// You might want to add code to revert the In_Activation in your data model here // You might want to add code to revert the In_Activation in your data model here
} }
}, },
), ),
], ],
), ),
),
], ],
), ),
), ),
); );
}) ), }) ),
Padding( Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 8), padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
@ -672,121 +705,245 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
itemCount: inactiveOffersList.length, itemCount: inactiveOffersList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Card( return Card(
margin: EdgeInsets.all(8.0),
color: inactiveOffersList[index].cardColor, child: ListTile(
child: Padding( contentPadding: EdgeInsets.all(8.0),
padding:EdgeInsets.all(8) , leading: CircleAvatar(
child: Row( backgroundImage: AssetImage('images/logo.png'), // Replace with your image path
mainAxisAlignment: MainAxisAlignment.spaceBetween, radius: 30, // Adjust the radius as needed
crossAxisAlignment: CrossAxisAlignment.center, ),
children: [ title: RichText(
text: TextSpan(
Container( style: DefaultTextStyle.of(context).style,
//width: MediaQuery.of(context).size.width * .55, children: <TextSpan>[
child: Column( TextSpan(
children: [ text: 'Name: ',
Row( style: TextStyle(
mainAxisAlignment: MainAxisAlignment.start, color: Colors.black,
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: FontWeight.bold,
children: [ ),
Column( ),
mainAxisAlignment: MainAxisAlignment.start, TextSpan(
crossAxisAlignment: CrossAxisAlignment.start, text: inactiveOffersList[index].offer_name,
children: [ style: TextStyle(
Text('OfferName :',style: labelTextStyle()), color: primaryColor,
Text('OfferCode :',style: labelTextStyle()), ),
Text('OfferDes :' ,style: labelTextStyle()), ),
Text('OfferDis(%) :' ,style: labelTextStyle()),
Text('StartDate :',style: labelTextStyle()),
Text('EndDate :' ,style: labelTextStyle()),
], ],
), ),
SizedBox(width: 5,), ),
Column( subtitle: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(inactiveOffersList[index].offer_name,style: valuesTextStyle()), RichText(
Text(inactiveOffersList[index].offer_code,style: valuesTextStyle()), text: TextSpan(
Text(inactiveOffersList[index].description,style: valuesTextStyle()), style: DefaultTextStyle.of(context).style,
Text(inactiveOffersList[index].offer,style: valuesTextStyle()), children: <TextSpan>[
Text(inactiveOffersList[index].starting_date,style: valuesTextStyle()), TextSpan(
Text(inactiveOffersList[index].ending_date,style: valuesTextStyle()) text: 'Code: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: inactiveOffersList[index].offer_code,
style: TextStyle(
color: primaryColor, // Change the color for description content
),
),
], ],
), ),
),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Description: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: inactiveOffersList[index].description,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
],
),
),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Start Date: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: inactiveOffersList[index].starting_date,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
], ],
), ),
),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'End Date :',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: inactiveOffersList[index].ending_date,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
], ],
), ),
), ),
Expanded(child:TextButton( SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () { onPressed: () {
showDialog( showDialog(
//if set to true allow to close popup by tapping out of the popup //if set to true allow to close popup by tapping out of the popup
//barrierDismissible: false, //barrierDismissible: false,
context: context, context: context,
builder: (BuildContext context) => AlertDialog( builder: (BuildContext context) => AlertDialog(
title: const Text('Do you want to Re_Active offer ??', title: const Text(
'Do you want to Re-Active 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 deleteTankStatus = await AppSettings.reactiveOffers(inactiveOffersList[index].offer_code); bool deleteTankStatus = await AppSettings.reactiveOffers(inactiveOffersList[index].offer_code);
if(deleteTankStatus){ if (deleteTankStatus) {
getInactiveOffersViewData(); getInactiveOffersViewData();
AppSettings.longSuccessToast('offer Re_Active successfully'); AppSettings.longSuccessToast('offer Re-Active successfully');
getActiveOffersViewData(); getActiveOffersViewData();
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
} else {
} AppSettings.longFailedToast('offer Re-Active failed');
else{
AppSettings.longFailedToast('offer Re_Active failed');
} }
}, },
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,
)), ),
),
), ),
], ],
), ),
); );
}, },
child: const Text( child: Text(
'RE_ACTIVE', 'Re-activate',
style: TextStyle(
color: primaryColor, // You can set the text color to your preference.
fontSize: 16, // You can adjust the font size as needed.
),
),
),
IconButton(
icon: Icon(
Icons.delete,
color: primaryColor, // Customize the delete icon color
),
onPressed: () async{
showDialog(
//if set to true allow to close popup by tapping out of the popup
//barrierDismissible: false,
context: context,
builder: (BuildContext context) => AlertDialog(
title: const Text('Do you want to delete Offer?',
style: TextStyle( style: TextStyle(
color: primaryColor, color: primaryColor,
fontSize: 15, fontSize: 20,
fontWeight: FontWeight.bold )),
/* decoration: TextDecoration.underline,*/ actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: ()async {
bool deleteOfferStatus = await AppSettings.deleteInActiveOffer(inactiveOffersList[index].offer_code);
if(deleteOfferStatus){
getInactiveOffersViewData();
AppSettings.longSuccessToast('Offer deleted successfully');
Navigator.of(context).pop(true);
}
else{
AppSettings.longFailedToast('Offer deletion failed');
}
},
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
), ),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
), ),
],
), ),
);
},
), ),
], ],
),
],
), ),
), ),
); );

@ -1,7 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/models/offersview_model.dart'; import 'package:healthcare_pharmacy/models/offersview_model.dart';
import 'package:healthcare_pharmacy/offers.dart'; import 'package:healthcare_pharmacy/createoffers.dart';
import 'package:healthcare_pharmacy/settings.dart'; import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';

@ -20,6 +20,8 @@ class _OtpScreenState extends State<OtpScreen> {
final TextEditingController _fieldSix = TextEditingController(); final TextEditingController _fieldSix = TextEditingController();
TextEditingController mobileNumberController = TextEditingController(); TextEditingController mobileNumberController = TextEditingController();
TextEditingController passwordController = TextEditingController(); TextEditingController passwordController = TextEditingController();
TextEditingController otpController = TextEditingController();
bool isTextfieldVisible=true; bool isTextfieldVisible=true;
bool isOtpVisible=false; bool isOtpVisible=false;
@ -35,36 +37,6 @@ class _OtpScreenState extends State<OtpScreen> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
const Text('Phone Number Verification'), const Text('Phone Number Verification'),
Visibility(
visible: false,
child: Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: mobileNumberController,
keyboardType: TextInputType.number,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.phone,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color:greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter MobileNumber',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),),
const SizedBox( const SizedBox(
height: 30, height: 30,
), ),
@ -100,49 +72,6 @@ class _OtpScreenState extends State<OtpScreen> {
const SizedBox( const SizedBox(
height: 30, height: 30,
), ),
Visibility(
visible: false,
child: Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
cursorColor: greyColor,
obscureText: isObscureText,
controller: passwordController,
decoration: InputDecoration(
labelText: 'Password',
prefixIcon: const Icon(Icons.password, color: greyColor,),
labelStyle: const TextStyle(
color: greyColor, //<-- SEE HERE
),
border: const OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(color: textFieldStartColor),
),
suffixIcon: IconButton(
icon: Icon(
Icons.visibility_off_outlined,
color: isObscureText==true?greyColor:primaryColor,
),
onPressed: () {
print("show password");
setState(() {
isObscureText = !isObscureText;
});
},
),
),
),
),),
const SizedBox(
height: 30,
),
Visibility( Visibility(
visible: true, visible: true,
child: Container( child: Container(
@ -164,6 +93,9 @@ class _OtpScreenState extends State<OtpScreen> {
}); });
if (_otp!.length == 6) { if (_otp!.length == 6) {
// Set the OTP to the otpController
otpController.text = _otp!;
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
bool isOnline = await AppSettings.internetConnectivity(); bool isOnline = await AppSettings.internetConnectivity();

@ -125,7 +125,7 @@ InputDecoration textFormFieldDecoration(IconData icon,var text){
), ),
labelText: text, labelText: text,
labelStyle: labelStyle:
TextStyle(color: primaryColor, fontWeight: FontWeight.bold //<-- SEE HERE TextStyle(color: Color(0xFF7A7575), fontWeight: FontWeight.bold //<-- SEE HERE
), ),
); );
} }
@ -170,22 +170,28 @@ class AppSettings {
static String verifyPhnUrl = host + 'phone'; static String verifyPhnUrl = host + 'phone';
static String profilePicUrl = host + 'users/profile-picture'; static String profilePicUrl = host + 'users/profile-picture';
static String uploadPicUrl = host + 'uploadsPharmacy'; static String uploadPicUrl = host + 'uploadsPharmacy';
static String uploadOfferUrl = host + 'uploads-offerPicture';
static String resetTokenUrl = host + 'reset_token'; static String resetTokenUrl = host + 'reset_token';
static String forgotPasswordUrl = host + 'forgotpassword'; static String forgotPasswordUrl = host + 'forgotpassword';
static String resetPasswordUrl = host + 'resetpassword'; static String resetPasswordUrl = host + 'resetpassword';
static String sendSmsUrl = host + 'sendSms'; static String sendSmsUrl = host + 'sendSms';
static String phoneVerificationUrl = host + 'pharmacyphone'; static String phoneVerificationUrl = host + 'pharmacyphone';
static String createOffersUrl = host + 'addoffer'; static String createOffersUrl = host + 'addoffer';
static String createCompanyOffersUrl = host + 'addcompanyoffer';
static String getOffersActiveDataUrl = host + 'getActivePharmacyOfferdata'; static String getOffersActiveDataUrl = host + 'getActivePharmacyOfferdata';
static String getOffersinActiveDataUrl = host + 'getInActivePharmacyOfferdata'; static String getOffersinActiveDataUrl = host + 'getInActivePharmacyOfferdata';
static String updateOffersDataUrl = host + 'updateOffer'; static String updateOffersDataUrl = host + 'updateOffer';
static String deleteOffersDataUrl = host + 'deleteOffer'; static String inactiveOffersDataUrl = host + 'inactiveOffer';
static String reactiveOffersDataUrl = host + 'reactiveOffer'; static String reactiveOffersDataUrl = host + 'reactiveOffer';
static String deleteOfferUrl = host + 'deleteOffer';
static String medecineDataUrl = host + 'medicine'; static String medecineDataUrl = host + 'medicine';
static String getAllBiddingDataUrl = host + 'getBiddingRequests'; static String getAllBiddingDataUrl = host + 'getBiddingRequests';
static String getRequestBiddingDataUrl = host + 'biddingRequest'; static String getRequestBiddingDataUrl = host + 'biddingRequest';
static String addToCartDataUrl = host + 'cart/add'; static String addToCartDataUrl = host + 'cart/add';
static String getCartDataUrl = host + 'cart/total-price'; static String getCartDataUrl = host + 'cart/total-price';
static String getPharmacyDataUrl = host + 'getAllPharmacylist';
@ -206,6 +212,8 @@ class AppSettings {
static File? updatedImage; static File? updatedImage;
static String image = ''; static String image = '';
static String profilePictureUrl = ''; static String profilePictureUrl = '';
static String offerPictureUrl = '';
static var api = { static var api = {
'signIn': host + '/login', 'signIn': host + '/login',
}; };
@ -373,6 +381,19 @@ class AppSettings {
} }
static Future<String> offeruploadImageHTTPNew(file) async {
var request = http.MultipartRequest('POST', Uri.parse(uploadOfferUrl + '/' + healthpharmaIdsign));
request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send();
var response = await http.Response.fromStream(res);
return response.body;
}
static Future<bool> updatePharmaData(payload) async { static Future<bool> updatePharmaData(payload) async {
try { try {
var response = await http.put( var response = await http.put(
@ -430,6 +451,79 @@ class AppSettings {
return false; return false;
} }
} }
static Future<bool> deleteInActiveOffer(offerCode) async {
var uri = Uri.parse(deleteOfferUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'offer_code=$offerCode');
try {
var response =
await http.put(uri, headers: await buildPutRequestHeaders());
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 buildPutRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<bool> createCompanyOffers(payload) async {
var uri = Uri.parse(createCompanyOffersUrl + '/' + "123456");
var response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
try {
var _response = json.decode(response.body);
print(_response);
return true;
} catch (e) {
// 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;
}
}
static Future<String> getOffers() async { static Future<String> getOffers() async {
//path parameter //path parameter
var uri = Uri.parse(getOffersActiveDataUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(getOffersActiveDataUrl + '/' + healthpharmaIdsign);
@ -535,6 +629,30 @@ class AppSettings {
}*/ }*/
static Future<String> getPharmacyData() async {
var uri = Uri.parse(getPharmacyDataUrl);
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> getAllBiddingRecords() async { static Future<String> getAllBiddingRecords() async {
//path parameter //path parameter
var uri = Uri.parse(getAllBiddingDataUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(getAllBiddingDataUrl + '/' + healthpharmaIdsign);
@ -682,7 +800,7 @@ class AppSettings {
} }
} }
static Future<bool> deleteOffers(offer_code) async { static Future<bool> deleteOffers(offer_code) async {
var uri = Uri.parse(deleteOffersDataUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(inactiveOffersDataUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'offer_code=$offer_code'); uri = uri.replace(query: 'offer_code=$offer_code');
try { try {
@ -899,6 +1017,8 @@ class AppSettings {
static Future<void> saveProfile(dynamic image) async { static Future<void> saveProfile(dynamic image) async {
// save login name information // save login name information
await saveData('profile', image.toString(), 'STRING'); await saveData('profile', image.toString(), 'STRING');
await saveData('offer', image.toString(), 'STRING');
//await loadDataFromMemory(); //await loadDataFromMemory();
} }
@ -915,6 +1035,8 @@ class AppSettings {
healthpharmaIdsign = await getData('pharmacyId', 'STRING'); healthpharmaIdsign = await getData('pharmacyId', 'STRING');
userLatitude = await getData('latitude', 'DOUBLE'); userLatitude = await getData('latitude', 'DOUBLE');
profilePictureUrl=await getData('profile', 'STRING'); profilePictureUrl=await getData('profile', 'STRING');
profilePictureUrl=await getData('profile', 'STRING');
offerPictureUrl=await getData('offer', 'STRING');
userLongitude =await getData('longitude', 'DOUBLE'); userLongitude =await getData('longitude', 'DOUBLE');
fcmId =await getData('fcmId', 'STRING'); fcmId =await getData('fcmId', 'STRING');
} }

@ -178,7 +178,7 @@ class _SignUpState extends State<SignUp> {
cursorColor: greyColor, cursorColor: greyColor,
controller: nameController, controller: nameController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
decoration: textFormFieldDecoration(Icons.person,'Name'), decoration: textFormFieldDecoration(Icons.person,'Enter Your Name'),
), ),
), //name ), //name
@ -212,7 +212,7 @@ class _SignUpState extends State<SignUp> {
cursorColor: greyColor, cursorColor: greyColor,
controller: emailController, controller: emailController,
keyboardType: TextInputType.emailAddress, keyboardType: TextInputType.emailAddress,
decoration: textFormFieldDecoration(Icons.email,'Enter Your Mail'), decoration: textFormFieldDecoration(Icons.email,'Enter Your Email'),
), ),
), ),
@ -344,7 +344,7 @@ class _SignUpState extends State<SignUp> {
cursorColor: greyColor, cursorColor: greyColor,
controller: userAddressDescriptionController, controller: userAddressDescriptionController,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
decoration: textFormFieldDecoration(Icons.plagiarism_outlined,'Address Description (Ex: Flat No)'), decoration: textFormFieldDecoration(Icons.plagiarism_outlined,'Address Description ex:FlatNo [Optional]'),
), ),
),//address description ),//address description
const SizedBox( const SizedBox(

Loading…
Cancel
Save