Compare commits

..

4 Commits
dev ... master

@ -34,14 +34,6 @@ android {
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.arminta.healthcare_pharmacy" applicationId "com.arminta.healthcare_pharmacy"
@ -68,4 +60,6 @@ flutter {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation(platform("com.google.firebase:firebase-bom:32.7.0"))
} }

@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "60196905754",
"project_id": "health-pharma-67443",
"storage_bucket": "health-pharma-67443.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:60196905754:android:05ea9ecef5280e578a42a3",
"android_client_info": {
"package_name": "com.arminta.healthcare_pharmacy"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyC89L-Xg53Bd_mdCPvKOu7BcC9Ya6UZeds"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:60196905754:android:a35c084e291315488a42a3",
"android_client_info": {
"package_name": "com.arminta.healthparma"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyC89L-Xg53Bd_mdCPvKOu7BcC9Ya6UZeds"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

@ -11,6 +11,14 @@
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<application <application
android:label="pharmacy" android:label="pharmacy"
android:name="${applicationName}" android:name="${applicationName}"

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,11 +1,12 @@
buildscript { buildscript {
ext.kotlin_version = '1.7.10' ext.kotlin_version = '1.8.22'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.android.tools.build:gradle:7.1.2' classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
@ -26,6 +27,6 @@ subprojects {
project.evaluationDependsOn(':app') project.evaluationDependsOn(':app')
} }
task clean(type: Delete) { tasks.register("clean", Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

@ -0,0 +1,6 @@
class ChatMessage{
String message;
String type;
ChatMessage({required this.message,required this.type});
}

@ -0,0 +1,125 @@
import 'dart:convert';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:shared_preferences/shared_preferences.dart';
class PushNotificationService {
final FirebaseMessaging _fcm = FirebaseMessaging.instance;
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
// Constructor to initialize the FCM token
PushNotificationService() {
_initFCMToken();
}
Future<void> _initFCMToken() async {
// Get the stored FCM token
AppSettings.fcmId = await _getStoredFCMToken();
// If FCM token is not available, request a new one
if (AppSettings.fcmId.isEmpty) {
await _fcm.getToken().then((token) {
print('FCM Token: $token');
// Store the FCM token directly in AppSettings
AppSettings.fcmId = token!;
_storeFCMToken(token);
});
}
}
Future<void> _storeFCMToken(String token) async {
// Store the FCM token using SharedPreferences
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setString('fcmToken', token);
}
Future<String> _getStoredFCMToken() async {
// Retrieve the stored FCM token from SharedPreferences
SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.getString('fcmToken') ?? '';
}
Future<void> initialize() async {
// Request permission for user notifications
await _fcm.requestPermission();
// Get the FCM token and handle incoming messages while the app is in the foreground
_fcm.getToken().then((token) {
print('FCM Token: $token');
// Do something with the token (e.g., send it to your server)
});
// Listen to incoming messages while the app is in the foreground
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
print("data::::$message");
// var payload = message.data.toString();
// // Handle the incoming message
// Map<String, dynamic> notificationPayload = jsonDecode(payload);
// Access the extra data using the keys
var payload=message.data;
var extramessage;
if(payload.isNotEmpty){
extramessage = message.data['extraKey1'];
String? extraValue2 = message.data['extraKey2'];
}
// Show a local notification with the received message
_showNotification(message.notification?.title, message.notification?.body,extramessage);
});
// Handle messages when the app is in the background or terminated
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
var payload = message.data.toString();
if (payload != null) {
// Parse the JSON payload
Map<String, dynamic> notificationPayload = jsonDecode(payload);
// Access the extra data using the keys
String? extraValue1 = notificationPayload['extraKey1'];
String? extraValue2 = notificationPayload['extraKey2'];
// Do something with the extra data, e.g., display it in a dialog or use it in your app logic.
}
// Show a local notification with the received message
// _showNotification(message.notification?.title, message.notification?.body);
});
}
// Method to show a local notification using flutter_local_notifications
Future<void> _showNotification(String? title, String? body,String extramessage) async {
const AndroidNotificationDetails androidPlatformChannelSpecifics =
AndroidNotificationDetails(
'healthpharma', // Replace with your channel ID
'healthpharmanotifications', // Replace with your channel name
importance: Importance.high,
priority: Priority.high,
showWhen: false,
icon: "logo"
);
const NotificationDetails platformChannelSpecifics =
NotificationDetails(android: androidPlatformChannelSpecifics);
Map<String, dynamic> notificationPayload = {
"body": body,
"title": title,
"extraKey1": extramessage,
"extraKey2": "Extra Value 2",
// Add more key-value pairs as needed
};
await _flutterLocalNotificationsPlugin.show(
0, // notification ID (can be any unique ID)
title, // notification title
body, // notification body
platformChannelSpecifics,
payload: jsonEncode(notificationPayload), // optional, you can pass data or identifier related to the notification
);
}
}

@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:photo_view/photo_view.dart';
class ZoomedImageView extends StatelessWidget {
final String imageUrl;
ZoomedImageView({required this.imageUrl});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: primaryColor, // Set the background color
title: Text('Preview Image'), // Set the title text
actions: [
IconButton(
icon: Icon(Icons.close),
onPressed: () {
Navigator.pop(context);
},
),
],
),
body: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Center(
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
child: PhotoView(
imageProvider: NetworkImage(imageUrl),
maxScale: PhotoViewComputedScale.contained * 4.0,
minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained,
basePosition: Alignment.center,
),
),
),
),
);
}
}

@ -0,0 +1,430 @@
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/keys.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:flutter/services.dart';
import 'dart:io' show File, Platform;
import 'package:google_maps_flutter_android/google_maps_flutter_android.dart';
import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';
import 'package:location/location.dart' as locationmap;
import 'google_maps_place_picker_mb/src/models/pick_result.dart';
import 'google_maps_place_picker_mb/src/place_picker.dart';
class Deliverboy extends StatefulWidget {
const Deliverboy({Key? key}) : super(key: key);
@override
State<Deliverboy> createState() => _deliverboyState();
}
class _deliverboyState extends State<Deliverboy> {
TextEditingController pharmacyNameController = TextEditingController();
TextEditingController deliverNameController = TextEditingController();
TextEditingController deliveryPhoneNumberController = TextEditingController();
TextEditingController deliveryAlternativePhoneNumberController = TextEditingController();
TextEditingController deliveryAddressCapturingController = TextEditingController();
String _currentAddress ='';
String address1 = '';
String address2 = '';
String city = '';
String state = '';
String zip = '';
String status = '';
double lat=0;
double lng=0;
PickResult? selectedPlace;
bool _mapsInitialized = false;
final String _mapsRenderer = "latest";
var kInitialPosition = const LatLng(15.462477, 78.717401);
locationmap.Location location = locationmap.Location();
final GoogleMapsFlutterPlatform mapsImplementation =
GoogleMapsFlutterPlatform.instance;
void initRenderer() {
if (_mapsInitialized) return;
if (mapsImplementation is GoogleMapsFlutterAndroid) {
switch (_mapsRenderer) {
case "legacy":
(mapsImplementation as GoogleMapsFlutterAndroid)
.initializeWithRenderer(AndroidMapRenderer.legacy);
break;
case "latest":
(mapsImplementation as GoogleMapsFlutterAndroid)
.initializeWithRenderer(AndroidMapRenderer.latest);
break;
}
}
setState(() {
_mapsInitialized = true;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar:AppSettings.appBar('Add Deliveryboy'),
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: pharmacyNameController,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.propane_tank,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter pharmacy name',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
), //tanker name
),
const SizedBox(
height: 15,
),
Container(
//padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: deliverNameController,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.propane_tank,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter deliveryboy name',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
), //tanker name
),
const SizedBox(
height: 5,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: deliveryPhoneNumberController,
keyboardType: TextInputType.number,
maxLength: 10,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.phone_android,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter phone number',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
), //phone number
const SizedBox(
height: 5,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: deliveryAlternativePhoneNumberController,
keyboardType: TextInputType.number,
maxLength: 10,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.phone_android,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter alternative phone number',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
), //alternative phone number
const SizedBox(
height: 5,
),
GestureDetector(
child:Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
controller: deliveryAddressCapturingController,
onTap:()
{
//=============================================================================================
location.serviceEnabled().then((value) {
if (value) {
initRenderer();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) {
return PlacePicker(
resizeToAvoidBottomInset: false,
hintText: "Find a place ...",
searchingText: "Please wait ...",
selectText: "Select place",
outsideOfPickAreaText: "Place not in area",
initialPosition: kInitialPosition,
useCurrentLocation: true,
selectInitialPosition: true,
usePinPointingSearch: true,
usePlaceDetailSearch: true,
zoomGesturesEnabled: true,
zoomControlsEnabled: true,
onMapCreated: (GoogleMapController controller) {},
onPlacePicked: (PickResult result) {
setState(() {
selectedPlace = result;
lat=selectedPlace!.geometry!.location.lat;
lng=selectedPlace!.geometry!.location.lng;
if(selectedPlace!.types!.length==1){
deliveryAddressCapturingController.text =
selectedPlace!.formattedAddress!;
}
else{
deliveryAddressCapturingController.text =selectedPlace!.name!+', '+selectedPlace!.formattedAddress!;
}
Navigator.of(context).pop();
});
},
onMapTypeChanged: (MapType mapType) {},
apiKey: Platform.isAndroid
? APIKeys.androidApiKey
: APIKeys.iosApiKey,
forceAndroidLocationManager: true,
);
},
),
);
} else {
showGeneralDialog(
context: context,
pageBuilder: (context, x, y) {
return Scaffold(
backgroundColor: Colors.grey.withOpacity(.5),
body: Center(
child: Container(
width: double.infinity,
height: 150,
padding:
const EdgeInsets.symmetric(horizontal: 20),
child: Card(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"Please enable the location",
style: TextStyle(
fontSize:18,
fontWeight: FontWeight.w500,
),
),
const SizedBox(
height: 20,
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
},
child: const Text("Cancel"),
),
],
),
),
),
),
),
);
},
);
}
});
//=====================================================================================
// _getCurrentPosition();
},
keyboardType: TextInputType.streetAddress,
readOnly: false,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.location_on_rounded,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'select address from MAP',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
/* onTap: ()
{
},*///address
),
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 (deliverNameController.text != '' &&
deliveryPhoneNumberController.text != ''
) {
AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["pharmacyname"] = pharmacyNameController.text.toString();
payload["Name"] = deliverNameController.text.toString();
payload["phone"] = deliveryPhoneNumberController.text.toString();
payload["alternativeContactNumber"] = deliveryAlternativePhoneNumberController.text.toString();
payload["address"] = deliveryAddressCapturingController.text;
payload["city"] = city;
payload["state"] = state;
payload["zip"] = zip;
payload["latitude"] = lat;
payload["longitude"] = lng;
payload["status"] = status;
bool deliveryboyStatus = await AppSettings.addDeliverboy(payload);
try {
if (deliveryboyStatus) {
AppSettings.longSuccessToast(
"Deliverboy Created Successfully");
deliverNameController.text= '';
deliveryPhoneNumberController.text= '';
deliveryAlternativePhoneNumberController.text= '';
Navigator.of(context,rootNavigator: true).pop();
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Dashboard()),
);
} else {
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast("Deliverboy not Created Successfully");
}
} catch (exception) {
print(exception);
}
}
else {
AppSettings.longFailedToast("Please enter valid details");
}
},
child: const Text(
'Add Deliverboy',
style: TextStyle(
fontSize: 25,
),
),
)),
],
),
)),
);
}
}

@ -0,0 +1,369 @@
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/createoffers.dart';
import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/models/approvedoffer_model.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 ApprovedOffersData extends StatefulWidget {
const ApprovedOffersData({Key? key}) : super(key: key);
@override
State<ApprovedOffersData> createState() => _ApprovedOffersDataState();
}
class _ApprovedOffersDataState extends State<ApprovedOffersData> {
bool isOfferDataLoading=false;
bool isSereverIssue = false;
bool isSereverIssueConnected = false;
bool isSereverIssuePending = false;
List<GetApprovedOffersDetailsModel> approvedOffersList = [];
final ImagePicker _picker = ImagePicker();
bool isActiveDataLoading=false;
Future<void> getApprovedOffersViewData() async {
isActiveDataLoading = true;
try {
var data = await AppSettings.getApprovedOffers();
setState(() {
List<dynamic> responseData = jsonDecode(data)['data'];
approvedOffersList = responseData
.map((jsonObject) => GetApprovedOffersDetailsModel.fromJson(jsonObject))
.toList();
isActiveDataLoading = false;
});
} catch (error) {
setState(() {
isActiveDataLoading = false;
isSereverIssueConnected = true;
});
}
}
@override
void initState() {
getApprovedOffersViewData();
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 renderzActiveUi(){
if(approvedOffersList.length!=0){
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:ListView.builder(
padding: EdgeInsets.all(0),
itemCount: approvedOffersList .length,
itemBuilder: (context,index){
var data=approvedOffersList[index];
return GestureDetector(
onTap: () {
},
child: Card(
child: ListTile(
leading: GestureDetector(
onTap: () {
showPicDialog(approvedOffersList[index].picture[0].url);
},
child: Container(
width: 100,
height: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
image: DecorationImage(
fit: BoxFit.cover,
alignment: Alignment.center,
image: data.picture.isEmpty
? AssetImage('images/logo.png') as ImageProvider
: NetworkImage(approvedOffersList[index].picture[0].url),
),
),
),
),
title: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Name: ',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: approvedOffersList[index].offer_name,
style: TextStyle(
color: primaryColor,
),
),
],
),
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// ... (other RichText widgets for Code, Description, Start Date, End Date)
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
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: approvedOffersList[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: approvedOffersList[index].description,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
],
),
),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Category: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: approvedOffersList[index].category,
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: approvedOffersList[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: approvedOffersList[index].ending_date,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
],
),
),
],
),
),
),
);
}) ),
Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
child: CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
iconSize: 40,
icon: const Icon(
Icons.add,
color: Colors.white,
),
onPressed: () async{
Navigator.pop(context);
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => offers()),
);
//showBoreAddingDialog();
},
),
/* Padding(
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Text(
'Add Tanks ',
style: TextStyle(color: Colors.white),
),
)*/
],
),
),
),
]);
}
else{
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('Click below icon to add new Offer'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.add,
color: Colors.white,
),
onPressed: () async {
Navigator.pop(context);
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => offers()),
);
},
),
)
],
),
)
);
}
}
/**/
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppSettings.appBar('Approved Ofers'),
body: isActiveDataLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):renderzActiveUi(),
));
}
}

@ -5,7 +5,10 @@ import 'package:flutter/services.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:healthcare_pharmacy/getmedicines.dart'; import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/models/biddingrequest_model.dart'; import 'package:healthcare_pharmacy/models/biddingrequest_model.dart';
import 'package:healthcare_pharmacy/models/getdeliveryboy_model.dart';
import 'package:healthcare_pharmacy/settings.dart'; import 'package:healthcare_pharmacy/settings.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
import 'package:intl/intl.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
@ -20,27 +23,47 @@ class BiddingRequests extends StatefulWidget {
class _BiddingRequestsState extends State<BiddingRequests> { class _BiddingRequestsState extends State<BiddingRequests> {
String Url = ''; String Url = '';
List<BiddingRequestsModel> prescriptionsList = []; List<BiddingRequestsModel> prescriptionsList = [];
List<BiddingRequestsModel> prescriptionsListOriginal = []; List<GetDeliveryboyDetailsModel> modeldeliveryboyList = [];
var dropdownAllDeliveryBoys;
TextEditingController dateController = TextEditingController();
var selIOS;
bool isPrescriptionsDataLoading = false; bool isPrescriptionsDataLoading = false;
bool isSereverIssue = false; bool isSereverIssue = false;
bool isLoading=false; bool isLoading=false;
Future<void> getAllPrescriptions() async { Future<void> getAllPrescriptions() async {
isPrescriptionsDataLoading=true; isPrescriptionsDataLoading=true;
try { try {
var response = await AppSettings.getAllBiddingRecords(); var response = await AppSettings.getAllBiddingRecords();
print(response);
/*for (var item in data) {
BiddingRequestsModel biddingRequestsModel=new BiddingRequestsModel();
biddingRequestsModel.bidding_bookingid = item['bookingId']!;
biddingRequestsModel.pharmacyid_bidding = item['pharmacyId']!;
biddingRequestsModel.custumerid_bidding = item['customerId']!;
biddingRequestsModel.amount_bidding = item['biddingAmount']!.toString();
String? firstName = item['customerDetails']?['firstName'];
String? contactNumber = item['customerDetails']?['profile']?['contactNumber'];
print('First Name: $firstName');
biddingRequestsModel.bidding_firstName = firstName ; // Provide a default value if firstName is null
// biddingRequestsModel.bidding_contactNumber=contactNumber;
prescriptionsList.add(biddingRequestsModel);
}*/
setState(() { setState(() {
prescriptionsList = prescriptionsList =
((jsonDecode(response)['data']) as List).map((dynamic model) { ((jsonDecode(response)['data']) as List).map((dynamic model) {
return BiddingRequestsModel.fromJson(model); return BiddingRequestsModel.fromJson(model);
}).toList(); }).toList();
//String customerId=prescriptionsList[0].customerId.toString();
isPrescriptionsDataLoading = false; isPrescriptionsDataLoading = false;
}); });
} catch (e) { } catch (e) {
setState(() { setState(() {
isLoading = false; isLoading = false;
@ -49,55 +72,86 @@ class _BiddingRequestsState extends State<BiddingRequests> {
} }
} }
Future<void> getAllDeliveryBoys() async {
var response1= await AppSettings.getAllDeliverboy();
print(response1);
setState(() {
modeldeliveryboyList =
((jsonDecode(response1)['deliveryBoys']) as List).map((dynamic model) {
return GetDeliveryboyDetailsModel.fromJson(model);
}).toList();
dropdownAllDeliveryBoys=modeldeliveryboyList[0];
});
}
@override @override
void initState() { void initState() {
getAllPrescriptions(); getAllPrescriptions();
getAllDeliveryBoys();
//getAllPharmaciesData(dropdownArea); //getAllPharmaciesData(dropdownArea);
super.initState(); super.initState();
} }
showPicDialog(var imageUrl){ showPicDialog(List<PrescriptionPicture> prescriptionPictures) {
return showDialog( int currentIndex = 0;
showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder( return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
return AlertDialog( return Dialog(
title: const Text(''), // Your custom dialog design here
content: SingleChildScrollView( child: Container(
child: ListBody( width: double.infinity,
children: <Widget>[ height: MediaQuery.of(context).size.height * 0.6,
Container( child: Column(
width: MediaQuery.of(context).size.width * .10, children: [
height: MediaQuery.of(context).size.height * .50, Expanded(
child: PageView.builder(
itemCount: prescriptionPictures.length,
controller: PageController(initialPage: currentIndex),
onPageChanged: (index) {
setState(() {
currentIndex = index;
});
},
itemBuilder: (BuildContext context, int index) {
return Container(
width: double.infinity,
height: double.infinity,
child: PhotoView( child: PhotoView(
imageProvider: NetworkImage(imageUrl) as ImageProvider, imageProvider: NetworkImage(prescriptionPictures[index].url),
maxScale: PhotoViewComputedScale.contained * 4.0, maxScale: PhotoViewComputedScale.contained * 4.0,
minScale: PhotoViewComputedScale.contained, minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained, initialScale: PhotoViewComputedScale.contained,
basePosition: Alignment.center, basePosition: Alignment.center,
),
) );
) },
],
), ),
), ),
actions: <Widget>[
TextButton( TextButton(
child: Text('Close', style: textButtonStyle()), child: Text('Close'),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),
], ],
),
),
);
},
); );
});
}, },
); );
} }
Widget _allPrescriptions(){ Widget _allPrescriptions(){
if (prescriptionsList.length != 0) { if (prescriptionsList.length != 0) {
return Column( return Column(
@ -107,13 +161,212 @@ class _BiddingRequestsState extends State<BiddingRequests> {
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
itemCount: prescriptionsList.length, itemCount: prescriptionsList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return GestureDetector( return GestureDetector(
onTap: (){ onTap: () {
// Your regular tap action logic goes here
Navigator.push( Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new GetMedicines(medicinebookingid:prescriptionsList[index].bidding_bookingid))); builder: (__) => new GetMedicines(medicinebookingid:prescriptionsList[index].bookingId)));
},
onLongPress: () {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return AlertDialog(
title: const Text('Assign'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: DropdownButtonFormField<GetDeliveryboyDetailsModel>(
// Initial Value
value: dropdownAllDeliveryBoys,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.water,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Select delivery boy',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Select delivery boy'),
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
items: modeldeliveryboyList
.map<DropdownMenuItem<GetDeliveryboyDetailsModel>>(
(value) => new DropdownMenuItem<GetDeliveryboyDetailsModel>(
value: value,
child: new Text(value.deliveryboy_name),
))
.toList(),
onChanged: (GetDeliveryboyDetailsModel? newValue) {
setState(() {
dropdownAllDeliveryBoys = newValue;
});
}, },
),
),
SizedBox(
height: 05,
),
Container(
padding: const EdgeInsets.all(10),
child: TextFormField(
cursorColor: greyColor,
enabled: false,
controller: dateController,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.date_range,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Select date & time',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
SizedBox(
height: 05,
),
],
),
),
actions: <Widget>[
TextButton(
child: Text('cancel', style: textButtonStyle()),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: Text('Assign ', style: textButtonStyle()),
onPressed: () async{
var payload = new Map<String, dynamic>();
payload["pharmacyname"] =
AppSettings.pharmacyName;
payload["pharmacyId"] =
AppSettings.pharmacyId;
payload["customerId"] =
prescriptionsList[index].customerId;
payload["address"] =
prescriptionsList[index]
.address;
payload["dateOfOrder"] =
prescriptionsList[index].bookingId;
payload["action"] = "accept";
payload["price"] =
prescriptionsList[index].amount;
payload["delivery_agent"] = dropdownAllDeliveryBoys.deliveryboy_name;
payload["agent_mobile"] = dropdownAllDeliveryBoys.deliveryboy_phone;
payload["agent_alternative_mobile"] = dropdownAllDeliveryBoys.deliveryboy_alternativeContactNumber;
payload["expectedDateOfDelivery"] =dateController.text.toString();
bool requestStatus =
await AppSettings.assignDeliveryboyBookingRequests(
prescriptionsList[index].bookingId,
payload);
if (requestStatus) {
Navigator.of(context).pop();
AppSettings.longSuccessToast(
"Delivery Boy Assigned Successfully");
await getAllPrescriptions();
} else {}
},
),
IconButton(
onPressed: () async {
DatePicker.showDatePicker(
context,
dateFormat: 'dd MMMM yyyy HH:mm',
initialDateTime: DateTime.now(),
minDateTime:DateTime.now(),
maxDateTime: DateTime.now().add(Duration(days: 15)),
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 - HH:mm').format(selectdate);
});
if(selIOS!=''){
setState(() {
dateController.text=selIOS.toString();
});
}
else {
AppSettings.longFailedToast('please select date');
}
},
);
},
icon: Icon(
Icons.calendar_month,
color: primaryColor,
))
],
);
});
},
);
},
child: Card( child: Card(
//color: prescriptionsList[index].cardColor, //color: prescriptionsList[index].cardColor,
@ -128,25 +381,22 @@ class _BiddingRequestsState extends State<BiddingRequests> {
children: [ children: [
GestureDetector( GestureDetector(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .18, width: MediaQuery.of(context).size.width * 0.18,
height: height: MediaQuery.of(context).size.height * 0.10,
MediaQuery.of(context).size.height * .10,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
image: DecorationImage( image: DecorationImage(
image: (AppSettings.updatedImage != null) ? FileImage(AppSettings.updatedImage!) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file image: NetworkImage(prescriptionsList[index].PrescriptionPictures[0].url ?? "images/logo.png"),
fit: BoxFit.cover)), 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); ),
onTap: () {
// Handle onTap event if needed
showPicDialog(prescriptionsList[index].PrescriptionPictures);
}, },
), ),
SizedBox(width:MediaQuery.of(context).size.width * .02,), SizedBox(width:MediaQuery.of(context).size.width * .02,),
Container( Container(
width: MediaQuery.of(context).size.width * .55, width: MediaQuery.of(context).size.width * .55,
@ -154,11 +404,11 @@ class _BiddingRequestsState extends State<BiddingRequests> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(prescriptionsList[index].custumerid_bidding.toString().toUpperCase(),style: valuesTextStyle()), Text(prescriptionsList[index].firstName.toString().toUpperCase(),style: valuesTextStyle()),
Text(prescriptionsList[index].pharmacyid_bidding.toString().toUpperCase(),style: valuesTextStyle()), Text(prescriptionsList[index].bookingId.toString().toUpperCase(),style: valuesTextStyle()),
Text(prescriptionsList[index].amount_bidding.toString().toUpperCase(),style: valuesTextStyle()), Text(prescriptionsList[index].address.toString().toUpperCase(),style: valuesTextStyle()),
Text(prescriptionsList[index].bidding_bookingid.toString().toUpperCase(),style: valuesTextStyle()), Text(prescriptionsList[index].customerId.toString().toUpperCase(),style: valuesTextStyle()),
Text(prescriptionsList[index].pharmacyId.toString().toUpperCase(),style: valuesTextStyle()),
], ],
), ),
@ -166,8 +416,8 @@ class _BiddingRequestsState extends State<BiddingRequests> {
), ),
Visibility( Visibility(
//visible:offersviewList[index].orderStatus.toString().toLowerCase()=='pending', visible:true ,
child: Column( child: prescriptionsList[index].status.toString().toLowerCase()=='pending'?Column(
children: [ children: [
TextButton( TextButton(
child: Text( child: Text(
@ -179,18 +429,19 @@ class _BiddingRequestsState extends State<BiddingRequests> {
), ),
onPressed: () async { onPressed: () async {
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
payload["customerId"] = prescriptionsList[index].custumerid_bidding.toLowerCase(); payload["pharmacyId"] =AppSettings.healthpharmaIdsign.toString();
payload["pharmacyId"] =AppSettings.healthpharmaIdsign.toLowerCase(); payload["action"] = "accept";
bool requestStatus = bool requestStatus =
await AppSettings.getRequestBiddingDetails( await AppSettings.getRequestBiddingDetails(
prescriptionsList[index].bidding_bookingid.toLowerCase(), prescriptionsList[index].bookingId,
payload); payload);
if(requestStatus){ if (requestStatus) {
AppSettings.longSuccessToast("Request Accepted Successfully"); // Navigator.of(context).pop();
AppSettings.longSuccessToast(
"Booking Accepted");
await getAllPrescriptions(); await getAllPrescriptions();
}
else{ } else {}
}
}, },
), ),
@ -203,15 +454,25 @@ class _BiddingRequestsState extends State<BiddingRequests> {
primaryColor /*FilteredList[index].text_color*/), primaryColor /*FilteredList[index].text_color*/),
), ),
onPressed: () async { onPressed: () async {
var payload = new Map<String, dynamic>();
payload["pharmacyId"] =AppSettings.healthpharmaIdsign.toString();
payload["action"] = "reject";
bool requestStatus =
await AppSettings.getRequestBiddingDetails(
prescriptionsList[index].bookingId,
payload);
if (requestStatus) {
// Navigator.of(context).pop();
AppSettings.longSuccessToast(
"Booking Rejected");
await getAllPrescriptions();
} else {}
}, },
), ),
], ],
)) ):Text(prescriptionsList[index].status)),
], ],
@ -243,18 +504,17 @@ class _BiddingRequestsState extends State<BiddingRequests> {
]); ]);
} }
else{ else {
return Center( return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,), Text(
'No Bidding Requests Available',
style: TextStyle(fontSize: 18),
),
], ],
), ),
)
); );
} }
} }

@ -0,0 +1,88 @@
import 'dart:io';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'chatmessage.dart';
class ChatController extends GetxController {
final CollectionReference _messagesCollection =
FirebaseFirestore.instance.collection('messages');
// Observable list of messages
RxList<ChatMessage> messages = <ChatMessage>[].obs;
void sendMessage(String messageContent, String messageType, bool isText) async {
try {
await _messagesCollection.add({
'messageContent': messageContent,
'messageType': messageType,
'isText': isText,
'timestamp': Timestamp.now(),
});
print("Message sent successfully");
} catch (e) {
print('Error sending message: $e');
}
}
Future<String> uploadImage(File image, String id) async {
try {
String fileName = DateTime.now().millisecondsSinceEpoch.toString();
Reference storageReference =
FirebaseStorage.instance.ref().child('products/$fileName');
SettableMetadata metadata = SettableMetadata(contentType: 'image/jpeg');
UploadTask uploadTask = storageReference.putFile(image, metadata);
String temporaryMessageId = UniqueKey().toString();
messages.add(ChatMessage(
messageContent: 'Uploading...',
messageType: id,
isText: true,
temporaryMessageId: temporaryMessageId,
));
TaskSnapshot taskSnapshot = await uploadTask;
String downloadURL = await storageReference.getDownloadURL();
// Replace the temporary message with the uploaded image
int index = messages.indexWhere((message) => message.temporaryMessageId == temporaryMessageId);
if (index != -1) {
messages[index] = ChatMessage(
messageContent: downloadURL,
messageType: id,
isText: false,
temporaryMessageId: '',
);
}
print('Image uploaded successfully. Download URL: $downloadURL');
return downloadURL;
} catch (e) {
print('Error uploading image: $e');
throw e;
}
}
Stream<QuerySnapshot> getMessagesStream() {
return _messagesCollection.orderBy('timestamp').snapshots();
}
@override
void onInit() {
super.onInit();
// Listen for changes in the messages collection and update the local list
getMessagesStream().listen((QuerySnapshot snapshot) {
messages.assignAll(snapshot.docs.map((doc) => ChatMessage(
messageContent: doc['messageContent'],
messageType: doc['messageType'],
isText: doc['isText'],
temporaryMessageId: '',
)));
});
}
}

@ -0,0 +1,15 @@
import 'package:flutter/cupertino.dart';
class ChatMessage {
String messageContent;
String messageType;
bool isText;
String temporaryMessageId; // New property for temporary message identifier
ChatMessage({
required this.messageContent,
required this.messageType,
required this.isText,
required this.temporaryMessageId, // Include in the constructor
});
}

@ -0,0 +1,241 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:healthcare_pharmacy/chat/chatzoomable_image.dart';
import 'package:healthcare_pharmacy/pages/index.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:image_picker/image_picker.dart';
import 'chat_controller.dart';
import 'chatmessage.dart';
import 'package:photo_view/photo_view.dart';
class ChatPage extends StatefulWidget {
var pharmacyName;
var profilePictureUrl;
ChatPage({
this.pharmacyName,this.profilePictureUrl
});
@override
State<ChatPage> createState() => _ChatPageState();
}
class _ChatPageState extends State<ChatPage> {
final ChatController chatController = Get.put(ChatController());
final TextEditingController content = TextEditingController();
final ImagePicker _picker = ImagePicker();
XFile? _image;
var id="2";
bool _sending = false;
final ScrollController _scrollController = ScrollController();
@override
void initState() {
super.initState();
_scrollToBottom();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor:Colors.green,
elevation: 0,
automaticallyImplyLeading: false,
flexibleSpace: SafeArea(
child: Container(
padding: EdgeInsets.only(right: 16),
child: Row(
children: <Widget>[
IconButton(
onPressed: (){
Navigator.pop(context);
},
icon: Icon(Icons.arrow_back,color: Colors.black,),
),
SizedBox(width: 2,),
CircleAvatar(
backgroundImage: NetworkImage(AppSettings.profilePictureUrl),
maxRadius: 20,
),
SizedBox(width: 12,),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(widget.pharmacyName,style: TextStyle( fontSize: 16 ,fontWeight: FontWeight.w600),),
// SizedBox(height: 6,),
// Text("Online",style: TextStyle(color: Colors.grey.shade600, fontSize: 13),),
],
),
),
/*IconButton(
onPressed: () {
UrlLauncher.launch("tel://8328206298");
},
icon: Icon(Icons.call, color: Colors.black),
),*/
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => IndexPage()),
);
},
icon: Icon(Icons.videocam, color: Colors.black),
),
],
),
),
),
),
body: Stack(
children: [
Obx(() => ListView.builder(
itemCount: chatController.messages.length,
shrinkWrap: true,
padding: EdgeInsets.only(top: 10, bottom: 80), // Adjust bottom padding to accommodate the input field
physics: ScrollPhysics(),
controller: _scrollController,
itemBuilder: (context, index) {
final data = chatController.messages[index];
return Container(
padding: EdgeInsets.only(
left: 14, right: 14, top: 10, bottom: 10),
child: Align(
alignment: (data.messageType != id ? Alignment.topLeft : Alignment.topRight),
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChatZoomableImage(data.messageContent),
),
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: (data.messageType != id
? Colors.grey.shade200
: Colors.blue[200]),
),
padding: EdgeInsets.all(16),
child: data.isText
? Text(data.messageContent, style: TextStyle(fontSize: 15))
: Image.network(
data.messageContent,
scale: 3,
width: 100,
height: 100,
fit: BoxFit.cover,
),
),
),
),
);
},
)),
Align(alignment: Alignment.bottomCenter,child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Container(
height: 60,
width: double.infinity,
color: Colors.white,
child: Row(
children: <Widget>[
GestureDetector(
onTap: getImage,
child: Container(
height: 30,
width: 30,
decoration: BoxDecoration(
color: Colors.lightBlue,
borderRadius: BorderRadius.circular(30),
),
child: Icon(Icons.add, color: Colors.white, size: 20),
),
),
SizedBox(width: 15),
Expanded(
child: TextField(
controller: content,
decoration: InputDecoration(
hintText: "Write message...",
hintStyle: TextStyle(color: Colors.black54),
border: InputBorder.none,
),
),
),
SizedBox(width: 15),
FloatingActionButton(
onPressed: () {
sendMessage();
},
child: Icon(Icons.send, color: Colors.white, size: 18),
backgroundColor: Colors.blue,
elevation: 0,
),
],
),
),
),)
],
),
);
}
void _scrollToBottom() {
Future.delayed(Duration(milliseconds: 300), () {
if (_scrollController.hasClients) {
_scrollController.animateTo(
_scrollController.position.maxScrollExtent,
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}
});
}
Future getImage() async {
final XFile? image =
await _picker.pickImage(source: ImageSource.gallery);
if (image != null) {
setState(() {
_image = image;
});
sendMessage(); // Call sendMessage function to send the selected image immediately
}
}
void sendMessage() async {
String messageContent = content.text.trim();
if (messageContent.isNotEmpty || _image != null) {
setState(() {
_sending = true;
});
try {
if (_image != null) {
String imageUrl =
await chatController.uploadImage(File(_image!.path),'$id');
chatController.sendMessage(imageUrl, '$id', false);
_image = null; // Clear the selected image after sending
}
if (messageContent.isNotEmpty) {
chatController.sendMessage(messageContent, '$id', true);
content.clear();
}
} finally {
setState(() {
_sending = false;
});
}
_scrollToBottom(); // Scroll to the bottom after sending message
}
}
}

@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:photo_view/photo_view.dart';
class ChatZoomableImage extends StatelessWidget {
final String imageUrl;
ChatZoomableImage(this.imageUrl);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: primaryColor, // Set the background color
title: Text('Preview Image'), // Set the title text
actions: [
IconButton(
icon: Icon(Icons.close),
onPressed: () {
Navigator.pop(context);
},
),
],
),
body: Center(
child: imageUrl.isNotEmpty
? PhotoView(
imageProvider: NetworkImage(imageUrl),
minScale: PhotoViewComputedScale.contained,
maxScale: PhotoViewComputedScale.contained * 3.0,
)
: Image.asset(
'images/mobilebg.png', // Path to your default image
fit: BoxFit.cover,
),
),
);
}
}

@ -0,0 +1,201 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/models/chatconversation_model.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'ChatMessage.dart';
class ChatUIconvoid extends StatefulWidget {
const ChatUIconvoid({super.key});
@override
State<ChatUIconvoid> createState() => _ChatUIconvoidState();
}
class _ChatUIconvoidState extends State<ChatUIconvoid> {
TextEditingController _messageController = TextEditingController();
bool isLoading=false;
List<GetCoversatitonIdModel> chatCoversatitonIdList = [];
List<ChatMessage> messages = [
ChatMessage(message: "Hello", type: "receiver"),
ChatMessage(message: "How have you?", type: "receiver"),
ChatMessage(
message: "I am doing fine.How have you?",
type: "sender"),
];
@override
void initState() {
// TODO: implement initState
isLoading=true;
getConversasionId();
super.initState();
}
Future<void> getConversasionId() async {
isLoading = true;
try {
var response = await AppSettings.getChatId();
setState(() {
chatCoversatitonIdList =
((jsonDecode(response)['newConversation']) as List).map((dynamic model) {
return GetCoversatitonIdModel.fromJson(model);
}).toList();
// Extracting the conversation_id from the response
String conversationId =
jsonDecode(response)['newConversation']['conversation_id'];
// Use the conversationId as needed in your code
print('Conversation ID: $conversationId');
isLoading = false;
isLoading = false;
});
} catch (e) {
setState(() {
isLoading = false;
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
automaticallyImplyLeading: false,
backgroundColor: Colors.white,
flexibleSpace: SafeArea(
child: Container(
padding: EdgeInsets.only(right: 16),
child: Row(
children: <Widget>[
IconButton(
onPressed: (){
Navigator.pop(context);
},
icon: Icon(Icons.arrow_back,color: Colors.black,),
),
SizedBox(width: 2,),
CircleAvatar(
backgroundImage: NetworkImage("https://www.shutterstock.com/image-photo/pharmacist-holding-medicine-box-capsule-260nw-717437125.jpg"),
maxRadius: 20,
),
SizedBox(width: 12,),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Arminta pharma",style: TextStyle( fontSize: 16 ,fontWeight: FontWeight.w600),),
// SizedBox(height: 6,),
// Text("Online",style: TextStyle(color: Colors.grey.shade600, fontSize: 13),),
],
),
),
Icon(Icons.settings,color: Colors.black54,),
],
),
),
),
),
body: Stack(
children: <Widget>[
ListView.builder(
itemCount: messages.length,
shrinkWrap: true,
padding: EdgeInsets.only(top: 10,bottom: 60),
itemBuilder: (context, index){
return Container(
padding: EdgeInsets.only(left: 14,right: 14,top: 10,bottom: 10),
child: Align(
alignment: (messages[index].type == "receiver"?Alignment.topLeft:Alignment.topRight),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: (messages[index].type == "receiver"?Colors.grey.shade200:Colors.blue[200]),
),
padding: EdgeInsets.symmetric(horizontal: 16,vertical: 10),
child: Text(messages[index].message, style: TextStyle(fontSize: 15),),
),
),
);
},
),
Align(
alignment: Alignment.bottomLeft,
child: Container(
padding: EdgeInsets.only(left: 10, bottom: 10, top: 10),
height: 60,
width: double.infinity,
color: Colors.white,
child: Row(
children: <Widget>[
GestureDetector(
onTap: () {},
child: Container(
height: 30,
width: 30,
decoration: BoxDecoration(
color: Colors.lightBlue,
borderRadius: BorderRadius.circular(30),
),
child: Icon(
Icons.add,
color: Colors.white,
size: 20,
),
),
),
SizedBox(
width: 15,
),
Expanded(
child: TextField(
controller: _messageController,
decoration: InputDecoration(
hintText: "Write message...",
hintStyle: TextStyle(color: Colors.black54),
border: InputBorder.none),
),
),
SizedBox(
width: 15,
),
FloatingActionButton(
onPressed: () {
String newMessage = _messageController.text;
if (newMessage.isNotEmpty) {
// Add the new message to the list
setState(() {
messages.add(
ChatMessage(
message: newMessage,
type: "sender",
),
);
});
// Clear the text field
_messageController.clear();
}
},
child: Icon(
Icons.send,
color: Colors.white,
size: 18,
),
backgroundColor: Colors.blue,
elevation: 0,
),
],
),
),
),
],
));
}
}

@ -12,7 +12,11 @@ import 'package:image_picker/image_picker.dart';
class CompanyOffers extends StatefulWidget { class CompanyOffers extends StatefulWidget {
const CompanyOffers({Key? key}) : super(key: key); var phid;
CompanyOffers({
this.phid
});
@override @override
State<CompanyOffers> createState() => _CompanyOffersState(); State<CompanyOffers> createState() => _CompanyOffersState();
@ -30,8 +34,16 @@ class _CompanyOffersState extends State<CompanyOffers> {
var selIOS; var selIOS;
final ImagePicker _picker = ImagePicker(); final ImagePicker _picker = ImagePicker();
String offerUrl=''; String offerUrl='';
String medphid="";
@override
void initState() {
// TODO: implement initState
super.initState();
medphid = widget.phid.toString();
medphid = medphid.replaceAll('[', '').replaceAll(']', '');
eligiblepharma_Controller.text = medphid;
}
Future pickImageFromGallery() async { Future pickImageFromGallery() async {
@ -244,6 +256,7 @@ class _CompanyOffersState extends State<CompanyOffers> {
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
readOnly: true,
controller: eligiblepharma_Controller, controller: eligiblepharma_Controller,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration( decoration: const InputDecoration(
@ -416,17 +429,13 @@ class _CompanyOffersState extends State<CompanyOffers> {
), ),
onPressed: () async { onPressed: () async {
if (offer_nameController.text != '' && if (offer_nameController.text != '' &&
offer_codeController.text != '' && offer_codeController.text != '' ) {
descriptionController.text != ''&&
starting_dateController.text != '' &&
ending_dateController.text != '') {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>(); var payload = new Map<String, dynamic>();
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["pharmacies_eligible"] = eligiblepharma_Controller.text.toString(); payload["pharmacies_eligible"] = [eligiblepharma_Controller.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";
@ -441,7 +450,6 @@ class _CompanyOffersState extends State<CompanyOffers> {
); );
AppSettings.longSuccessToast("Company Offer Created Succesfully!!"); AppSettings.longSuccessToast("Company Offer Created Succesfully!!");
} else { } else {
AppSettings.longFailedToast("Fields should not be empty !!"); AppSettings.longFailedToast("Fields should not be empty !!");
} }
} }

@ -0,0 +1,395 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_pharmacy/pages/index.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:url_launcher/url_launcher.dart' as UrlLauncher;
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
import 'models/ChatMessage.dart';
import 'package:image_picker/image_picker.dart';
import 'package:flutter_callkeep/flutter_callkeep.dart';
class ChatUI extends StatefulWidget {
const ChatUI({Key? key}) : super(key: key);
@override
State<ChatUI> createState() => _ChatUIState();
}
class _ChatUIState extends State<ChatUI> {
WebSocketChannel channel=IOWebSocketChannel.connect(
"wss://socketsbay.com/wss/v2/1/demo/",
);
// WebSocket channel for call signaling
late WebSocketChannel callChannel;
WebSocketConnectionState _connectionState = WebSocketConnectionState.connecting;
late ScrollController _scrollController;
final TextEditingController _controller = TextEditingController();
// Store messages
final List<ChatMessage> _messages = [];
String myUserId = 'user456';
String otherUserId = 'user123';
final ImagePicker _picker = ImagePicker();
Future pickImageFromGallery() async {
try {
final image = await _picker.pickImage(source: ImageSource.gallery);
if (image == null) return;
final imageTemp = File(image.path);
setState(() {
AppSettings.updatedImage = imageTemp;
});
// uploadProfileApi(AppSettings.updatedImage);
AppSettings.saveProfile(image.path);
} 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);
setState(() {
AppSettings.updatedImage = imageTemp;
});
//uploadProfileApi(AppSettings.updatedImage);
AppSettings.saveProfile(image.path);
} on PlatformException catch (e) {
print('Failed to pick image: $e');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: _connectionState == WebSocketConnectionState.error ? Colors.red : _connectionState == WebSocketConnectionState.closed ? Colors.red : Colors.green,
elevation: 0,
automaticallyImplyLeading: false,
flexibleSpace: SafeArea(
child: Container(
padding: EdgeInsets.only(right: 16),
child: Row(
children: <Widget>[
IconButton(
onPressed: (){
Navigator.pop(context);
},
icon: Icon(Icons.arrow_back,color: Colors.black,),
),
SizedBox(width: 2,),
CircleAvatar(
backgroundImage: NetworkImage("https://ehealth.eletsonline.com/wp-content/uploads/2020/12/pharma-industry-in-2021.jpg"),
maxRadius: 20,
),
SizedBox(width: 12,),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Suresh",style: TextStyle( fontSize: 16 ,fontWeight: FontWeight.w600),),
// SizedBox(height: 6,),
// Text("Online",style: TextStyle(color: Colors.grey.shade600, fontSize: 13),),
],
),
),
IconButton(
onPressed: () {
UrlLauncher.launch("tel://8328206298");
},
icon: Icon(Icons.call, color: Colors.black),
),
IconButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => IndexPage()),
);
},
icon: Icon(Icons.videocam, color: Colors.black),
),
],
),
),
),
),
body: Stack(
children: <Widget>[
ListView.builder(
controller: _scrollController,
itemCount: _messages.length,
shrinkWrap: true,
padding: EdgeInsets.only(top: 10,bottom: 60),
itemBuilder: (context, index){
bool isSentByMe = _messages[index].senderId == myUserId;
return Container(
padding: EdgeInsets.only(left: 14,right: 14,top: 10,bottom: 10),
child: Align(
alignment: (isSentByMe?Alignment.topRight:Alignment.topLeft),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: (isSentByMe?Colors.blue[200]:Colors.grey[200]),
),
padding: EdgeInsets.symmetric(horizontal: 16,vertical: 10),
child: Text(_messages[index].messageContent, style: TextStyle(fontSize: 15),),
),
),
);
},
),
Align(
alignment: Alignment.bottomLeft,
child: Container(
padding: EdgeInsets.only(left: 10, bottom: 10, top: 10),
height: 60,
width: double.infinity,
color: Colors.white,
child: Row(
children: <Widget>[
GestureDetector(
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: greyColor,
),
onTap: () async {
await takeImageFromCamera();
Navigator.pop(context);
},
),
SizedBox(
width:
MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: greyColor,
),
onTap: () async {
await pickImageFromGallery();
Navigator.pop(context);
},
),
],
),
),
);
});
},
child: Container(
height: 30,
width: 30,
decoration: BoxDecoration(
color: Colors.lightBlue,
borderRadius: BorderRadius.circular(30),
),
child: Icon(
Icons.add,
color: Colors.white,
size: 20,
),
),
),
SizedBox(
width: 15,
),
Expanded(
child: TextField(
controller: _controller,
decoration: InputDecoration(
hintText: "Write message...",
hintStyle: TextStyle(color: Colors.black54),
border: InputBorder.none),
),
),
SizedBox(
width: 15,
),
FloatingActionButton(
onPressed: () {
String newMessage = _controller.text;
if (newMessage.isNotEmpty) {
// Add the new message to the list
setState(() {
_sendMessage();
});
// Clear the text field
_controller.clear();
}
},
child: Icon(
Icons.send,
color: Colors.white,
size: 18,
),
backgroundColor: Colors.blue,
elevation: 0,
),
],
),
),
),
],
));
}
void _sendMessage() {
if (_controller.text.isNotEmpty) {
var message = ChatMessage(
senderId: myUserId,
receiverId: otherUserId,
messageType: 'text',
messageContent: _controller.text,
);
channel.sink.add(chatMessageToJson(message));
_messages.add(message);
_controller.clear();
}
}
@override
void initState() {
super.initState();
// Initialize the WebSocket channel for call signaling
callChannel = IOWebSocketChannel.connect(
"wss://socketsbay.com/wss/v2/1/demo/call", // adjust the URL accordingly
);
_scrollController = ScrollController();
channel.stream.listen((message) {
if (message is String) {
var receivedMessage = chatMessageFromJson(message);
setState(() {
_messages.add(receivedMessage);
});
_scrollToBottom();
}
}, onError: (error) {
setState(() {
_connectionState = WebSocketConnectionState.error;
});
},onDone: (){
setState(() {
_connectionState = WebSocketConnectionState.closed;
});
},);
}
// ... existing code ...
void startCall(String callId) {
// Send a call initiation message to the other user
var callMessage = {
'type': 'call',
'callId': callId,
'senderId': myUserId,
'receiverId': otherUserId,
};
callChannel.sink.add(jsonEncode(callMessage));
// Update UI or perform other actions as needed
// ...
// For simplicity, let's assume the call is accepted after a short delay
Future.delayed(Duration(seconds: 2), () {
// Handle call accepted
onCallAccepted(callId);
});
}
void onCallAccepted(String callId) {
// Update UI or perform other actions as needed
// ...
// Send a call accepted message to the other user
var acceptedMessage = {
'type': 'call_accepted',
'callId': callId,
'senderId': myUserId,
'receiverId': otherUserId,
};
callChannel.sink.add(jsonEncode(acceptedMessage));
// Start the actual call
// ...
}
void endCall(String callId) {
// Send a call end message to the other user
var endMessage = {
'type': 'call_end',
'callId': callId,
'senderId': myUserId,
'receiverId': otherUserId,
};
callChannel.sink.add(jsonEncode(endMessage));
// Update UI or perform other actions as needed
// ...
// For simplicity, let's assume the call is ended immediately
onCallEnded(callId);
}
void onCallEnded(String callId) {
// Update UI or perform other actions as needed
// ...
// Close the call WebSocket channel
callChannel.sink.close();
// For simplicity, let's assume the call ended immediately
// ...
}
void _scrollToBottom() {
// Scroll to the bottom of the list
_scrollController.animateTo(
_scrollController.position.maxScrollExtent,
duration: Duration(milliseconds: 200),
curve: Curves.easeOut,
);
}
@override
void dispose() {
channel.sink.close();
super.dispose();
}
}
enum WebSocketConnectionState { connecting, open, closing, closed, error }

@ -5,10 +5,12 @@ 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:healthcare_pharmacy/zoomable_image.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'; import 'package:image_picker/image_picker.dart';
import 'package:image/image.dart' as Img;
import 'package:gallery_saver/gallery_saver.dart';
class offers extends StatefulWidget { class offers extends StatefulWidget {
@ -25,46 +27,111 @@ class _offersState extends State<offers> {
TextEditingController descriptionController = TextEditingController(); TextEditingController descriptionController = TextEditingController();
TextEditingController starting_dateController = TextEditingController(); TextEditingController starting_dateController = TextEditingController();
TextEditingController ending_dateController = TextEditingController(); TextEditingController ending_dateController = TextEditingController();
String dropdownTypeOfCategory = 'A {1 - 500}';
var typeOfCategoryItems = [
'A {1 - 500}',
'B {501 - 1000}',
'C {1001 - 2000}',
'D {Above 2000}',
'S {Special offer}',
];
var selIOS; var selIOS;
final ImagePicker _picker = ImagePicker(); final ImagePicker _picker = ImagePicker();
String offerUrl=''; String offerUrl='';
File? _imageFile;
Future<void> pickImageFromGallery() async {
Future pickImageFromGallery() async {
try { try {
final image = await _picker.pickImage(source: ImageSource.gallery); final image = await _picker.pickImage(source: ImageSource.gallery);
if (image == null) return; if (image == null) return;
final imageTemp = File(image.path);
final File imageFile = File(image.path);
// Read the image from file
List<int> imageBytes = await imageFile.readAsBytes();
Img.Image? decodedImage = Img.decodeImage(imageBytes);
// Compress the image
List<int> compressedImage = Img.encodeJpg(decodedImage!, quality: 45);
// Save the compressed image back to file
await imageFile.writeAsBytes(compressedImage);
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var res = await AppSettings.offeruploadImageHTTPNew(image); var res = await AppSettings.offeruploadImageHTTPNew(imageFile);
print(jsonDecode(res)); print(jsonDecode(res));
Navigator.of(context, rootNavigator: true).pop();
setState(() { setState(() {
AppSettings.offerPictureUrl = jsonDecode(res)['picture']; offerUrl = jsonDecode(res)['picture'][0]['url'];
print(offerUrl);
}); });
AppSettings.saveData('offer', jsonDecode(res)['picture'], 'STRING');
Navigator.of(context, rootNavigator: true).pop();
} on PlatformException catch (e) { } on PlatformException catch (e) {
print('Failed to pick image: $e'); print('Failed to pick image: $e');
} }
} }
Future takeImageFromCamera() async { /* Future<void> takeImageFromCamera() async {
try { try {
final image = await _picker.pickImage(source: ImageSource.camera); final image = await _picker.pickImage(source: ImageSource.camera);
if (image == null) return; if (image == null) return;
final imageTemp = File(image.path);
final File imageFile = File(image.path);
// Read the image from file
List<int> imageBytes = await imageFile.readAsBytes();
Img.Image? decodedImage = Img.decodeImage(imageBytes);
// Compress the image
List<int> compressedImage = Img.encodeJpg(decodedImage!, quality: 45);
// Save the original and compressed images to the gallery
await GallerySaver.saveImage(image.path, albumName: 'MedicinesAlbum');
//await GallerySaver.saveImage(image.path, albumName: null);
//await GallerySaver.saveImage(imageFile.path, albumName: 'YourAlbumName');
// Save the compressed image back to file
await imageFile.writeAsBytes(compressedImage);
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var res = await AppSettings.offeruploadImageHTTPNew(image); var res = await AppSettings.offeruploadImageHTTPNew(imageFile);
print(jsonDecode(res)); print(jsonDecode(res));
setState(() {
offerUrl = jsonDecode(res)['picture'][0]['url'];
print(offerUrl);
});
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
} 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 File imageFile = File(image.path);
// Read the image from file
List<int> imageBytes = await imageFile.readAsBytes();
Img.Image? decodedImage = Img.decodeImage(imageBytes);
// Compress the image
List<int> compressedImage = Img.encodeJpg(decodedImage!, quality: 45);
await imageFile.writeAsBytes(compressedImage);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.offeruploadImageHTTPNew(imageFile);
print(jsonDecode(res));
setState(() { setState(() {
//AppSettings.offerPictureUrl = jsonDecode(res)['picture']['url']; offerUrl = jsonDecode(res)['picture'][0]['url'];
offerUrl=jsonDecode(res)['picture'][0]['url']; print(offerUrl);
}); });
Navigator.of(context, rootNavigator: true).pop();
} on PlatformException catch (e) { } on PlatformException catch (e) {
print('Failed to pick image: $e'); print('Failed to pick image: $e');
} }
@ -100,7 +167,7 @@ class _offersState extends State<offers> {
image: (offerUrl!= ''&& image: (offerUrl!= ''&&
offerUrl!= 'null') ? offerUrl!= 'null') ?
NetworkImage(offerUrl) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file NetworkImage(offerUrl) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file
fit: BoxFit.fitWidth)), fit: BoxFit.cover)),
), ),
onTap: () { onTap: () {
showModalBottomSheet<void>( showModalBottomSheet<void>(
@ -145,15 +212,41 @@ class _offersState extends State<offers> {
}); });
}, },
),), ),),
SizedBox( SizedBox(
height: 05, height: 15,
),
GestureDetector(
child: Container(
child: Center(
child: Text(
'Preview Image',
style: TextStyle(
color: primaryColor,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ZoomableImage(offerUrl),
),
);
},
),
SizedBox(
height: 20,
), ),
Container( Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: offer_nameController, controller: offer_nameController,
textCapitalization: TextCapitalization.words, textCapitalization: TextCapitalization.sentences,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.person, Icons.person,
@ -182,7 +275,7 @@ class _offersState extends State<offers> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: offer_codeController, controller: offer_codeController,
textCapitalization: TextCapitalization.words, textCapitalization: TextCapitalization.sentences,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.numbers, Icons.numbers,
@ -214,7 +307,7 @@ class _offersState extends State<offers> {
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: descriptionController, controller: descriptionController,
textCapitalization: TextCapitalization.words, textCapitalization: TextCapitalization.sentences,
keyboardType: TextInputType.multiline, keyboardType: TextInputType.multiline,
maxLines: null, maxLines: null,
decoration: const InputDecoration( decoration: const InputDecoration(
@ -238,33 +331,63 @@ class _offersState extends State<offers> {
), ),
), ),
), ),
/* Container(
padding: const EdgeInsets.all(10), const SizedBox(
child: TextFormField( height: 30,
cursorColor: greyColor, ),
controller: descriptionController,
textCapitalization: TextCapitalization.characters,
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: DropdownButtonFormField(
// Initial Value
value: dropdownTypeOfCategory,
isExpanded: true,
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon( prefixIcon: Icon(
Icons.description, Icons.water,
color: primaryColor, color: greyColor,
), ),
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: 'Select Type of Category',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor, //<-- SEE HERE
), ),
), ),
hint: Text('Select Type of Category'),
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: typeOfCategoryItems.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
dropdownTypeOfCategory = newValue!;
});
},
),
), ),
),*/ //mobile
const SizedBox( const SizedBox(
height: 5, height: 5,
), ),
@ -293,39 +416,43 @@ class _offersState extends State<offers> {
Icons.date_range, Icons.date_range,
), ),
onPressed: () async { onPressed: () async {
DatePicker.showDatePicker( DateTime? pickedDate = await showDatePicker(
context, context: context,
dateFormat: 'dd MMMM yyyy', /* initialDate: DateTime.now(),
initialDateTime: DateTime.now(), firstDate: DateTime(1950),
minDateTime:DateTime.now(), lastDate: DateTime.now(),*/
maxDateTime: DateTime.now().add(Duration(days: 365)), initialDate: DateTime.now(),
onMonthChangeStartWithFirstDate: true, firstDate: DateTime(1950), // Set the first selectable date to a past date
pickerMode: DateTimePickerMode.datetime, lastDate: DateTime(2100), // Set the last selectable date to a future date
pickerTheme: DateTimePickerTheme( builder: (BuildContext context, Widget? child) {
// backgroundColor: Colors.white, return Theme(
cancelTextStyle: labelTextStyle(), data: ThemeData.dark().copyWith(
confirmTextStyle: labelTextStyle(), colorScheme: ColorScheme.dark(
// showTitle: true, primary: buttonColors,
//title: Text('Pick date and time'), onPrimary: Colors.white,
itemTextStyle: valuesTextStyle(), surface: buttonColors,
), onSurface: Colors.white,
onConfirm: (dateTime, List<int> index)async { ),
DateTime selectdate = dateTime; dialogBackgroundColor: primaryColor,
setState(() { ),
selIOS = DateFormat('dd-MMM-yyyy').format(selectdate); child: child!,
}); );
},
);
if(selIOS!=''){ if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() { setState(() {
starting_dateController.text=selIOS.toString(); starting_dateController.text=formattedDate.toString();
}); });
} } else {}
else {
AppSettings.longFailedToast('please select date');
}
},
);
}, },
), ),
), ),
@ -361,38 +488,38 @@ class _offersState extends State<offers> {
Icons.date_range, Icons.date_range,
), ),
onPressed: () async { onPressed: () async {
DatePicker.showDatePicker( DateTime? pickedDate = await showDatePicker(
context, context: context,
dateFormat: 'dd MMMM yyyy', initialDate: DateTime.now(),
initialDateTime: DateTime.now(), firstDate: DateTime(1950), // Set the first selectable date to a past date
minDateTime:DateTime.now(), lastDate: DateTime(2100), // Set the last selectable date to a future date
maxDateTime: DateTime.now().add(Duration(days: 365)), builder: (BuildContext context, Widget? child) {
onMonthChangeStartWithFirstDate: true, return Theme(
pickerMode: DateTimePickerMode.datetime, data: ThemeData.dark().copyWith(
pickerTheme: DateTimePickerTheme( colorScheme: ColorScheme.dark(
// backgroundColor: Colors.white, primary: buttonColors,
cancelTextStyle: labelTextStyle(), onPrimary: Colors.white,
confirmTextStyle: labelTextStyle(), surface: buttonColors,
// showTitle: true, onSurface: Colors.white,
//title: Text('Pick date and time'), ),
itemTextStyle: valuesTextStyle(), dialogBackgroundColor: primaryColor,
), ),
onConfirm: (dateTime, List<int> index)async { child: child!,
DateTime selectdate = dateTime; );
setState(() { },
selIOS = DateFormat('dd-MMM-yyyy').format(selectdate); );
});
if(selIOS!=''){ if (pickedDate != null) {
print(
pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000
String formattedDate =
DateFormat('dd-MM-yyyy').format(pickedDate);
print(
formattedDate); //formatted date output using intl package => 2021-03-16
setState(() { setState(() {
ending_dateController.text=selIOS.toString(); ending_dateController.text=formattedDate.toString();
}); });
} } else {}
else {
AppSettings.longFailedToast('please select date');
}
},
);
}, },
), ),
@ -401,6 +528,8 @@ class _offersState extends State<offers> {
), ),
),//address description ),//address description
const SizedBox( const SizedBox(
height:15, height:15,
), ),
@ -421,40 +550,65 @@ class _offersState extends State<offers> {
ending_dateController.text != '') { ending_dateController.text != '') {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>(); /* var payload = new Map<String, dynamic>();
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["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["picture"] = [offerUrl];
payload["offer_status"] ="active"; payload["offer_status"] ="active";
print(payload);*/
Map<String, dynamic> payload = {
"offer_name": offer_nameController.text.toString(),
"offer_code": offer_codeController.text.toString(),
"description":descriptionController.text.toString(),
"starting_date":starting_dateController.text.toString(),
"ending_date": ending_dateController.text.toString(),
"category":dropdownTypeOfCategory.toString(),
"picture": [
{
"url": offerUrl
}
],
"offer_status": "active",
};
bool offerStatus = await AppSettings.createOffers(payload); bool offerStatus = await AppSettings.createOffers(payload);
try{ try{
if (offerStatus) { if (offerStatus) {
Navigator.pop(context);
Navigator.of(context,rootNavigator: true).pop(); Navigator.of(context,rootNavigator: true).pop();
AppSettings.longSuccessToast("Offer Created Succesfully!!");
offer_nameController.text = '' ;
offer_codeController.text = '' ;
descriptionController.text = '';
starting_dateController.text = '';
ending_dateController.text = '';
Navigator.pop(context);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => Dashboard()), MaterialPageRoute(builder: (context) => Dashboard()),
); );
AppSettings.longSuccessToast("Offer Created Succesfully!!");
} else { } else {
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast("Fields should not be empty !!"); AppSettings.longFailedToast("Please enter all fields");
} }
} }
catch(exception){ catch(exception){
print(exception); print(exception);
AppSettings.longFailedToast("Please enter valid details"); AppSettings.longFailedToast("Please enter valid details");
Navigator.of(context,rootNavigator: true).pop();
} }
} else { } else {
AppSettings.longFailedToast("Offer Not Created!!"); AppSettings.longFailedToast("Offer Not Created!!");
Navigator.of(context,rootNavigator: true).pop();
} }
}, },
child: Text('Create'), child: Text('Create'),
)),//login button )),//login button
const SizedBox(
height: 10,
),
], ],
), ),
)), )),

@ -3,19 +3,28 @@ 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/adddeliveryboy.dart';
import 'package:healthcare_pharmacy/chat/chatpage.dart';
import 'package:healthcare_pharmacy/chatview.dart';
import 'package:healthcare_pharmacy/companyoffrers.dart'; import 'package:healthcare_pharmacy/companyoffrers.dart';
import 'package:healthcare_pharmacy/conver.dart';
import 'package:healthcare_pharmacy/getallpharmacies.dart'; import 'package:healthcare_pharmacy/getallpharmacies.dart';
import 'package:healthcare_pharmacy/getdeliveryboydata.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/invitations.dart';
import 'package:healthcare_pharmacy/medicinecart.dart'; import 'package:healthcare_pharmacy/medicinecart.dart';
import 'package:healthcare_pharmacy/createoffers.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';
import 'package:healthcare_pharmacy/pharmacyaccounts.dart';
import 'package:healthcare_pharmacy/qrcode_display.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';
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'approvedoffers.dart';
import 'login.dart'; import 'login.dart';
import 'seekopinion.dart'; import 'seekopinion.dart';
import 'settings.dart'; import 'settings.dart';
@ -248,12 +257,6 @@ class _DashboardState extends State<Dashboard> {
} }
} }
showLogoutAlertDialog(context) { showLogoutAlertDialog(context) {
return showDialog( return showDialog(
context: context, context: context,
@ -340,20 +343,22 @@ class _DashboardState extends State<Dashboard> {
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: primaryColor, color: primaryColor,
), ),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Column( Expanded(child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Expanded( GestureDetector(
child: GestureDetector(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .60, width: MediaQuery.of(context).size.width * .23,
height: height:
MediaQuery.of(context).size.height * .25, MediaQuery.of(context).size.height * .15,
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 !=
'' && '' &&
@ -363,8 +368,11 @@ class _DashboardState extends State<Dashboard> {
.profilePictureUrl) .profilePictureUrl)
as ImageProvider as ImageProvider
: AssetImage( : AssetImage(
"images/mobilebg.png"), // picked file "images/profile_pic.png"),
fit: BoxFit.fitWidth)),
fit:BoxFit.fitWidth // picked file
),
),
), ),
onTap: () { onTap: () {
showModalBottomSheet<void>( showModalBottomSheet<void>(
@ -381,7 +389,7 @@ class _DashboardState extends State<Dashboard> {
child: Icon( child: Icon(
Icons.camera_alt_outlined, Icons.camera_alt_outlined,
size: 100, size: 100,
color: greyColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await takeImageFromCamera(); await takeImageFromCamera();
@ -398,7 +406,7 @@ class _DashboardState extends State<Dashboard> {
child: Icon( child: Icon(
Icons.photo, Icons.photo,
size: 100, size: 100,
color: greyColor, color: primaryColor,
), ),
onTap: () async { onTap: () async {
await pickImageFromGallery(); await pickImageFromGallery();
@ -412,30 +420,88 @@ class _DashboardState extends State<Dashboard> {
}); });
}, },
), ),
SizedBox(
width: 10,
),
/*Container(
child: AppSettings.qrCode==''?TextButton(
child: Text(
'GetQR',
style: TextStyle(
fontSize: 15,
color: Colors.white,
decoration: TextDecoration.underline,
),
), ),
onPressed: () async{
AppSettings.preLoaderDialog(context);
try{
var value = await AppSettings.generateQRCode();
var valueResponse = jsonDecode(value);
String dataUri = jsonDecode(value)['qrCodeData'];
List<String> parts = dataUri.split(",");
String? base64String = parts.length == 2 ? parts[1] : null;
if (base64String != null) {
print(base64String);
AppSettings.qrCode=base64String;
} else {
print("Invalid data URI");
}
Navigator.of(context, rootNavigator: true).pop();
}
catch(e){
Navigator.of(context, rootNavigator: true).pop();
}
},
):GestureDetector(
onTap: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const DisplayQrCode()),
);
},
child: Container(
height:MediaQuery.of(context).size.height * .20,
width:MediaQuery.of(context).size.width * .1,
child: Image.memory(Uint8List.fromList(base64.decode(AppSettings.qrCode))),
),
),
)*/
],
),),
SizedBox(
height: 5,
),
Text( Text(
AppSettings.pharmacyName, AppSettings.pharmacyName,
style: TextStyle(color: Colors.white, fontSize: 15), style: TextStyle(color: Colors.white, fontSize: 15),
), ),
Text( Text(
AppSettings.phoneNumber, AppSettings.phoneNumber,
style: TextStyle(color: Colors.white, fontSize: 15), style: TextStyle(color: Colors.white, fontSize: 15),
), ),
Text( Visibility(
visible: AppSettings.email != '',
child: Text(
AppSettings.email, AppSettings.email,
style: TextStyle(color: Colors.white, fontSize: 15), style: TextStyle(color: Colors.white, fontSize: 15),
), ),
SizedBox(
height: 10,
),
],
), ),
Container()
], ],
),),
)),
ListTile( ListTile(
title: Row( title: Row(
children: const [ children: const [
@ -624,7 +690,8 @@ class _DashboardState extends State<Dashboard> {
); );
}, },
), ),
Divider(
/* Divider(
color: Colors.grey, color: Colors.grey,
), ),
ListTile( ListTile(
@ -638,7 +705,7 @@ class _DashboardState extends State<Dashboard> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Text('BiddingRequests', style: TextStyle(color: Colors.black)), Text('Approved Offers', style: TextStyle(color: Colors.black)),
], ],
), ),
onTap: () { onTap: () {
@ -646,13 +713,37 @@ class _DashboardState extends State<Dashboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => BiddingRequests()), builder: (context) => ApprovedOffersData()),
); );
},
),*/
Divider(
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('Add Delivery Boys', style: TextStyle(color: Colors.black)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Deliverboy()),
);
}, },
), ),
Divider( Divider(
color: Colors.grey, color: Colors.grey,
), ),
@ -667,7 +758,7 @@ class _DashboardState extends State<Dashboard> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Text('Company Offers', style: TextStyle(color: Colors.black)), Text('Deliveryboys View', style: TextStyle(color: Colors.black)),
], ],
), ),
onTap: () { onTap: () {
@ -675,11 +766,61 @@ class _DashboardState extends State<Dashboard> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => CompanyOffers()), builder: (context) => GetDeliveryboyData()),
); );
},
),
/*Divider(
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('Accounts', style: TextStyle(color: Colors.black)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PharmacyAccounts()),
);
},
),*/
Divider(
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('BiddingRequests', style: TextStyle(color: Colors.black)),
],
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BiddingRequests()),
);
}, },
), ),
Divider( Divider(
@ -696,15 +837,40 @@ class _DashboardState extends State<Dashboard> {
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
Text('GetAllPharmacies', style: TextStyle(color: Colors.black)), Text('Chat', style: TextStyle(color: Colors.black)),
], ],
), ),
onTap: () { onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChatPage(pharmacyName: AppSettings.pharmacyName,profilePictureUrl: AppSettings.profilePictureUrl)),
);
},
),
Divider(
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('SendInvite', style: TextStyle(color: Colors.black)),
],
),
onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => GetAllPharmacies()), builder: (context) => Invitations()),
); );
}, },
), ),

@ -0,0 +1,299 @@
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/companyoffrers.dart';
import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/maps/app_colors.dart';
import 'package:healthcare_pharmacy/medicinecart.dart';
import 'package:healthcare_pharmacy/models/addoffer_model.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 GetAllOffers extends StatefulWidget {
var bookidID;
GetAllOffers({
this.bookidID
});
@override
State<GetAllOffers> createState() => _GetAllOffersState();
}
class _GetAllOffersState extends State<GetAllOffers> {
String Url = '';
List<GetOffersDetailsModel> offersList = [];
List<GetOffersDetailsModel> prescriptionsListOriginal = [];
bool isPrescriptionsDataLoading = false;
bool isSereverIssue = false;
bool isLoading=false;
List<String> checked = [];
TextEditingController BookingidController = TextEditingController();
TextEditingController offerCodeController = TextEditingController();
Future<void> getActiveOffersViewData() async {
isLoading = true;
try {
var data = await AppSettings.getOffers();
setState(() {
List<dynamic> responseData = jsonDecode(data)['data'];
offersList = responseData
.map((jsonObject) => GetOffersDetailsModel.fromJson(jsonObject))
.toList();
isLoading = false;
});
} catch (error) {
setState(() {
isLoading = false;
isSereverIssue = true;
});
}
}
@override
void initState() {
getActiveOffersViewData();
super.initState();
BookingidController.text=widget.bookidID;
}
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 (offersList.length != 0) {
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(0),
itemCount: offersList.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(
offersList[index].offer_name
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
Text(
offersList[index].offer_code
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
Text(
offersList[index].category
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
Text(
offersList[index].description
.toString()
.toUpperCase(),
style: valuesTextStyle(),
),
],
),
),
Checkbox(
value: checked.contains(
offersList[index].offer_code.toString()),
onChanged: (value) {
_onCheckboxChanged(
offersList[index].offer_code.toString(),
value ?? false);
},
),
],
),
),
);
},
),
),
Container(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child:TextButton(
onPressed: () {
// Add your button click logic here
},
child: Text(
'OfferId:$checked',
style: TextStyle(
fontSize: 15,
color:primaryColor, // Text color
decoration: TextDecoration.underline,// Underline the text
fontWeight: FontWeight.bold, // Bold text
),
),
),),
SizedBox(
height: 10,
),
Container(
width: MediaQuery.of(context).size.width,
height: 60,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // foreground
),
onPressed: ()async {
// Get the selected offer code from the checked list
String selectedOfferCode = checked.isNotEmpty ? checked[0] : '';
// Check if an offer code is selected
if (selectedOfferCode.isNotEmpty) {
bool discountOfferStatus = await AppSettings.discountOffer(
selectedOfferCode,
widget.bookidID,
);
if (discountOfferStatus) {
AppSettings.longSuccessToast('Offer added successfully');
Navigator.of(context).pop(true);
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MedicineCartList())
);
} else {
AppSettings.longFailedToast('Offer addition failed');
}
} else {
// Handle the case where no offer code is selected
AppSettings.longFailedToast('Please select an offer');
}
},
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(),
);
}
}

@ -3,6 +3,7 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:healthcare_pharmacy/companyoffrers.dart';
import 'package:healthcare_pharmacy/getmedicines.dart'; import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/maps/app_colors.dart'; import 'package:healthcare_pharmacy/maps/app_colors.dart';
import 'package:healthcare_pharmacy/models/biddingrequest_model.dart'; import 'package:healthcare_pharmacy/models/biddingrequest_model.dart';
@ -196,20 +197,18 @@ class _GetAllPharmaciesState extends State<GetAllPharmacies> {
), ),
), ),
/* Container( /*Container(
width: 400, padding: const EdgeInsets.fromLTRB(10, 0, 120, 0),
height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child:TextButton( child:TextButton(
onPressed: () { onPressed: () {
// Add your button click logic here // Add your button click logic here
}, },
child: Text( child: Text(
'Total Price:$checked.toString()', 'PharmacyId:$checked',
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 15,
color: AppColors.primaryColor, // Text color color:primaryColor, // Text color
decoration: TextDecoration.underline, // Underline the text decoration: TextDecoration.underline,// Underline the text
fontWeight: FontWeight.bold, // Bold text fontWeight: FontWeight.bold, // Bold text
), ),
), ),
@ -218,8 +217,8 @@ class _GetAllPharmaciesState extends State<GetAllPharmacies> {
height: 10, height: 10,
), ),
Container( Container(
width: 400, width: MediaQuery.of(context).size.width,
height: 50, height: 60,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -227,11 +226,10 @@ class _GetAllPharmaciesState extends State<GetAllPharmacies> {
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async{ onPressed: () async{
ScaffoldMessenger.of(context).showSnackBar( Navigator.push(
SnackBar( context,
content: Text(checked.toString()), new MaterialPageRoute(
), builder: (__) => new CompanyOffers(phid: checked.toString())));
);
}, },
child: Text('Submit'), child: Text('Submit'),
)), )),

@ -0,0 +1,501 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/adddeliveryboy.dart';
import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/models/getdeliveryboy_model.dart';
import 'package:healthcare_pharmacy/settings.dart';
class GetDeliveryboyData extends StatefulWidget {
@override
State<GetDeliveryboyData> createState() => _GetDeliveryboyDataState();
}
class _GetDeliveryboyDataState extends State<GetDeliveryboyData> {
List<GetDeliveryboyDetailsModel> modeldeliveryboyList = [];
TextEditingController deliveryboyNameController = TextEditingController();
TextEditingController deliveryboyPhoneController = TextEditingController();
TextEditingController deliveryboyAlterPhoneController = TextEditingController();
TextEditingController deliveryboyAddress = TextEditingController();
TextEditingController deliveryboyStatus = TextEditingController();
bool isLoading=false;
Future<void> readJson() async {
var response1= await AppSettings.getAllDeliverboy();
print(response1);
setState(() {
modeldeliveryboyList =
((jsonDecode(response1)['deliveryBoys']) as List).map((dynamic model) {
return GetDeliveryboyDetailsModel.fromJson(model);
}).toList();
isLoading=false;
});
}
@override
void initState() {
isLoading=true;
readJson();
super.initState();
}
showUpdateDeliveryDialog(var object) async {
deliveryboyNameController.text=object.deliveryboy_name??'';
deliveryboyPhoneController.text=object.deliveryboy_phone??'';
deliveryboyAlterPhoneController.text=object.deliveryboy_alternativeContactNumber??'';
deliveryboyAddress.text=object.deliveryboy_address??'';
return showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return AlertDialog(
title: const Text('Update Deliveryboy'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
cursorColor: greyColor,
controller: deliveryboyNameController,
textCapitalization: TextCapitalization.characters,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.ac_unit_outlined,
color: greyColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Enter name',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
cursorColor: greyColor,
controller: deliveryboyPhoneController,
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 phone number',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: TextFormField(
cursorColor: greyColor,
controller: deliveryboyAlterPhoneController,
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 Alternative phone number',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
),
),
],
),
),
actions: <Widget>[
TextButton(
child: Text('Cancel',style:textButtonStyle()),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: Text('Update',style:textButtonStyle()),
onPressed: () async{
if (deliveryboyNameController.text != '' ) {
AppSettings.preLoaderDialog(context);
Map<String, dynamic> payload = {
"pharmacyname": "string",
"name": deliveryboyNameController.text.toString(),
"alternativeContactNumber": deliveryboyAlterPhoneController.text.toString(),
"phone": deliveryboyPhoneController.text.toString(),
"address": deliveryboyAddress.text.toString(),
"city": "string",
"state": "string",
"zip": "string",
"status": "active",
"longitude": 0,
"latitude": 0,
"fcmId": "string"
};
bool offerStatus = await AppSettings.updateDeliveryboy(object.deliveryboy_phone, payload);
try {
if (offerStatus) {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast(
"Deliveryboy Updated Successfully");
deliveryboyNameController.text = '';
deliveryboyAlterPhoneController.text = '';
deliveryboyPhoneController.text = '';
Navigator.of(context).pop();
await readJson();
} else {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast(
"Deliveryboy upadtion failed");
Navigator.of(context).pop();
}
} catch (exception) {
Navigator.of(context).pop();
print(exception);
}
} else {
AppSettings.longFailedToast("enter details");
}
},
),
],
);
});
},
);
}
Widget renderzUi(){
if(modeldeliveryboyList.length!=0){
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(child:ListView.builder(
padding: EdgeInsets.all(0),
itemCount: modeldeliveryboyList .length,
itemBuilder: (context,index){
var data=modeldeliveryboyList[index];
return GestureDetector(
onTap: () {
},
child: Card(
child: ListTile(
title: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Name: ',
style: TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: modeldeliveryboyList[index].deliveryboy_name,
style: TextStyle(
fontSize: 16,
color: primaryColor,
),
),
],
),
),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height:5),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'phone: ',
style: TextStyle(
fontSize: 16,
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: modeldeliveryboyList[index].deliveryboy_phone,
style: TextStyle(
fontSize: 16,
color: primaryColor, // Change the color for description content
),
),
],
),
),
SizedBox(height:5),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'alternative phone: ',
style: TextStyle(
fontSize: 16,
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: modeldeliveryboyList[index].deliveryboy_alternativeContactNumber,
style: TextStyle(
fontSize: 16,
color:primaryColor, // Change the color for description content
),
),
],
),
),
SizedBox(height:5),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'address: ',
style: TextStyle(
fontSize: 16,
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: modeldeliveryboyList[index].deliveryboy_address,
style: TextStyle(
fontSize: 16,
color:primaryColor, // Change the color for description content
),
),
],
),
),
SizedBox(height:10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
icon: Icon(Icons.edit),
onPressed: () {
showUpdateDeliveryDialog(modeldeliveryboyList[index]);
},
),
IconButton(
icon: const Icon(Icons.delete,color: primaryColor,),
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 Delivery Boy?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: ()async {
bool deleteDeliveryboyStatus = await AppSettings.deleteDeliveryboy(modeldeliveryboyList[index].deliveryboy_phone);
if(deleteDeliveryboyStatus){
readJson();
AppSettings.longSuccessToast('Deliveryboy deleted successfully');
Navigator.of(context).pop(true);
}
else{
AppSettings.longFailedToast('Deliveryboy 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,
)),
),
],
),
);
},
),
],
),
],
),
),
),
);
}) ),
Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 8),
child: CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
IconButton(
iconSize: 40,
icon: const Icon(
Icons.add,
color: Colors.white,
),
onPressed: () async{
Navigator.pop(context);
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Deliverboy()),
);
//showBoreAddingDialog();
},
),
/* Padding(
padding: EdgeInsets.fromLTRB(5, 0, 5, 5),
child: Text(
'Add Tanks ',
style: TextStyle(color: Colors.white),
),
)*/
],
),
),
),
]);
}
else{
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: MediaQuery.of(context).size.height * .25,),
Text('Click below icon to add new Delivery Boy'),
SizedBox(
height: 20,
),
CircleAvatar(
backgroundColor: primaryColor,
radius: 40,
child: IconButton(
iconSize: 40,
icon: const Icon(
Icons.add,
color: Colors.white,
),
onPressed: () async {
Navigator.pop(context);
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Deliverboy()),
);
},
),
)
],
),
)
);
}
}
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
title: Text('Delivery Boy'),
backgroundColor: primaryColor,
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Dashboard()),
);
},
),
),
body: isLoading?Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
):renderzUi(),
));
}
}

@ -128,72 +128,80 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
} }
Widget _bindMedicines() { Widget _bindMedicines() {
if (medicine_name!='') { if (medicine_name != '') {
return Padding(padding: EdgeInsets.all(10), return Padding(
padding: EdgeInsets.all(10),
child: Container( child: Container(
width: double.infinity, width: double.infinity,
child: Column( decoration: BoxDecoration(
crossAxisAlignment: CrossAxisAlignment.center, color: Colors.white, // Set background color to white
mainAxisAlignment: MainAxisAlignment.start, borderRadius: BorderRadius.circular(5.0), // Set border radius to 5
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 2,
blurRadius: 5,
offset: Offset(0, 3), // changes position of shadow
),
],
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
GestureDetector( GestureDetector(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .18, width: MediaQuery.of(context).size.width * .18,
height: height: MediaQuery.of(context).size.height * .10,
MediaQuery.of(context).size.height * .10,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
image: DecorationImage( image: DecorationImage(
image: NetworkImage(medImages[0]) as ImageProvider, // picked file image: NetworkImage(medImages[0]) as ImageProvider,
fit: BoxFit.contain)), fit: BoxFit.contain,
),
borderRadius: BorderRadius.circular(5.0), // Set border radius to 5
),
), ),
onTap: () async { onTap: () async {
showPicDialog(medImages[0]); showPicDialog(medImages[0]);
}, },
), ),
GestureDetector( SizedBox(width: 10),
Expanded(
child: GestureDetector(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(("Name :"+ medicine_name), SizedBox(height: 30),
style: TextStyle(fontWeight: FontWeight.bold),
),
Text(("Manufacturers :"+ medicine_manufacturers),
style: TextStyle(fontWeight: FontWeight.bold),
),
Text( Text(
medicine_salt_composition, "Name: " + medicine_name,
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
Text(("Estimate Price :"+ medicine_mrp), Text(
"Estimate Price: " + medicine_mrp,
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
Text(("Medicine_Use :"+ medicine_primary_use), Text(
"Medicine Use: " + medicine_primary_use,
style: TextStyle(fontWeight: FontWeight.bold), style: TextStyle(fontWeight: FontWeight.bold),
), ),
], ],
), ),
onTap: () { onTap: () {
/* Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new MedicineDetailsCount()));*/
Navigator.push( Navigator.push(
context, context,
new MaterialPageRoute( new MaterialPageRoute(
builder: (__) => new MedicineDetails(name: medicine_name,price: medicine_mrp,bookid:medbookingid))); builder: (__) => new MedicineDetails(
name: medicine_name,
price: medicine_mrp,
bookid: medbookingid,
),
),
);
}, },
), ),
),
], ],
), ),
), ),
); );
} }
@ -267,7 +275,7 @@ class _GetMedicinesState extends State<GetMedicines> with TickerProviderStateMix
cursorColor: greyColor, cursorColor: greyColor,
controller: searchController, controller: searchController,
onChanged: (string) { onChanged: (string) {
if(string.length>=4){ if(string.length>=1){
getAllMedecineData(searchController.text); getAllMedecineData(searchController.text);
} }
else{ else{

@ -67,7 +67,6 @@ class _InActiveOffersViewState extends State<InActiveOffersView> with TickerProv
Widget renderzUi(){ Widget renderzUi(){
if(offersviewList.length!=0){ if(offersviewList.length!=0){
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
@ -76,8 +75,6 @@ class _InActiveOffersViewState extends State<InActiveOffersView> with TickerProv
itemCount: offersviewList.length, itemCount: offersviewList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Card( return Card(
color: offersviewList[index].cardColor,
child: Padding( child: Padding(
padding:EdgeInsets.all(8) , padding:EdgeInsets.all(8) ,
child: Row( child: Row(
@ -111,12 +108,11 @@ class _InActiveOffersViewState extends State<InActiveOffersView> with TickerProv
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
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].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())
], ],
), ),

@ -0,0 +1,173 @@
import 'package:flutter/material.dart';
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart';
class Invitations extends StatefulWidget {
const Invitations({Key? key}) : super(key: key);
@override
State<Invitations> createState() => _InvitationsState();
}
class _InvitationsState extends State<Invitations> {
TextEditingController mobileNumberController = TextEditingController();
TextEditingController nameController = TextEditingController();
final FlutterContactPicker _contactPicker = new FlutterContactPicker();
Contact? _contact;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Invitations'),
body: GestureDetector(
onTap: () {
FocusManager.instance.primaryFocus?.unfocus();
},
child: SafeArea(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(10),
child: Column(
children: [
Container(
child: TextFormField(
cursorColor: greyColor,
controller: nameController,
decoration: textFormFieldDecoration(
Icons.phone, 'Enter Name'),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * .02,
),
Container(
child: TextFormField(
cursorColor: greyColor,
controller: mobileNumberController,
keyboardType: TextInputType.number,
decoration: textFormFieldDecoration(
Icons.phone, 'Enter MobileNumber'),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * .04,
),
Container(
width: double.infinity,
height:
MediaQuery.of(context).size.height * .05,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.black, // foreground
),
onPressed: () async {
if (nameController.text != '' &&
mobileNumberController.text != '') {
AppSettings.preLoaderDialog(context);
var now = new DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd kk:mm').format(now);
var payload = new Map<String, dynamic>();
payload["name"] = nameController.text;
payload["phone"] = mobileNumberController.text;
payload["dateAndTime"] = formattedDate;
bool invitationStatus = await AppSettings.inviteFriend(payload);
try{
if(invitationStatus){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast("Invitation sent successfully");
nameController.clear();
mobileNumberController.clear();
}
else{
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast("Failed invite your friend");
}
}
catch(e){
AppSettings.longFailedToast("Failed invite your friend");
}
}
else {
AppSettings.longFailedToast("details should not be empty");
}
},
child: const Text('Invite'),
)),
SizedBox(
height: MediaQuery.of(context).size.height * .02,
),
Container(
child: Text(
'Or',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold,
fontSize: 20),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * .02,
),
TextButton(
child: const Text(
'Select from contacts',
style: TextStyle(
decoration: TextDecoration.underline,
color: primaryColor,
fontSize: 20),
),
onPressed: () async {
Contact? contact =
await _contactPicker.selectContact();
setState(() {
_contact = contact;
});
AppSettings.preLoaderDialog(context);
var now = new DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd kk:mm').format(now);
var payload = new Map<String, dynamic>();
String contactNumber=_contact!.phoneNumbers.toString();
String newContact= contactNumber.substring( 1, contactNumber.length - 1 ).trim();
String stringAfterRemovingWhiteSpace = '';
for (int i = 0; i < newContact.length; i++) {
if (!newContact[i].contains(' ')) {
stringAfterRemovingWhiteSpace = stringAfterRemovingWhiteSpace + "" + newContact[i];
}
}
payload["name"] =_contact!.fullName;
payload["phone"] = stringAfterRemovingWhiteSpace;
payload["dateAndTime"] = formattedDate;
bool invitationStatus = await AppSettings.inviteFriend(payload);
try{
if(invitationStatus){
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast("Invitation sent successfully");
}
else{
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast("Failed invite your friend");
}
}
catch(e){
AppSettings.longFailedToast("Failed invite your friend");
}
},
)
],
))))));
}
}

@ -1,4 +1,10 @@
import 'dart:io';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/PushNotificationService.dart';
import 'package:healthcare_pharmacy/chat/chatpage.dart';
import 'package:sizer/sizer.dart'; import 'package:sizer/sizer.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'splash_screen.dart'; import 'splash_screen.dart';
@ -7,6 +13,16 @@ void main () async {
// Set default home. // Set default home.
Widget _defaultHome = Splash(); Widget _defaultHome = Splash();
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
FirebaseOptions firebaseOptions = FirebaseOptions(
apiKey: 'AIzaSyC89L-Xg53Bd_mdCPvKOu7BcC9Ya6UZeds',
appId: '1:60196905754:android:05ea9ecef5280e578a42a3',
messagingSenderId: '60196905754 ',
projectId: 'health-pharma-67443',
storageBucket: "health-pharma-67443.appspot.com"// Firebase Realtime Database URL
);
Platform.isAndroid? await Firebase.initializeApp(options: firebaseOptions):await Firebase.initializeApp();
PushNotificationService().initialize();
FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(alert: true,badge: true,sound: true);
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
.then((_) { .then((_) {
runApp(Sizer( runApp(Sizer(

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/biddingrequests.dart'; import 'package:healthcare_pharmacy/biddingrequests.dart';
import 'package:healthcare_pharmacy/dashboard.dart'; import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/getalloffers.dart';
import 'package:healthcare_pharmacy/getmedicines.dart'; import 'package:healthcare_pharmacy/getmedicines.dart';
import 'package:healthcare_pharmacy/maps/app_colors.dart'; import 'package:healthcare_pharmacy/maps/app_colors.dart';
import 'package:healthcare_pharmacy/medicinedetailspage.dart'; import 'package:healthcare_pharmacy/medicinedetailspage.dart';
@ -14,10 +15,10 @@ import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_pic
class MedicineCartList extends StatefulWidget { class MedicineCartList extends StatefulWidget {
var bookidcart; var bookidID;
MedicineCartList({ MedicineCartList({
this.bookidcart this.bookidID
}); });
@override @override
@ -36,7 +37,10 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
String bookingidstring=''; String bookingidstring='';
bool isLoading=false; bool isLoading=false;
double finalGrandTotal=0.0;
double gstPercentage=0.0;
double discountedTotalAmount=0.0;
double additionalDiscount=0.0;
@ -44,6 +48,10 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
TextEditingController medicine_nameController = TextEditingController(); TextEditingController medicine_nameController = TextEditingController();
TextEditingController medicine_quantityController = TextEditingController(); TextEditingController medicine_quantityController = TextEditingController();
TextEditingController medicine_priceController = TextEditingController(); TextEditingController medicine_priceController = TextEditingController();
TextEditingController medicine_gstPriceController = TextEditingController();
TextEditingController medicine_additionalPriceController = TextEditingController();
TextEditingController medicine_finalPriceController = TextEditingController();
TextEditingController BookingidController = TextEditingController();
TextEditingController medicine_timingsController = TextEditingController(); TextEditingController medicine_timingsController = TextEditingController();
@ -51,7 +59,7 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
isLoading = true; isLoading = true;
try { try {
var response = await AppSettings.getCartDetails(widget.bookidcart).then((value){ var response = await AppSettings.getCartDetails(widget.bookidID).then((value){
setState(() { setState(() {
// offersviewList = BiddingCartviewModel.fromJson(response['items']) as List<BiddingCartviewModel>; // offersviewList = BiddingCartviewModel.fromJson(response['items']) as List<BiddingCartviewModel>;
offersviewList = offersviewList =
@ -81,6 +89,7 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
BookingidController.text=widget.bookidID;
getCartViewData(); getCartViewData();
super.initState(); super.initState();
} }
@ -183,9 +192,8 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
})), })),
Container( Container(
width: 400, width: MediaQuery.of(context).size.width,
height: 50, height: 50,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
child:TextButton( child:TextButton(
onPressed: () { onPressed: () {
// Add your button click logic here // Add your button click logic here
@ -200,13 +208,39 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
), ),
), ),
),), ),),
/* Container(
width: MediaQuery.of(context).size.width,
height: 30,
child: Align(
alignment: Alignment.center,
child: TextButton(
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => GetAllOffers(bookidID:BookingidController.text.toString())),
);
},
child: Text(
'Add Offers',
style: TextStyle(
fontSize:15,
color: AppColors.primaryColor, // Text color
decoration: TextDecoration.underline, // Underline the text
fontWeight: FontWeight.bold, // Bold text
),
),
),
),
),*/
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
width: 400, width: MediaQuery.of(context).size.width,
height: 50, height: 60,
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), padding: const EdgeInsets.fromLTRB(20, 0, 20, 10),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, // background primary: primaryColor, // background
@ -214,78 +248,225 @@ class _MedicineCartListState extends State<MedicineCartList> with TickerProvider
), ),
onPressed: () async{ onPressed: () async{
}, showDialog(
child: Text('CheckOut'), barrierDismissible: false,
)), context: context,
builder: (BuildContext context) {
double totalAmount = double.parse(totalPrice);
double additionalDiscountPercentage = 5;
double specialDiscountPercentage = 5;
gstPercentage = 18;
// Calculate additional discount
additionalDiscount = (totalAmount * additionalDiscountPercentage) / 100;
discountedTotalAmount = totalAmount - additionalDiscount;
// Calculate special discount
double specialDiscount = (discountedTotalAmount * specialDiscountPercentage) / 100;
double grandTotal = discountedTotalAmount - specialDiscount;
// Calculate GST on the grand total
double gstOnGrandTotal = (grandTotal * gstPercentage) / 100;
finalGrandTotal = grandTotal + gstOnGrandTotal;
medicine_priceController.text = finalGrandTotal.toString();
medicine_gstPriceController.text = gstPercentage.toString();
medicine_additionalPriceController.text = additionalDiscount.toString();
/*Column( return AlertDialog(
title: Text(
'Payment Receipt',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.red,
fontSize: 20
),
),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding(padding: const EdgeInsets.fromLTRB(10, 10,10,10), Text(
child: Row( 'Medicines Total Amount: ${totalAmount.toStringAsFixed(2)}',
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'Add More',
style: TextStyle( style: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 16
), ),
), ),
TextButton(
child: const Text( Text(
'Sign Up', 'Additional Discount (-5%): ${additionalDiscount.toStringAsFixed(2)} ',
style: TextStyle(fontSize: 15, style: TextStyle(
decoration: TextDecoration.underline,color: Colors.white), fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 16
), ),
onPressed: () { ),
*//* Navigator.push( Divider(
context, thickness: 2, // Adjust the thickness as needed
MaterialPageRoute( color: Colors.grey, // Adjust the color as needed
builder: (context) => const SignUp()), ),
);*//* Text(
//signup screen 'Discounted Total Ammount: ${discountedTotalAmount.toStringAsFixed(2)}',
},
)
],
),)
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( style: TextStyle(
fontSize: 20, fontWeight: FontWeight.bold,
color: AppColors.primaryColor, // Text color color: Colors.black,
decoration: TextDecoration.underline, // Underline the text fontSize: 16
fontWeight: FontWeight.bold, // Bold text
), ),
), ),
),), Text(
SizedBox( 'Special Discount (-5%): ${specialDiscount.toStringAsFixed(2)}',
height: 10, style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 16
), ),
Container( ),
width: 400, Divider(
height: 50, thickness: 2, // Adjust the thickness as needed
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), color: Colors.grey, // Adjust the color as needed
),
Text(
'Special Discounted Total Ammount: ${grandTotal.toStringAsFixed(2)}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 16
),
),
Text(
'GST (+18%): ${gstOnGrandTotal.toStringAsFixed(2)}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 16
),
),
Divider(
thickness: 2, // Adjust the thickness as needed
color: Colors.black, // Adjust the color as needed
),
Text(
'Grand Total: ${finalGrandTotal.toStringAsFixed(2)}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.redAccent,
fontSize: 20
),
),
],
),
actions: <Widget>[
Center(
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
primary: primaryColor, // background primary: primaryColor, // background
onPrimary: Colors.white, // foreground onPrimary: Colors.white, // foreground
), ),
onPressed: () async {
if (medicine_priceController.text != '' &&
medicine_gstPriceController.text != ''&&
medicine_additionalPriceController.text != ''
) {
AppSettings.preLoaderDialog(context);
var response = await AppSettings.cartFinalAmmount(BookingidController.text,medicine_priceController.text,
medicine_gstPriceController.text,medicine_additionalPriceController.text);
print("response$response");
//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(
"Medicines Final Price Sent Successfully");
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => Dashboard()),
);
}
else{
Navigator.of(context,rootNavigator: true).pop();
AppSettings.longFailedToast("Failed to Sent Final Medicines Price");
}
} catch (exception) {
print(exception);
}
}
else {
AppSettings.longFailedToast("Please enter valid details");
}
Navigator.of(context).pop();
},
child: Text('Submit'),
),
),
SizedBox(height: 10), // Add some spacing between buttons
/* Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: primaryColor, // background
onPrimary: Colors.white, // fores
),
onPressed: () async{ onPressed: () async{
var payload = new Map<String, dynamic>();
payload["pharmacyname"] =
"Arminta Pharma PVT LTD";
payload["pharmacyId"] =
"AWSSSUR1";
payload["customerId"] =
"AWSSSUR1";
payload["address"] =
"kphb";
payload["dateOfOrder"] =
"15/02/2024";
payload["action"] = "accept";
payload["price"] =
"1000";
payload["delivery_agent"] = "Arminta";
payload["agent_mobile"] = "8328206299";
payload["expectedDateOfDelivery"] ="20/02/2024";
bool requestStatus =
await AppSettings.assignDeliveryboyBookingRequests(
widget.bookidID,
payload);
if (requestStatus) {
Navigator.of(context).pop();
AppSettings.longSuccessToast(
"Booking Accepted");
// await getBookingRequestsData();
} else {}
},
child: Text('Assign Deliver Boy'),
),
),*/
],
);
},
);
}, },
child: Text('CheckOut'), child: Text('CheckOut'),
)), )),
],
)*/

@ -150,8 +150,10 @@ class _deliverboyState extends State<MedicineDetails> {
height: 5, height: 5,
), ),
Container( Container(
//padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: Row(
children: [
Expanded(
child: TextFormField( child: TextFormField(
cursorColor: greyColor, cursorColor: greyColor,
controller: MedicineQuantityController, controller: MedicineQuantityController,
@ -163,7 +165,8 @@ class _deliverboyState extends State<MedicineDetails> {
color: greyColor, color: greyColor,
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)), borderSide: BorderSide(color: greyColor),
),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor), borderSide: BorderSide(color: greyColor),
), ),
@ -172,11 +175,29 @@ class _deliverboyState extends State<MedicineDetails> {
), ),
labelText: 'Medicine Quantity', labelText: 'Medicine Quantity',
labelStyle: TextStyle( labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE color: greyColor,
), ),
), ),
), //tanker name
), ),
),
const SizedBox(width: 10), // Adjust the spacing as needed
QuantityInput(
label: 'Select Medicine Quantity',
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()}';
});
},
),
],
),
), //alternative phone number
//phone number //phone number
const SizedBox( const SizedBox(
height: 5, height: 5,
@ -208,34 +229,7 @@ class _deliverboyState extends State<MedicineDetails> {
), ),
), //tanker name ), //tanker name
), //alternative phone number ), //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( const SizedBox(
height: 5, height: 5,
), ),
@ -255,20 +249,9 @@ class _deliverboyState extends State<MedicineDetails> {
MedicinePriceController.text != '' MedicinePriceController.text != ''
) { ) {
AppSettings.preLoaderDialog(context); 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, var response = await AppSettings.addToCart(BookingidController.text,MedicineQuantityController.text,
MedicinePriceController.text,MedicineNameController.text,selectedOptionsText); MedicinePriceController.text,MedicineNameController.text,selectedOptionsText);
//String response= await addToCart("OR1690969760576127","10","300","Dolo650"); //String response= await addToCart("OR1690969760576127","10","300","Dolo650");
//print("response$response"); //print("response$response");
try { try {
if(response.statusCode==200){ if(response.statusCode==200){
@ -284,7 +267,7 @@ class _deliverboyState extends State<MedicineDetails> {
await Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => MedicineCartList(bookidcart:BookingidController.text.toString())), builder: (context) => MedicineCartList(bookidID:BookingidController.text.toString())),
); );

@ -0,0 +1,37 @@
import 'package:meta/meta.dart';
import 'dart:convert';
// Define chatMessageFromJson and chatMessageToJson at the top level
ChatMessage chatMessageFromJson(String str) => ChatMessage.fromJson(json.decode(str));
String chatMessageToJson(ChatMessage data) => json.encode(data.toJson());
class ChatMessage {
String senderId;
String receiverId;
String messageType;
String messageContent;
ChatMessage({
required this.senderId,
required this.receiverId,
required this.messageType,
required this.messageContent,
});
factory ChatMessage.fromJson(Map<String, dynamic> json) => ChatMessage(
senderId: json["senderId"],
receiverId: json["receiverId"],
messageType: json["messageType"],
messageContent: json["messageContent"],
);
Map<String, dynamic> toJson() => {
"senderId": senderId,
"receiverId": receiverId,
"messageType": messageType,
"messageContent": messageContent,
};
}

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

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

@ -1,27 +1,67 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
class PrescriptionPicture {
late String id;
late String url;
PrescriptionPicture({
required this.id,
required this.url,
});
factory PrescriptionPicture.fromJson(Map<String, dynamic> json) {
return PrescriptionPicture(
id: json['_id'],
url: json['url'],
);
}
}
class BiddingRequestsModel { class BiddingRequestsModel {
String custumerid_bidding = ''; String? customerId = '';
String pharmacyid_bidding=''; String? pharmacyId = '';
String amount_bidding=''; String? amount = '';
String bidding_bookingid=''; String? bookingId = '';
String? profilePicture = '';
String? firstName = '';
String? address = '';
String orderStatus = '';
String status = '';
Color cardColor=Colors.white; List<PrescriptionPicture> PrescriptionPictures = [];
Color cardColor = Colors.white;
Color textColor = Colors.black;
BiddingRequestsModel(); BiddingRequestsModel();
factory BiddingRequestsModel.fromJson(Map<String, dynamic> json){ factory BiddingRequestsModel.fromJson(Map<String, dynamic> json) {
BiddingRequestsModel rtvm = new BiddingRequestsModel(); BiddingRequestsModel rtvm = BiddingRequestsModel();
rtvm.custumerid_bidding = json['customerId'].toString() ??''; rtvm.customerId = json['customerId'].toString() ?? '';
rtvm.pharmacyid_bidding = json['pharmacyId'].toString() ?? ''; rtvm.pharmacyId = json['pharmacyId'].toString() ?? '';
rtvm.amount_bidding = json['biddingAmount'].toString() ?? ''; rtvm.amount = json['biddingAmount'].toString() ?? '';
rtvm.bidding_bookingid = json['bookingId'].toString() ?? ''; rtvm.bookingId = json['bookingId'].toString() ?? '';
rtvm.profilePicture = json['profilePicture'] ?? '';
rtvm.firstName = json['customerDetails']["firstName"].toString() ?? '';
rtvm.address = json['customerDetails']["address1"].toString() ?? '';
rtvm.status = json['status'];
// rtvm.prescription_url = json['pictureUrl'][0] ?? ''; if (json['PrescriptionPictures'] != null) {
var pictures = json['PrescriptionPictures'] as List;
rtvm.PrescriptionPictures =
pictures.map((picture) => PrescriptionPicture.fromJson(picture)).toList();
}
return rtvm; if (rtvm.status.toString().toLowerCase() == 'accepted') {
rtvm.textColor = Colors.green;
} else if (rtvm.status.toString().toLowerCase() == 'rejected') {
rtvm.textColor = Colors.red;
} else {
rtvm.textColor = primaryColor;
} }
return rtvm;
}
} }

@ -0,0 +1,22 @@
import 'dart:convert';
List<GetCoversatitonIdModel> listdadFromJson(String str) => List<GetCoversatitonIdModel >.from(json.decode(str).map((x) => GetCoversatitonIdModel .fromJson(x)));
String listdadToJson(List<GetCoversatitonIdModel > data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class GetCoversatitonIdModel {
String ? conversation_id;
GetCoversatitonIdModel ({
required this.conversation_id,
});
factory GetCoversatitonIdModel .fromJson(Map<String, dynamic> json) => GetCoversatitonIdModel (
conversation_id: json["conversation_id"],
);
Map<String, dynamic> toJson() => {
"conversation_id": conversation_id,
};
}

@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
class GetDeliveryboyDetailsModel {
String deliveryboy_name = '';
String deliveryboy_phone = '';
String deliveryboy_alternativeContactNumber = '';
String deliveryboy_address='';
// String deliveryboy_status='';
Color cardColor=Colors.white;
GetDeliveryboyDetailsModel();
factory GetDeliveryboyDetailsModel.fromJson(Map<String, dynamic> json){
GetDeliveryboyDetailsModel rtvm = new GetDeliveryboyDetailsModel();
rtvm.deliveryboy_name = json['name'] ?? '';
rtvm.deliveryboy_phone = json['phone'] ?? '';
rtvm.deliveryboy_alternativeContactNumber = json['alternativeContactNumber'] ?? '';
rtvm.deliveryboy_address = json['address'] ??'';
// rtvm.deliveryboy_status = json['status'] ??'';
return rtvm;
}
}

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

@ -0,0 +1,60 @@
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
class PharmacyAccountsModel {
String pharmacyId = '';
String customerId = '';
String bookingId = '';
String biddingAmount = '';
String date = '';
String orderStatus = '';
String acceptedCount = '';
String pendingRejectedCount = '';
String deliveredCount = '';
String deliveredTotalPrice = '';
String deliveredTotalAmountPaid = '';
String deliveredTotalAmountDue = '';
Color payment_color=Colors.grey;
String displayText = '';
PharmacyAccountsModel();
factory PharmacyAccountsModel.fromJson(Map<String, dynamic> json){
PharmacyAccountsModel rtvm = new PharmacyAccountsModel();
rtvm.pharmacyId = json['pharmacyId'] ?? '';
rtvm.customerId = json['customerId'] ?? '';
rtvm.bookingId = json['bookingId'] ?? '';
rtvm.biddingAmount = json['biddingAmount'] ?? '';
rtvm.date = json['date'] ?? '';
rtvm.orderStatus = json['status'] ?? '';
rtvm.acceptedCount = json['acceptedCount'] ?? '';
rtvm.pendingRejectedCount = json['pendingRejectedCount'] ?? '';
rtvm.deliveredCount = json['deliveredCount'] ?? '';
rtvm.deliveredTotalPrice = json['deliveredTotalPrice'] ?? '';
rtvm.deliveredTotalAmountPaid = json['deliveredTotalAmountPaid'] ?? '';
rtvm.deliveredTotalAmountDue = json['deliveredTotalAmountDue'] ?? '';
/* if(rtvm.orderStatus=='delivered' && rtvm.payment_status=='paid'){
rtvm.payment_color=Colors.green;
rtvm.displayText='Payment Completed';
}
else if(rtvm.orderStatus=='delivered' && rtvm.payment_status=='due'){
rtvm.payment_color=primaryColor;
rtvm.displayText='Due';
}*/
return rtvm;
}
}

@ -1,12 +1,17 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_pharmacy/dashboard.dart';
import 'package:healthcare_pharmacy/maps/app_colors.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/createoffers.dart'; import 'package:healthcare_pharmacy/createoffers.dart';
import 'package:healthcare_pharmacy/settings.dart'; import 'package:healthcare_pharmacy/settings.dart';
import 'package:healthcare_pharmacy/viewpager.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:image_picker/image_picker.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
@ -17,7 +22,7 @@ class OffersData extends StatefulWidget {
State<OffersData> createState() => _OffersDataState(); State<OffersData> createState() => _OffersDataState();
} }
class _OffersDataState extends State<OffersData> with TickerProviderStateMixin { class _OffersDataState extends State<OffersData> with TickerProviderStateMixin, WidgetsBindingObserver {
bool isOfferDataLoading=false; bool isOfferDataLoading=false;
bool isSereverIssue = false; bool isSereverIssue = false;
bool isSereverIssueConnected = false; bool isSereverIssueConnected = false;
@ -27,12 +32,24 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
TextEditingController updateOfferNameController = TextEditingController(); TextEditingController updateOfferNameController = TextEditingController();
TextEditingController updateOfferCodeController = TextEditingController(); TextEditingController updateOfferCodeController = TextEditingController();
TextEditingController updateOfferDescriptionController = TextEditingController(); TextEditingController updateOfferDescriptionController = TextEditingController();
TextEditingController updateOfferCategoryController = TextEditingController();
TextEditingController updateDiscountController = TextEditingController(); TextEditingController updateDiscountController = TextEditingController();
TextEditingController updateOfferStartDateController = TextEditingController(); TextEditingController updateOfferStartDateController = TextEditingController();
TextEditingController updateOfferEndDateController = TextEditingController(); TextEditingController updateOfferEndDateController = TextEditingController();
List<GetOffersDetailsModel> activeOffersList = []; List<GetOffersDetailsModel> activeOffersList = [];
List<GetOffersDetailsModel> inactiveOffersList = []; List<GetOffersDetailsModel> inactiveOffersList = [];
final ImagePicker _picker = ImagePicker();
String updateofferUrl='';
String dropdownTypeOfCategory = 'A {1 - 500}';
var typeOfCategoryItems = [
'A {1 - 500}',
'B {501 - 1000}',
'C {1001 - 2000}',
'D {Above 2000}',
'S {Special offer}',
];
List updateCategoryTypes = [];
late TabController _controller; late TabController _controller;
bool isActiveDataLoading=false; bool isActiveDataLoading=false;
@ -51,33 +68,28 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
children: [Text('InActive Offers')], children: [Text('InActive Offers')],
), ),
), ),
]; ];
Future<void> getActiveOffersViewData() async { Future<void> getActiveOffersViewData() async {
isActiveDataLoading = true; isActiveDataLoading = true;
try { try {
var response = await AppSettings.getOffers(); var data = await AppSettings.getOffers();
setState(() { setState(() {
activeOffersList = List<dynamic> responseData = jsonDecode(data)['data'];
((jsonDecode(response)['data']) as List).map((dynamic model) { activeOffersList = responseData
return GetOffersDetailsModel.fromJson(model); .map((jsonObject) => GetOffersDetailsModel.fromJson(jsonObject))
}).toList(); .toList();
isActiveDataLoading = false; isActiveDataLoading = false;
}); });
} catch (error) {
} catch (e) {
setState(() { setState(() {
isActiveDataLoading = false; isActiveDataLoading = false;
isSereverIssueConnected = true; isSereverIssueConnected = true;
}); });
} }
} }
Future<void> getInactiveOffersViewData() async { Future<void> getInactiveOffersViewData() async {
isinactiveDataLoading = true; isinactiveDataLoading = true;
try { try {
@ -99,23 +111,170 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
} }
} }
showUpdateOfferDialog(var object) async {
updateOfferNameController.text = object.offer_name; Future pickImageFromGallery(var offerCode) async {
updateOfferCodeController.text = object.offer_code;
updateOfferDescriptionController.text = object.description; try {
updateOfferStartDateController.text=object.starting_date; final image = await _picker.pickImage(source: ImageSource.gallery);
updateOfferEndDateController.text=object.ending_date; if (image == null) return '';
final imageTemp = File(image.path);
AppSettings.preLoaderDialog(context);
var res = await AppSettings.offerupdateuploadImageHTTPNew(image, offerCode);
print(jsonDecode(res));
setState(() {
updateofferUrl = jsonDecode(res)['picture'][0]['url'];
print("update url: $updateofferUrl");
});
Navigator.of(context, rootNavigator: true).pop();
if(res.contains("error")){
return 'some thing went wrong please try again';
}
else{
return jsonDecode(res)['picture'][0]['url'];
}
} on PlatformException catch (e) {
print('Failed to pick image: $e');
return 'some thing went wrong please try again';
}
}
Future<String> takeImageFromCamera(String offerCode) 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.offerupdateuploadImageHTTPNew(image, offerCode);
print(jsonDecode(res));
setState(() {
updateofferUrl = jsonDecode(res)['picture'][0]['url'];
print("update url: $updateofferUrl");
});
Navigator.of(context, rootNavigator: true).pop();
if(res.contains("error")){
return 'some thing went wrong please try again';
}
else{
return jsonDecode(res)['picture'][0]['url'];
}
} on PlatformException catch (e) {
print('Failed to pick image: $e');
return 'some thing went wrong please try again';
}
}
showUpdateOfferDialog(GetOffersDetailsModel object, int index) async {
updateOfferNameController.text = object.offer_name!;
updateOfferCodeController.text = object.offer_code!;
updateOfferDescriptionController.text = object.description!;
updateOfferStartDateController.text=object.starting_date!;
updateOfferEndDateController.text=object.ending_date!;
setState(() {
dropdownTypeOfCategory=object.category.toString().toString()??'';
});
updateofferUrl=object.picture[0].url;
return showDialog( return showDialog(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,
builder: (BuildContext context) { builder: (BuildContext context) {
return StatefulBuilder( return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) { builder: (BuildContext context, StateSetter setState) {
var data=activeOffersList[index];
print("result$updateofferUrl");
return AlertDialog( return AlertDialog(
title: const Text('Update Offer'), title: const Text('Update Offer'),
content: SingleChildScrollView( content: SingleChildScrollView(
child: ListBody( child: ListBody(
children: <Widget>[ children: <Widget>[
// ImageView
InkWell(
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(object.offer_code!).then((value) {
print("datatatttta$value");
setState(() {
updateofferUrl = value;
// print(updateofferUrl);
});
});
Navigator.pop(context);
},
),
SizedBox(
width:
MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
await pickImageFromGallery(object.offer_code).then((value) {
print("datatatttta$value");
setState(() {
updateofferUrl = value;
// print(updateofferUrl);
});
});;
Navigator.pop(context);
},
),
],
),
),
);
});
},
child: Container(
width: MediaQuery.of(context).size.width,
height: 150,
child: updateofferUrl.isEmpty
? Image.network(
"https://assets.aboutamazon.com/dims4/default/1db03c8/2147483647/strip/false/crop/2000x1125+0+0/resize/1200x675!/quality/90/?url=https%3A%2F%2Famazon-blogs-brightspot.s3.amazonaws.com%2Fa3%2Fc2%2F5c0b93db41d789be1bec015003bd%2Fpharmacy-hero-2000x1125.jpg",
fit: BoxFit.cover,
)
: Image.network(
updateofferUrl,
fit: BoxFit.cover,
),
),
),
const SizedBox(
height: 20,
),
// Offer Name
Container( Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0), padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: TextFormField( child: TextFormField(
@ -201,6 +360,64 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
), ),
), //tanker name ), //tanker name
), ),
const SizedBox(
height: 30,
),
Container(
child: DropdownButtonFormField(
// Initial Value
value: dropdownTypeOfCategory,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.type_specimen,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Type of category',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Select Type of category'),
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: typeOfCategoryItems.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
dropdownTypeOfCategory = newValue!;
});
},
),
),
const SizedBox( const SizedBox(
height: 20, height: 20,
), ),
@ -355,14 +572,21 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
onPressed: () async { onPressed: () async {
if (updateOfferNameController.text != '' ) { if (updateOfferNameController.text != '' ) {
AppSettings.preLoaderDialog(context); AppSettings.preLoaderDialog(context);
var payload = new Map<String, dynamic>();
payload["offer_name"] = updateOfferNameController.text.toString(); Map<String, dynamic> payload = {
payload["offer_code"] = updateOfferCodeController.text.toString(); "offer_name": updateOfferNameController.text.toString(),
payload["description"] = updateOfferDescriptionController.text.toString(); "offer_code": updateOfferCodeController.text.toString(),
payload["starting_date"] = updateOfferStartDateController.text.toString(); "description":updateOfferDescriptionController.text.toString(),
payload["ending_date"] = updateOfferEndDateController.text.toString(); "category":dropdownTypeOfCategory.toString(),
payload["offer_status"] ="active"; "starting_date":updateOfferStartDateController.text.toString(),
"ending_date": updateOfferEndDateController.text.toString(),
"picture": [
{
"url":updateofferUrl
}
],
"offer_status": "active",
};
bool offerStatus = await AppSettings.updateOffers(object.offer_code, payload); bool offerStatus = await AppSettings.updateOffers(object.offer_code, payload);
try { try {
@ -375,13 +599,16 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
updateOfferDescriptionController.text = ''; updateOfferDescriptionController.text = '';
updateOfferStartDateController.text = ''; updateOfferStartDateController.text = '';
updateOfferEndDateController.text = ''; updateOfferEndDateController.text = '';
Navigator.of(context).pop();
await getActiveOffersViewData(); await getActiveOffersViewData();
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const OffersData()),
);
} else { } else {
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedStyledToast( AppSettings.longFailedToast(
"Offer upadtion failed", context); "Offer upadtion failed");
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} catch (exception) { } catch (exception) {
@ -389,25 +616,43 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
print(exception); print(exception);
} }
} else { } else {
AppSettings.longFailedStyledToast("enter details", context); AppSettings.longFailedToast("enter details");
} }
}, },
), ),
], ],
); );
}); },
);
}, },
); );
} }
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
_controller = TabController(vsync: this, length: 2); _controller = TabController(vsync: this, length: 2);
getActiveOffersViewData(); getActiveOffersViewData();
getInactiveOffersViewData(); getInactiveOffersViewData();
WidgetsBinding.instance!.addObserver(this);
super.initState(); super.initState();
} }
@override
void dispose() {
WidgetsBinding.instance!.removeObserver(this);
super.dispose();
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.resumed) {
// The app has been resumed from the background
// Add your code here to handle the resume event
// AppSettings.longSuccessToast("Successfully");
}
}
Widget renderzActiveUi(){ Widget renderzActiveUi(){
if(activeOffersList.length!=0){ if(activeOffersList.length!=0){
@ -416,16 +661,34 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
children: [ children: [
Expanded(child:ListView.builder( Expanded(child:ListView.builder(
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
itemCount: activeOffersList.length, itemCount: activeOffersList .length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (context,index){
return Card( var data=activeOffersList[index];
margin: EdgeInsets.all(8.0), return GestureDetector(
onTap: () {
Navigator.push(
context,
new MaterialPageRoute(
builder: (__) => new Viewpager(activeOffersList,index)));
},
child: Card(
child: ListTile( child: ListTile(
contentPadding: EdgeInsets.all(8.0), leading: Container(
leading: CircleAvatar( width: 100,
backgroundImage: AssetImage('images/logo.png'), // Replace with your image path height: 300,
radius: 30, // Adjust the radius as needed decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
image: DecorationImage(
fit: BoxFit.cover,
alignment: Alignment.center, // Align the image within the container
image: data.picture.isEmpty
? AssetImage('images/logo.png') as ImageProvider
: NetworkImage(activeOffersList[index].picture[0].url),
),
),
), ),
title: RichText( title: RichText(
text: TextSpan( text: TextSpan(
style: DefaultTextStyle.of(context).style, style: DefaultTextStyle.of(context).style,
@ -490,6 +753,26 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
], ],
), ),
), ),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Category: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: activeOffersList[index].category,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
],
),
),
RichText( RichText(
text: TextSpan( text: TextSpan(
style: DefaultTextStyle.of(context).style, style: DefaultTextStyle.of(context).style,
@ -537,7 +820,8 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
IconButton( IconButton(
icon: Icon(Icons.edit), icon: Icon(Icons.edit),
onPressed: () { onPressed: () {
showUpdateOfferDialog(activeOffersList[index]);
showUpdateOfferDialog(activeOffersList[index], index);
}, },
), ),
Switch( Switch(
@ -611,6 +895,7 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
], ],
), ),
), ),
),
); );
@ -704,13 +989,24 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
padding: EdgeInsets.all(0), padding: EdgeInsets.all(0),
itemCount: inactiveOffersList.length, itemCount: inactiveOffersList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
var data=inactiveOffersList[index];
return Card( return Card(
margin: EdgeInsets.all(8.0), margin: EdgeInsets.all(8.0),
child: ListTile( child: ListTile(
contentPadding: EdgeInsets.all(8.0), contentPadding: EdgeInsets.all(8.0),
leading: CircleAvatar( leading: Container(
backgroundImage: AssetImage('images/logo.png'), // Replace with your image path width: 100,
radius: 30, // Adjust the radius as needed height: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
image: DecorationImage(
fit: BoxFit.cover,
alignment: Alignment.center, // Align the image within the container
image: data.picture.isEmpty
? AssetImage('images/logo.png') as ImageProvider
: NetworkImage(inactiveOffersList[index].picture[0].url),
),
),
), ),
title: RichText( title: RichText(
text: TextSpan( text: TextSpan(
@ -775,6 +1071,26 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
], ],
), ),
), ),
RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Category: ',
style: TextStyle(
color: Colors.black, // Change the color for "Description" text
fontWeight: FontWeight.bold, // You can apply other styles too
),
),
TextSpan(
text: inactiveOffersList[index].category,
style: TextStyle(
color:primaryColor, // Change the color for description content
),
),
],
),
),
RichText( RichText(
text: TextSpan( text: TextSpan(
style: DefaultTextStyle.of(context).style, style: DefaultTextStyle.of(context).style,
@ -847,9 +1163,9 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
bool deleteTankStatus = await AppSettings.reactiveOffers(inactiveOffersList[index].offer_code); bool deleteTankStatus = await AppSettings.reactiveOffers(inactiveOffersList[index].offer_code);
if (deleteTankStatus) { if (deleteTankStatus) {
getInactiveOffersViewData();
AppSettings.longSuccessToast('offer Re-Active successfully'); AppSettings.longSuccessToast('offer Re-Active successfully');
getActiveOffersViewData(); getActiveOffersViewData();
getInactiveOffersViewData();
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
} else { } else {
AppSettings.longFailedToast('offer Re-Active failed'); AppSettings.longFailedToast('offer Re-Active failed');
@ -1030,6 +1346,16 @@ class _OffersDataState extends State<OffersData> with TickerProviderStateMixin {
appBar: AppBar( appBar: AppBar(
title: Text('Offers'), title: Text('Offers'),
backgroundColor: primaryColor, backgroundColor: primaryColor,
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Dashboard()),
);
},
),
bottom: TabBar( bottom: TabBar(
controller: _controller, controller: _controller,
tabs: topTabs, tabs: topTabs,

@ -384,8 +384,8 @@ class _OffersViewState extends State<OffersView> with TickerProviderStateMixin {
await getOffersViewData(); await getOffersViewData();
} else { } else {
Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedStyledToast( AppSettings.longFailedToast(
"Offer upadtion failed", context); "Offer upadtion failed");
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} catch (exception) { } catch (exception) {
@ -393,7 +393,7 @@ class _OffersViewState extends State<OffersView> with TickerProviderStateMixin {
print(exception); print(exception);
} }
} else { } else {
AppSettings.longFailedStyledToast("enter details", context); AppSettings.longFailedToast("enter details");
} }
}, },
), ),
@ -416,8 +416,6 @@ class _OffersViewState extends State<OffersView> with TickerProviderStateMixin {
itemCount: offersviewList.length, itemCount: offersviewList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return Card( return Card(
color: offersviewList[index].cardColor,
child: Padding( child: Padding(
padding:EdgeInsets.all(8) , padding:EdgeInsets.all(8) ,
child: Row( child: Row(
@ -451,12 +449,11 @@ class _OffersViewState extends State<OffersView> with TickerProviderStateMixin {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
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].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())
], ],
), ),

@ -0,0 +1,271 @@
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'dart:async';
import 'package:permission_handler/permission_handler.dart';
import 'package:agora_rtc_engine/rtc_engine.dart';
import 'package:agora_rtc_engine/rtc_engine.dart' as rtc_engine;
import 'package:agora_rtc_engine/rtc_local_view.dart' as rtc_local_view;
import 'package:agora_rtc_engine/rtc_remote_view.dart' as rtc_remote_view;
class CallPage extends StatefulWidget {
final String? channelName;
final ClientRole? role;
const CallPage({Key? key, this.channelName, this.role}) : super(key: key);
@override
State<CallPage> createState() => _CallPageState();
}
class _CallPageState extends State<CallPage> {
final _users = <int>[];
final _infoString = <String>[];
late RtcEngine _engine;
bool muted = false; // Define the muted variable
bool viewPanel = true;
@override
void initState() {
super.initState();
initialize();
}
@override
void dispose() {
_users.clear();
_engine.leaveChannel();
_engine.destroy();
super.dispose();
}
Future<void> initialize() async {
if (appId.isEmpty) {
setState(() {
_infoString.add('AppId is missing please provide AppId');
_infoString.add('Agora Engine is not starting');
});
return;
}
_engine = await rtc_engine.RtcEngine.create(appId);
await _engine.enableVideo();
await _engine.setChannelProfile(ChannelProfile.LiveBroadcasting);
await _engine.setClientRole(widget.role!);
_addAgoraEventHandler();
VideoEncoderConfiguration configuration = VideoEncoderConfiguration(
dimensions: VideoDimensions(width: 1920, height: 1080),
);
await _engine.setVideoEncoderConfiguration(configuration);
await _engine.joinChannel(token, widget.channelName!, null, 0);
}
void _addAgoraEventHandler() {
_engine.setEventHandler(
rtc_engine.RtcEngineEventHandler(
error: (code) {
setState(() {
final info = 'Error: $code';
_infoString.add(info);
});
},
joinChannelSuccess: (channel, uid, elapsed) {
setState(() {
final info = 'Join Channel: $channel, uid:$uid';
_infoString.add(info);
});
},
leaveChannel: (stats) {
setState(() {
_infoString.add('Leave Channel');
_users.clear();
});
},
userJoined: (uid, elapsed) {
setState(() {
final info = 'User joined: $uid';
_infoString.add(info);
_users.add(uid);
});
},
userOffline: (uid, elapsed) {
setState(() {
final info = 'User Offline: $uid';
_infoString.add(info);
_users.remove(uid);
});
},
firstRemoteVideoFrame: (uid, width, height, elapsed) {
setState(() {
final info = 'First Remote Video: $uid $width*$height';
_infoString.add(info);
_users.remove(uid);
});
},
),
);
}
Widget _viewRows() {
final List<StatefulWidget> list = [];
if (widget.role == ClientRole.Broadcaster) {
list.add(const rtc_local_view.SurfaceView());
}
for (var uid in _users) {
list.add(rtc_remote_view.SurfaceView(
uid: uid,
channelId: widget.channelName!,
));
}
final views=list;
return Column(
children: List.generate(
views.length,
(index) => Expanded(
child: views[index],
),
),
);
}
Widget _toolbar() {
if (widget.role == ClientRole.Audience) return SizedBox();
return Container(
alignment: Alignment.bottomCenter,
padding: const EdgeInsets.symmetric(vertical: 48),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RawMaterialButton(
onPressed: () {
setState(() {
muted = !muted;
});
_engine.muteLocalAudioStream(muted);
},
child: Icon(
muted ? Icons.mic_off : Icons.mic,
color: muted ? Colors.white : Colors.blueAccent,
size: 20.0,
),
shape: CircleBorder(),
elevation: 2.0,
fillColor: muted ? Colors.blueAccent : Colors.white,
padding: EdgeInsets.all(12.0),
),
RawMaterialButton(
onPressed: () => Navigator.pop(context),
child: Icon(
Icons.call_end,
color: Colors.white,
size: 35.0,
),
shape: CircleBorder(),
elevation: 2.0,
fillColor: Colors.redAccent,
padding: EdgeInsets.all(15.0),
),
RawMaterialButton(
onPressed: () {
_engine.switchCamera();
},
child: Icon(
Icons.switch_camera,
color: Colors.blueAccent,
size: 20.0,
),
shape: CircleBorder(),
elevation: 2.0,
fillColor: Colors.white,
padding: EdgeInsets.all(12.0),
),
],
),
);
}
Widget _panel()
{
return Visibility(
visible: viewPanel,
child: Container(
padding: const EdgeInsets.symmetric(vertical: 48),
alignment: Alignment.bottomCenter,
child: FractionallySizedBox(
heightFactor: 0.5,
child: Container(
padding: EdgeInsets.symmetric(vertical: 48),
child: ListView.builder(
reverse: true,
itemCount: _infoString.length,
itemBuilder:(BuildContext context,int index)
{
if(_infoString.isEmpty)
{
return const Text("null");
}
return Padding(
padding: const EdgeInsets.symmetric(vertical: 3,horizontal: 10),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Flexible(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(5)
),
child: Text(
_infoString[index],
style: const TextStyle(color:Colors.blueGrey),
),
),
)
],
),
);
},
),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("VideoCall"),
centerTitle: true,
actions: [
IconButton(onPressed:()
{
setState(() {
viewPanel=!viewPanel;
});
}, icon: const Icon(Icons.ice_skating))
],
),
backgroundColor: Colors.black,
body: Center(
child: Stack(
children: <Widget>[
_viewRows(),
_panel(),
_toolbar(),
]
),
),
);
}
}

@ -0,0 +1,120 @@
import 'package:agora_rtc_engine/rtc_engine.dart';
import 'package:flutter/material.dart';
import 'package:async/async.dart';
import 'dart:developer';
import 'package:permission_handler/permission_handler.dart';
import './call.dart';
import 'package:flutter/material.dart' hide Size;
import 'dart:ui' as ui;
class IndexPage extends StatefulWidget {
const IndexPage({Key? key}) : super(key: key);
@override
State<IndexPage> createState() => _IndexPageState();
}
class _IndexPageState extends State<IndexPage> {
TextEditingController _channelController = TextEditingController(text: 'call');
bool _validateError=false;
ClientRole? _role= ClientRole.Broadcaster;
@override
void dispose() {
_channelController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("VideoCall"),
centerTitle: true,
),
body: SingleChildScrollView(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
children:<Widget> [
const SizedBox(height: 20),
const SizedBox(height: 20),
TextField(
controller: _channelController,
decoration: InputDecoration(
errorText: _validateError ? 'Chanel Name is Mondatory' : null,
border: UnderlineInputBorder(borderSide: BorderSide(width: 1),),
hintText: 'channel name',
),
),
RadioListTile(
title: const Text('Broadcaster'),
onChanged: (ClientRole? value)
{
setState(() {
_role=value;
});
},
value: ClientRole.Broadcaster,
groupValue: _role,
),
RadioListTile(
title: const Text('Audience'),
onChanged: (ClientRole? value)
{
setState(() {
_role=value;
});
},
value: ClientRole.Audience,
groupValue: _role,
),
ElevatedButton(
onPressed: onjoin,
child: const Text('Join'),
style: ElevatedButton.styleFrom(
minimumSize: const ui.Size(double.infinity, 40),
),
)
],
),
),
),
);
}
Future<void> onjoin() async {
setState(() {
_channelController.text.isEmpty
? _validateError=true:
_validateError=false; // This line doesn't actually update any state
});
if(_channelController.text.isNotEmpty)
{
await _handlecameraAndMic(Permission.camera);
await _handlecameraAndMic(Permission.microphone);
await Navigator.push(
context,
MaterialPageRoute(
builder: (__) => CallPage(
channelName: _channelController.text, // Passes the text from _channelController as channelName
role: _role, // Passes the value of _role as role
),
),
);
}
}
Future <void> _handlecameraAndMic(Permission permission) async
{
final status=await permission.request();
log(status.toString());
}
}

@ -0,0 +1,509 @@
import 'dart:convert';
import 'dart:ffi';
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/models/pharmacy_accounts_model.dart';
import 'package:healthcare_pharmacy/settings.dart';
class PharmacyAccounts extends StatefulWidget {
const PharmacyAccounts({Key? key}) : super(key: key);
@override
State<PharmacyAccounts> createState() => _PharmacyAccountsState();
}
class _PharmacyAccountsState extends State<PharmacyAccounts> {
List<PharmacyAccountsModel> accountsList = [];
String acceptedCount = '';
String pendingRejectedCount = '';
String deliveredCount = '';
String deliveredTotalPrice = '';
String deliveredTotalAmountPaid = '';
String deliveredTotalAmountDue = '';
bool isLoading = false;
bool isSereverIssue = false;
Future<void> readJson() async {
isLoading = true;
try {
var pharmaResponse = await AppSettings.getPharmacyAccounts();
print("pharmaResponse"+pharmaResponse);
setState(() {
accountsList =
((jsonDecode(pharmaResponse)['data']) as List).map((dynamic model) {
return PharmacyAccountsModel.fromJson(model);
}).toList();
acceptedCount = jsonDecode(pharmaResponse)['acceptedCount'].toString();
pendingRejectedCount =
jsonDecode(pharmaResponse)['pendingRejectedCount'].toString();
deliveredCount =
jsonDecode(pharmaResponse)['deliveredCount'].toString();
deliveredTotalPrice =
jsonDecode(pharmaResponse)['deliveredTotalPrice'].toString();
deliveredTotalAmountPaid =
jsonDecode(pharmaResponse)['deliveredTotalAmountPaid'].toString();
deliveredTotalAmountDue =
jsonDecode(pharmaResponse)['deliveredTotalAmountDue'].toString();
isLoading = false;
});
} catch (e) {
setState(() {
isLoading = false;
isSereverIssue = true;
});
}
}
@override
void initState() {
// TODO: implement initState
readJson();
super.initState();
}
modelBottomSheet(var obj) {
showModalBottomSheet<void>(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(topLeft: Radius.circular(15.0), topRight: Radius.circular(15.0)),
),
isScrollControlled: true,
context: context,
builder: (BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.height * .300,
child: Padding(
padding: EdgeInsets.all(10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Supplier Name', style: labelTextStyle()),
Text('Delivery Agent', style: labelTextStyle()),
Text('Tanker Name', style: labelTextStyle()),
Text('Capacity Of Tanker', style: labelTextStyle()),
Text('Booking Id', style: labelTextStyle()),
Text('Date Of Order', style: labelTextStyle()),
Text('Type Of Water', style: labelTextStyle()),
Text('Start Time', style: labelTextStyle()),
Text('Stop Time', style: labelTextStyle()),
Text('Initial Water Level', style: labelTextStyle()),
Text('Final Water Level', style: labelTextStyle()),
Text('Delivered Water', style: labelTextStyle()),
Text('Actual Price', style: labelTextStyle()),
Text('Amount Paid', style: labelTextStyle()),
Text('Amount Due', style: labelTextStyle()),
Text('Payment Mode', style: labelTextStyle()),
],
),
SizedBox(width:5),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
],
),
SizedBox(width:5),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(obj.supplierName, style: valuesTextStyle()),
Text(obj.delivery_agent, style: valuesTextStyle()),
Text(obj.tanker_name, style: valuesTextStyle()),
Text(obj.capacity + ' Ltrs', style: valuesTextStyle()),
Text(obj.bookingid,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.dateOfOrder,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.typeofwater,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.start_time,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.stop_time,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.initial_water_level + ' Ltrs',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.final_water_level + ' Ltrs',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.quantityDelivered + ' Ltrs',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.price,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.amount_paid,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.amount_due,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
Text(obj.payment_mode,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
],
),
),
Expanded(child: Column(
children: [
Icon(Icons.payment_outlined, color: obj.payment_color, size: 40,),
Text(obj.displayText,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis,
)),
],
))
],
),
));
},
);
}
Widget _accounsList() {
if (accountsList.length != 0) {
return Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
Container(
width: double.infinity,
child: Padding(
padding: EdgeInsets.fromLTRB(8, 8, 8, 0),
child: Card(
child: Padding(
padding: EdgeInsets.all(8),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'acceptedCount',
style: labelTextStyle(),
),
Text(
'pendingRejectedCount',
style: labelTextStyle(),
),
Text(
'deliveredCount',
style: labelTextStyle(),
),
Text(
'deliveredTotalPrice',
style: labelTextStyle(),
),
Text(
'deliveredTotalAmountPaid',
style: labelTextStyle(),
),
Text(
'deliveredTotalAmountDue',
style: labelTextStyle(),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
': ',
style: labelTextStyle(),
),
Text(
': ',
style: labelTextStyle(),
),
Text(
': ',
style: labelTextStyle(),
),
Text(
': ',
style: labelTextStyle(),
),
Text(
': ',
style: labelTextStyle(),
),
Text(
': ',
style: labelTextStyle(),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
acceptedCount,
style: valuesTextStyle(),
),
Text(
deliveredCount,
style: valuesTextStyle(),
),
Text(
pendingRejectedCount,
style: valuesTextStyle(),
),
Row(
children: [
Icon(
Icons.currency_rupee,
color: Colors.black,
size: 10,
),
SizedBox(width: 5),
Text(
AppSettings.formNum(deliveredTotalPrice),
style: valuesTextStyle(),
),
],
),
Row(
children: [
Icon(
Icons.currency_rupee,
color: Colors.black,
size: 10,
),
SizedBox(width: 5),
Text(
AppSettings.formNum(
deliveredTotalAmountPaid),
style: valuesTextStyle(),
),
],
),
Row(
children: [
Icon(
Icons.currency_rupee,
color: Colors.black,
size: 10,
),
SizedBox(width: 5),
Text(deliveredTotalAmountDue=='null'?
'':AppSettings.formNum(
deliveredTotalAmountDue),
style: valuesTextStyle(),
),
],
),
],
),
],
))),
)),
Expanded(
child: ListView.builder(
padding: EdgeInsets.all(8),
itemCount: accountsList.length,
itemBuilder: (BuildContext context, int index) {
return Card(
child: Padding(
padding: EdgeInsets.all(8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
// width: MediaQuery.of(context).size.width * .75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('pharmacyId', style: labelTextStyle()),
Text('bookingId',
style: labelTextStyle()),
Text('biddingAmount',
style: labelTextStyle()),
],
),
SizedBox(width: 5),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
Text(':', style: labelTextStyle()),
],
),
SizedBox(width: 5),
Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
accountsList[index]
.pharmacyId
.toUpperCase(),
style: valuesTextStyle()),
Text(
accountsList[index]
.bookingId
.toUpperCase(),
style: valuesTextStyle()),
Text(
accountsList[index]
.biddingAmount
.toUpperCase()+' Ltrs',
style: valuesTextStyle()),
],
),
],
),
),
Visibility(
visible: accountsList[index].orderStatus=='delivered' ,
child: Expanded(
child: TextButton(
onPressed: () {
//modelBottomSheet(accountsList[index]);
},
child: const Text(
'More Details',
style: TextStyle(
color: primaryColor,
fontSize: 15,
decoration: TextDecoration.underline,
),
),
),
),)
],
),
),
);
})),
]);
} else {
return Center(
child: Padding(
padding: EdgeInsets.fromLTRB(0, 40, 0, 0),
child: isSereverIssue
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image(
image: AssetImage('images/updatepin.png.png'),
// height: MediaQuery.of(context).size.height * .10,
),
SizedBox(
height: 20,
),
Text(
'There is an issue at server please try after some time',
style: serverIssueTextStyle(),
),
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image(
image: AssetImage('images/no_data.png'),
// height: MediaQuery.of(context).size.height * .10,
),
SizedBox(
height: 20,
),
Text(
'No Data',
style: serverIssueTextStyle(),
),
],
),
));
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Accounts'),
body: isLoading
? Center(
child: CircularProgressIndicator(
color: primaryColor,
strokeWidth: 5.0,
),
)
: _accounsList(),
);
}
}

@ -0,0 +1,124 @@
import 'dart:convert';
import 'dart:io';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
import 'package:flutter_share/flutter_share.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:share/share.dart';
import 'dart:typed_data';
import 'package:path_provider/path_provider.dart';
import 'package:http/http.dart' as http;
import 'package:qr_flutter/qr_flutter.dart';
class DisplayQrCode extends StatefulWidget {
const DisplayQrCode({Key? key}) : super(key: key);
@override
State<DisplayQrCode> createState() => _DisplayQrCodeState();
}
class _DisplayQrCodeState extends State<DisplayQrCode> {
Future<void> share(var qr) async {
await FlutterShare.share(
title: 'Example share',
text: 'Example share text',
linkUrl: qr,
chooserTitle: 'Example Chooser Title');
}
Future<void> shareQRCodeImage1(qrData) async {
final tempDir = await getTemporaryDirectory();
final file = File('${tempDir.path}/qr_code.png');
await file.writeAsBytes(Uint8List.fromList(base64.decode(qrData)));
// Share the image using the share package
Share.shareFiles([file.path], text: 'Check out this QR code');
}
String imagePath = '';
Future<void> downloadQRImage() async {
final response = await http.get(Uri.parse(AppSettings.qrCode));
if (response.statusCode == 200) {
final directory = await getApplicationDocumentsDirectory();
final filePath = '${directory.path}/qr_image.png';
final File file = File(filePath);
await file.writeAsBytes(response.bodyBytes);
setState(() {
imagePath = filePath;
});
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppSettings.appBar('Qr Code'),
body: Container(
child: Padding(padding: EdgeInsets.all(10),
child: Column(
children: [
Center(
child: Container(
padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
width: MediaQuery.of(context).size.width * .60, // Set the desired width
height: MediaQuery.of(context).size.height * .35, // Set the desired height
child:
Image.memory(Uint8List.fromList(base64.decode(AppSettings.qrCode),),
fit: BoxFit.fill),
),
),
SizedBox(
height:MediaQuery.of(context).size.height * .05,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
onPressed: () {
//share(AppSettings.qrCode);
shareQRCodeImage1(AppSettings.qrCode);
},
icon: Icon(
Icons.share,
color: primaryColor,
size: 40,
),
),
/*IconButton(
onPressed: () {
downloadQRImage();
},
icon: Icon(
Icons.download,
color: primaryColor,
size: 40,
),
),*/
],
)
/*Container(
padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
child: Center(child: Image.memory(Uint8List.fromList(base64.decode(AppSettings.qrCode),),),),
)*/
],
),),
),
);
}
}

@ -9,7 +9,6 @@ import 'package:healthcare_pharmacy/preloader.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'dart:async'; import 'dart:async';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
@ -19,6 +18,7 @@ import 'package:fluttertoast/fluttertoast.dart';
const Color primaryColor = Color(0XFFA78966); const Color primaryColor = Color(0XFFA78966);
const Color secondaryColor = Color(0XFFF0E0CC); const Color secondaryColor = Color(0XFFF0E0CC);
const Color buttonColor = Color(0XFF6A3632); const Color buttonColor = Color(0XFF6A3632);
const Color buttonColors = Color(0XFFFFAC1C);
const Color greyColor = Color(0XFF8F8E8E); const Color greyColor = Color(0XFF8F8E8E);
const Color textFieldStartColor = Colors.grey; const Color textFieldStartColor = Colors.grey;
@ -28,6 +28,9 @@ const Color dashboardbackground = Color(0XFFF5F5F5);
Color AppBarGradient_1 = Color(0XFF1258F6); Color AppBarGradient_1 = Color(0XFF1258F6);
const appId="e5b593d506884e32856b5d6b1d72860f";
const token="007eJxTYND4K6oWPK3qxqetN7c8MpRK17hQpdzqWX5xaY/fMhbxmF0KDKmmSaaWximmBmYWFiapxkYWpmZJpilmSYYp5kYWZgZp2sJyaQ2BjAwvmg4xMTJAIIjPwpCcmJPDwAAAFiUeHw==";
TextStyle PreloaderText() { TextStyle PreloaderText() {
return TextStyle(color: Colors.blueAccent); return TextStyle(color: Colors.blueAccent);
} }
@ -146,6 +149,8 @@ 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 customerId = 'AHSUSNE1';
static String healthpharmastaticid = '123456789'; static String healthpharmastaticid = '123456789';
static String profileImage = ''; static String profileImage = '';
static List<String> storedPreferenceValidKeys = ['pharmacyname', 'access_token']; static List<String> storedPreferenceValidKeys = ['pharmacyname', 'access_token'];
@ -156,6 +161,8 @@ class AppSettings {
static bool haspermission = false; static bool haspermission = false;
static late LocationPermission permission; static late LocationPermission permission;
static late Position position; static late Position position;
static String qrCode = '';
static String long = "", lat = ""; static String long = "", lat = "";
late StreamSubscription<Position> positionStream; late StreamSubscription<Position> positionStream;
static String fcmId=''; static String fcmId='';
@ -163,7 +170,7 @@ class AppSettings {
//api urls //api urls
static String host = 'http://35.200.129.165:4000/api/'; static String host = 'http://cloudh.in:4000/api/';
static String loginUrl = host + 'pharmacylogin'; static String loginUrl = host + 'pharmacylogin';
static String signUpUrl = host + 'addPharmacy'; static String signUpUrl = host + 'addPharmacy';
static String updatePharmacyUrl = host + 'update/currentPharmacy'; static String updatePharmacyUrl = host + 'update/currentPharmacy';
@ -171,6 +178,7 @@ class AppSettings {
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 uploadOfferUrl = host + 'uploads-offerPicture';
static String updateuploadOfferUrl = host + 'update-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';
@ -179,32 +187,31 @@ class AppSettings {
static String createOffersUrl = host + 'addoffer'; static String createOffersUrl = host + 'addoffer';
static String createCompanyOffersUrl = host + 'addcompanyoffer'; static String createCompanyOffersUrl = host + 'addcompanyoffer';
static String getOffersActiveDataUrl = host + 'getActivePharmacyOfferdata'; static String getOffersActiveDataUrl = host + 'getActivePharmacyOfferdata';
static String getApprovedOffersDataUrl = host + 'getapprovedPharmacyOfferdata';
static String getOffersinActiveDataUrl = host + 'getInActivePharmacyOfferdata'; static String getOffersinActiveDataUrl = host + 'getInActivePharmacyOfferdata';
static String updateOffersDataUrl = host + 'updateOffer'; static String updateOffersDataUrl = host + 'updateOffer';
static String inactiveOffersDataUrl = host + 'inactiveOffer'; static String inactiveOffersDataUrl = host + 'inactiveOffer';
static String reactiveOffersDataUrl = host + 'reactiveOffer'; static String reactiveOffersDataUrl = host + 'reactiveOffer';
static String deleteOfferUrl = host + 'deleteOffer'; static String deleteOfferUrl = host + 'deleteOffer';
static String discountOfferUrl = host + 'calculateTotalPriceWithDiscount';
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 + 'statusBiddingRequest';
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 getCartFinalAmmountUrl = host + 'cart/final-price-with-gst';
static String getPharmacyDataUrl = host + 'getAllPharmacylist'; static String getPharmacyDataUrl = host + 'getAllPharmacylist';
static String inviteFriendUrl = host + 'pharmacySendInviteLink';
static String addDeliveryboyUrl = host + 'addDeliveryboys';
static String getAllDeliverboyUrl = host + 'deliveryBoys';
static String updateDeliveryboyUrl = host + 'editDeliveryBoy';
static String deleteDeliveryboyUrl = host + 'deletedeliveryboy';
static String getPharmacyAccountsUrl = host + 'pharmacyAccounts';
static String generateQRCodeUrl = host + 'generate-qrcode-pharmacy';
static String getIdDataUrl = host + 'startConversation';
static String acceptBookingRequestsUrl = host + 'assignDeliveryBoy';
@ -212,6 +219,7 @@ class AppSettings {
static File? updatedImage; static File? updatedImage;
static String image = ''; static String image = '';
static String profilePictureUrl = ''; static String profilePictureUrl = '';
static String description = '';
static String offerPictureUrl = ''; static String offerPictureUrl = '';
static var api = { static var api = {
@ -232,7 +240,9 @@ class AppSettings {
double.parse(s), double.parse(s),
); );
} }
TextStyle drawerHeaderTextStyleNew() {
return TextStyle(color: Colors.black, fontSize: 15);
}
/* Preloader */ /* Preloader */
@ -369,7 +379,94 @@ class AppSettings {
} }
} }
static Future<bool> assignDeliveryboyBookingRequests(var bookingId,payload) async {
var response = await http.post(Uri.parse(acceptBookingRequestsUrl + '/' + 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.post(Uri.parse(acceptBookingRequestsUrl + '/' + 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> generateQRCode() async {
var uri = Uri.parse(generateQRCodeUrl + '/' + healthpharmaIdsign);
var response = await http.post(uri, headers: await buildPutRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.post(uri, headers: await buildPutRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else {
return '';
}
} else {
return '';
}
} else {
return '';
}
}
static Future<bool> inviteFriend(payload) async {
var uri = Uri.parse(inviteFriendUrl);
uri = uri.replace(query: 'pharmacyId=$healthpharmaIdsign');
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> uploadImageHTTPNew(file) async { static Future<String> uploadImageHTTPNew(file) async {
var request = http.MultipartRequest('POST', Uri.parse(uploadPicUrl + '/' + healthpharmaIdsign)); var request = http.MultipartRequest('POST', Uri.parse(uploadPicUrl + '/' + healthpharmaIdsign));
@ -390,10 +487,6 @@ class AppSettings {
return response.body; 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(
@ -409,6 +502,7 @@ class AppSettings {
pharmacyDescription = _response['description']; pharmacyDescription = _response['description'];
await saveData('pharmacyname', _response['simplydata']['pharmacyname'], 'STRING'); await saveData('pharmacyname', _response['simplydata']['pharmacyname'], 'STRING');
await saveData('phone', _response['simplydata']['phone'], 'STRING'); await saveData('phone', _response['simplydata']['phone'], 'STRING');
await saveData('description', _response['simplydata']['description'], 'STRING');
await saveData('email', _response['simplydata']['email'][0]['email'], 'STRING'); await saveData('email', _response['simplydata']['email'][0]['email'], 'STRING');
await loadDataFromMemory(); await loadDataFromMemory();
return true; return true;
@ -451,8 +545,6 @@ class AppSettings {
return false; return false;
} }
} }
static Future<bool> deleteInActiveOffer(offerCode) async { static Future<bool> deleteInActiveOffer(offerCode) async {
var uri = Uri.parse(deleteOfferUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(deleteOfferUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'offer_code=$offerCode'); uri = uri.replace(query: 'offer_code=$offerCode');
@ -484,14 +576,8 @@ class AppSettings {
return false; return false;
} }
} }
static Future<bool> createCompanyOffers(payload) async { static Future<bool> createCompanyOffers(payload) async {
var uri = Uri.parse(createCompanyOffersUrl + '/' + "123456"); var uri = Uri.parse('http://35.200.129.165:4000/api/addcompanyoffer/1234');
var response = await http.post(uri, var response = await http.post(uri,
body: json.encode(payload), headers: await buildRequestHeaders()); body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {
@ -520,10 +606,6 @@ class AppSettings {
return false; 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);
@ -547,10 +629,59 @@ class AppSettings {
} }
} }
static Future<String> getChatId() async {
//path parameter
var uri = Uri.parse(getIdDataUrl + '/' +healthpharmaIdsign );
uri = uri.replace(query: 'customerId=$customerId');
var response = await http.get(uri, headers: await buildRequestHeaders());
var responcedatatemp=jsonDecode(response.body);
print("responcedata$responcedatatemp");
print("responcedata$customerId");
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> getApprovedOffers() async {
//path parameter
var uri = Uri.parse(getApprovedOffersDataUrl + '/' + 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 '';
}
}
static Future<String> getCartDetails(bookingId) async { static Future<String> getCartDetails(bookingId) async {
//path parameter //path parameter
var uri = Uri.parse(getCartDataUrl + '/' + bookingId); var uri = Uri.parse(getCartDataUrl + '/' +healthpharmaIdsign );
uri = uri.replace(query: 'bookingId=$bookingId');
var response = await http.get(uri, headers: await buildRequestHeaders()); var response = await http.get(uri, headers: await buildRequestHeaders());
var responcedatatemp=jsonDecode(response.body); var responcedatatemp=jsonDecode(response.body);
print("responcedata$responcedatatemp"); print("responcedata$responcedatatemp");
@ -573,7 +704,6 @@ class AppSettings {
return ''; return '';
} }
} }
static Future<http.Response> addToCart(String orderId, String quantity, String price,String mName,String mtimings) async { static Future<http.Response> addToCart(String orderId, String quantity, String price,String mName,String mtimings) async {
var headers = { var headers = {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -594,7 +724,8 @@ class AppSettings {
] ]
}); });
print("Timintgs"+body.toString()); print("Timintgs"+body.toString());
var uri = Uri.parse(addToCartDataUrl); var uri = Uri.parse(addToCartDataUrl+ '/' + healthpharmaIdsign);
// uri = uri.replace(query: 'pharmacyId=$healthpharmaIdsign');
var response = await http.post( var response = await http.post(
uri, uri,
headers: headers, headers: headers,
@ -604,31 +735,26 @@ class AppSettings {
return response; return response;
} }
/* static Future<bool> addToCart(payload) async { static Future<http.Response> cartFinalAmmount(String bookingId,String totalPrice, String priceGst, String additionalDiscont,) async {
var response = await http.post(Uri.parse(addToCartDataUrl), var headers = {
body: json.encode(payload), 'Content-Type': 'application/json'
headers: {'Content-type': 'application/json'}); };
var body=json.encode({
"totalPrice": totalPrice,
"gst": priceGst,
"additional_discount": additionalDiscont
});
print("cartResponce"+body.toString());
var uri = Uri.parse(getCartFinalAmmountUrl + '/' +healthpharmaIdsign );
uri = uri.replace(query: 'bookingId=$bookingId');
var response = await http.post(
uri,
headers: headers,
body: body,
);
if (response.statusCode == 200) { return response;
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> getPharmacyData() async { static Future<String> getPharmacyData() async {
var uri = Uri.parse(getPharmacyDataUrl); var uri = Uri.parse(getPharmacyDataUrl);
@ -651,8 +777,6 @@ class AppSettings {
return ''; 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);
@ -675,40 +799,6 @@ class AppSettings {
return ''; 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 { static Future<bool> getRequestBiddingDetails(var bookingId,payload) async {
var response = await http.put(Uri.parse(getRequestBiddingDataUrl + '/' + bookingId), var response = await http.put(Uri.parse(getRequestBiddingDataUrl + '/' + bookingId),
body: json.encode(payload), headers: await buildRequestHeaders()); body: json.encode(payload), headers: await buildRequestHeaders());
@ -738,13 +828,6 @@ class AppSettings {
return false; 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);
@ -767,15 +850,25 @@ class AppSettings {
return ''; return '';
} }
} }
static Future<String> offerupdateuploadImageHTTPNew(file, var offerCode) async {
var request = http.MultipartRequest('POST', Uri.parse(updateuploadOfferUrl + '/' + healthpharmaIdsign+"/"+offerCode));
request.files.add(await http.MultipartFile.fromPath('picture', file.path));
var res = await request.send();
var response = await http.Response.fromStream(res);
if(response.statusCode==200){
return response.body;
}
else{
return 'error';
}
}
static Future<bool> updateOffers(offer_code, payload) async { static Future<bool> updateOffers(offer_code, payload) async {
var uri = Uri.parse(updateOffersDataUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(updateOffersDataUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'offer_code=$offer_code'); uri = uri.replace(query: 'offer_code=$offer_code');
try { try {
var response = await http.put(uri, var response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders()); body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) { if (response.statusCode == 200) {
return true; return true;
} else if (response.statusCode == 401) { } else if (response.statusCode == 401) {
@ -799,6 +892,44 @@ class AppSettings {
return false; return false;
} }
} }
static Future<bool> discountOffer(String offerCode, String bookidID) async {
try {
// Construct the URL with offerCode as path parameter and bookidID as query parameter
var uri = Uri.parse('$discountOfferUrl/$offerCode').replace(query: 'bookingId=$bookidID');
// Make the HTTP request
var response = await http.get(uri, headers: await buildPutRequestHeaders());
// Check the response status
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
// Handle 401 Unauthorized status if needed
bool status = await AppSettings.resetToken();
if (status) {
// Retry the request after resetting the token
response = await http.put(uri, headers: await buildPutRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
// Handle other status codes if needed
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<bool> deleteOffers(offer_code) async { static Future<bool> deleteOffers(offer_code) async {
var uri = Uri.parse(inactiveOffersDataUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(inactiveOffersDataUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'offer_code=$offer_code'); uri = uri.replace(query: 'offer_code=$offer_code');
@ -830,7 +961,6 @@ class AppSettings {
return false; return false;
} }
} }
static Future<bool> reactiveOffers(offer_code) async { static Future<bool> reactiveOffers(offer_code) async {
var uri = Uri.parse(reactiveOffersDataUrl + '/' + healthpharmaIdsign); var uri = Uri.parse(reactiveOffersDataUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'offer_code=$offer_code'); uri = uri.replace(query: 'offer_code=$offer_code');
@ -862,7 +992,6 @@ class AppSettings {
return false; return false;
} }
} }
static Future<bool> sendSms(payload) async{ static Future<bool> sendSms(payload) async{
var response=await http.post(Uri.parse(sendSmsUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'}); var response=await http.post(Uri.parse(sendSmsUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'});
if(response.statusCode==200){ if(response.statusCode==200){
@ -872,7 +1001,6 @@ class AppSettings {
return false; return false;
} }
} }
static Future<String> getAllMedecines(var medicine) async { static Future<String> getAllMedecines(var medicine) async {
var uri = Uri.parse(medecineDataUrl + '/' + medicine); var uri = Uri.parse(medecineDataUrl + '/' + medicine);
//uri = uri.replace(query: 'customerId=$customerId'); //uri = uri.replace(query: 'customerId=$customerId');
@ -896,8 +1024,6 @@ class AppSettings {
return ''; return '';
} }
} }
static Future<bool> phoneVerification(payload) async{ static Future<bool> phoneVerification(payload) async{
var response=await http.post(Uri.parse(phoneVerificationUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'}); var response=await http.post(Uri.parse(phoneVerificationUrl),body: json.encode(payload), headers: {'Content-type': 'application/json'});
if(response.statusCode==200){ if(response.statusCode==200){
@ -907,7 +1033,6 @@ class AppSettings {
return false; return false;
} }
} }
static Future<bool> resetToken() async { static Future<bool> resetToken() async {
var uri = Uri.parse(resetTokenUrl + '/' + pharmacyId); var uri = Uri.parse(resetTokenUrl + '/' + pharmacyId);
@ -952,11 +1077,6 @@ class AppSettings {
return false; return false;
} }
} }
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,
@ -992,6 +1112,155 @@ class AppSettings {
} }
} }
static Future<bool> addDeliverboy(payload) async {
var response = await http.post(Uri.parse(addDeliveryboyUrl + '/' + healthpharmaIdsign),
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.parse(addDeliveryboyUrl + '/' + healthpharmaIdsign),
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> getAllDeliverboy() async {
var response = await http.get(Uri.parse(getAllDeliverboyUrl + '/' + healthpharmaIdsign),
headers: await buildRequestHeaders());
if (response.statusCode == 200) {
try {
var _response = json.decode(response.body);
print(_response);
return response.body;
} catch (e) {
// display error toast
return '';
}
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.get(Uri.parse(getAllDeliverboyUrl + '/' + healthpharmaIdsign),
headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return response.body;
} else {
return "";
}
} else {
return "";
}
} else {
return "";
}
}
static Future<bool> updateDeliveryboy(phone, payload) async {
var uri = Uri.parse(updateDeliveryboyUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'phone=$phone');
try {
var response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else if (response.statusCode == 401) {
bool status = await AppSettings.resetToken();
if (status) {
response = await http.put(uri,
body: json.encode(payload), headers: await buildRequestHeaders());
if (response.statusCode == 200) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
} catch (e) {
print(e);
return false;
}
}
static Future<bool> deleteDeliveryboy(phone) async {
var uri = Uri.parse(deleteDeliveryboyUrl + '/' + healthpharmaIdsign);
uri = uri.replace(query: 'phone=$phone');
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<String> getPharmacyAccounts() async {
var uri = Uri.parse(getPharmacyAccountsUrl + '/' + 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 '';
}
}
/*Apis ends here*/ /*Apis ends here*/
//save data local //save data local
@ -1001,6 +1270,8 @@ class AppSettings {
await saveData('pharmacyname', input['simplydata']['pharmacyname'], 'STRING'); await saveData('pharmacyname', input['simplydata']['pharmacyname'], 'STRING');
await saveData('phone', input['simplydata']['phone'], 'STRING'); await saveData('phone', input['simplydata']['phone'], 'STRING');
await saveData('email', input['simplydata']['email'][0]['email'], 'STRING'); await saveData('email', input['simplydata']['email'][0]['email'], 'STRING');
await saveData('description', input['simplydata']['description'], 'STRING');
await saveData( await saveData(
'access_token', input['simplydata']['access_token'], 'STRING'); 'access_token', input['simplydata']['access_token'], 'STRING');
await saveData('pharmacyId', input['simplydata']['pharmacyId'], 'STRING'); await saveData('pharmacyId', input['simplydata']['pharmacyId'], 'STRING');
@ -1017,6 +1288,7 @@ 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('description', image.toString(), 'STRING');
await saveData('offer', image.toString(), 'STRING'); await saveData('offer', image.toString(), 'STRING');
//await loadDataFromMemory(); //await loadDataFromMemory();
@ -1030,6 +1302,7 @@ class AppSettings {
pharmacyName = await getData('pharmacyname', 'STRING'); pharmacyName = await getData('pharmacyname', 'STRING');
accessToken = await getData('access_token', 'STRING'); accessToken = await getData('access_token', 'STRING');
email = await getData('email', 'STRING'); email = await getData('email', 'STRING');
pharmacyName = await getData('description', 'STRING');
userAddress = await getData('user_address', 'STRING'); userAddress = await getData('user_address', 'STRING');
phoneNumber = await getData('phone', 'STRING'); phoneNumber = await getData('phone', 'STRING');
healthpharmaIdsign = await getData('pharmacyId', 'STRING'); healthpharmaIdsign = await getData('pharmacyId', 'STRING');
@ -1052,20 +1325,7 @@ class AppSettings {
fontSize: 16.0); fontSize: 16.0);
}*/ }*/
static void longFailedStyledToast(String message, context) {
showToast(
message,
context: context,
animation: StyledToastAnimation.scale,
reverseAnimation: StyledToastAnimation.fade,
position: StyledToastPosition.bottom,
animDuration: Duration(seconds: 1),
duration: Duration(seconds: 6),
curve: Curves.elasticOut,
reverseCurve: Curves.linear,
backgroundColor: Colors.red,
);
}
static void longFailedToast(String message) { static void longFailedToast(String message) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: message, msg: message,

@ -51,6 +51,12 @@ class _SignUpState extends State<SignUp> {
String country = ''; String country = '';
double lat=0; double lat=0;
double lng=0; double lng=0;
String dropdownTypeOfPlans = 'Red';
var typeOfCategoryPlans = [
'Red',
'Blue',
'Green',
];
@ -217,6 +223,41 @@ class _SignUpState extends State<SignUp> {
), ),
), ),
SizedBox(
height: 10,
),
Container(
padding: const EdgeInsets.fromLTRB(10, 10, 10, 0),
child: DropdownButtonFormField(
// Initial Value
value: dropdownTypeOfPlans,
isExpanded: true,
decoration: textFormFieldDecoration(Icons.next_plan_outlined,'Type of plan'),
hint: Text('Select Type of water'),
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: typeOfCategoryPlans.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
dropdownTypeOfPlans = newValue!;
});
},
),
),
SizedBox(
height: 10,
),
GestureDetector( GestureDetector(
child: Container( child: Container(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
@ -454,6 +495,7 @@ class _SignUpState extends State<SignUp> {
payload["zip"] = zip; payload["zip"] = zip;
payload["country"] = country; payload["country"] = country;
payload["description"] = ''; payload["description"] = '';
payload["plan"] = dropdownTypeOfPlans.toString();
payload["latitude"] = lat; payload["latitude"] = lat;
payload["longitude"] = lng; payload["longitude"] = lng;
payload["fcmId"] = AppSettings.fcmId; payload["fcmId"] = AppSettings.fcmId;

@ -111,7 +111,8 @@ class _UpdateprofileState extends State<UpdateProfile> {
image: AssetImage('images/logo.png'), image: AssetImage('images/logo.png'),
height: MediaQuery.of(context).size.height * .10, height: MediaQuery.of(context).size.height * .10,
)),*/ )),*/
Container(child: GestureDetector( Container(child:
GestureDetector(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * .60, width: MediaQuery.of(context).size.width * .60,
height: MediaQuery.of(context).size.height * .15, height: MediaQuery.of(context).size.height * .15,
@ -163,6 +164,7 @@ class _UpdateprofileState extends State<UpdateProfile> {
), ),
); );
}); });
}, },
),), ),),
SizedBox( SizedBox(
@ -306,23 +308,7 @@ class _UpdateprofileState extends State<UpdateProfile> {
context, context,
MaterialPageRoute(builder: (context) => Dashboard()), MaterialPageRoute(builder: (context) => Dashboard()),
); );
/* try{
if (signUpStatus) {
Navigator.pop(context);
AppSettings.longSuccessToast("Pharmacy Profile Updated !!");
Navigator.push(
context,
MaterialPageRoute(builder: (context) => Dashboard()),
);
} else {
//AppSettings.longFailedToast("Pharmacy Profile Not Updated !!");
}
}
catch(exception){
print(exception);
AppSettings.longFailedToast("Please enter valid details");
}*/
}, },
child: Text('Update'), child: Text('Update'),
) )

@ -0,0 +1,966 @@
import 'dart:convert';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:healthcare_pharmacy/ZoomedImageView.dart';
import 'package:healthcare_pharmacy/models/offersview_model.dart';
import 'package:healthcare_pharmacy/offerstabdata.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:intl/intl.dart';
import 'package:image_picker/image_picker.dart';
import 'package:photo_view/photo_view.dart';
import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart';
class Viewpager extends StatefulWidget {
List<GetOffersDetailsModel> userdata;
int position;
Viewpager(this.userdata, this.position);
@override
State<Viewpager> createState() => _ViewpagerState();
}
class _ViewpagerState extends State<Viewpager> {
late PageController _pageController;
int _currentPageIndex = 0;
String selectedOption = 'Option 1';
bool isActiveDataLoading=false;
bool isSereverIssue = false;
bool isSereverIssueConnected = false;
bool isSereverIssuePending = false;
bool switchValue = false;
TextEditingController updateOfferNameController = TextEditingController();
TextEditingController updateOfferCodeController = TextEditingController();
TextEditingController updateOfferDescriptionController = TextEditingController();
TextEditingController updateDiscountController = TextEditingController();
TextEditingController updateOfferStartDateController = TextEditingController();
TextEditingController updateOfferEndDateController = TextEditingController();
String dropdownTypeOfCategory = 'A {1 - 500}';
var typeOfCategoryItems = [
'A {1 - 500}',
'B {501 - 1000}',
'C {1001 - 2000}',
'D {Above 2000}',
'S {Special offer}',
];
List updateCategoryTypes = [];
var startdate;
var enddate;
String updateofferUrl='';
final ImagePicker _picker = ImagePicker();
List<GetOffersDetailsModel> activeOffersList = [];
Future pickImageFromGallery(var offerCode) 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.offerupdateuploadImageHTTPNew(image, offerCode);
print(jsonDecode(res));
setState(() {
updateofferUrl = jsonDecode(res)['picture'][0]['url'];
print("update url: $updateofferUrl");
});
Navigator.of(context, rootNavigator: true).pop();
if(res.contains("error")){
return 'some thing went wrong please try again';
}
else{
return jsonDecode(res)['picture'][0]['url'];
}
} on PlatformException catch (e) {
print('Failed to pick image: $e');
return 'some thing went wrong please try again';
}
}
Future<String> takeImageFromCamera(String offerCode) 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.offerupdateuploadImageHTTPNew(image, offerCode);
print(jsonDecode(res));
setState(() {
updateofferUrl = jsonDecode(res)['picture'][0]['url'];
print("update url: $updateofferUrl");
});
Navigator.of(context, rootNavigator: true).pop();
if(res.contains("error")){
return 'some thing went wrong please try again';
}
else{
return jsonDecode(res)['picture'][0]['url'];
}
} on PlatformException catch (e) {
print('Failed to pick image: $e');
return 'some thing went wrong please try again';
}
}
showUpdateOfferDialog(GetOffersDetailsModel object, int index) async {
updateOfferNameController.text = object.offer_name!;
updateOfferCodeController.text = object.offer_code!;
updateOfferDescriptionController.text = object.description!;
updateOfferStartDateController.text=object.starting_date!;
updateOfferEndDateController.text=object.ending_date!;
updateofferUrl=object.picture[0].url;
return showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
var data=activeOffersList[index];
print("result$updateofferUrl");
return AlertDialog(
title: const Text('Update Offer'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
// ImageView
InkWell(
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(object.offer_code!).then((value) {
print("datatatttta$value");
setState(() {
updateofferUrl = value;
// print(updateofferUrl);
});
});
Navigator.pop(context);
},
),
SizedBox(
width:
MediaQuery.of(context).size.width * .20,
),
GestureDetector(
child: Icon(
Icons.photo,
size: 100,
color: primaryColor,
),
onTap: () async {
await pickImageFromGallery(object.offer_code).then((value) {
print("datatatttta$value");
setState(() {
updateofferUrl = value;
// print(updateofferUrl);
});
});;
Navigator.pop(context);
},
),
],
),
),
);
});
},
child: Container(
width: MediaQuery.of(context).size.width,
height: 150,
child: updateofferUrl.isEmpty
? Image.network(
"https://assets.aboutamazon.com/dims4/default/1db03c8/2147483647/strip/false/crop/2000x1125+0+0/resize/1200x675!/quality/90/?url=https%3A%2F%2Famazon-blogs-brightspot.s3.amazonaws.com%2Fa3%2Fc2%2F5c0b93db41d789be1bec015003bd%2Fpharmacy-hero-2000x1125.jpg",
fit: BoxFit.cover,
)
: Image.network(
updateofferUrl,
fit: BoxFit.cover,
),
),
),
const SizedBox(
height: 20,
),
// Offer Name
Container(
padding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
child: TextFormField(
cursorColor: greyColor,
controller: updateOfferNameController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.person,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Offer name',
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,
controller: updateOfferCodeController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.numbers,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Offer Code',
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,
controller: updateOfferDescriptionController,
textCapitalization: TextCapitalization.words,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.description,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Offer Description',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
), //tanker name
),
const SizedBox(
height: 30,
),
Container(
child: DropdownButtonFormField(
// Initial Value
value: dropdownTypeOfCategory,
isExpanded: true,
decoration: const InputDecoration(
prefixIcon: Icon(
Icons.type_specimen,
color: primaryColor,
),
border: OutlineInputBorder(
borderSide: BorderSide(color: greyColor)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: greyColor),
),
labelText: 'Type of category',
labelStyle: TextStyle(
color: greyColor, //<-- SEE HERE
),
),
hint: Text('Select Type of category'),
// Down Arrow Icon
icon: const Icon(Icons.keyboard_arrow_down),
// Array list of items
items: typeOfCategoryItems.map((String items) {
return DropdownMenuItem(
value: items,
child: Text(items),
);
}).toList(),
// After selecting the desired option,it will
// change button value to selected value
onChanged: (String? newValue) {
setState(() {
dropdownTypeOfCategory = newValue!;
});
},
),
),
const SizedBox(
height: 20,
),
Container(
child: TextFormField(
readOnly: true,
cursorColor: greyColor,
controller: updateOfferStartDateController,
decoration: InputDecoration(
labelText: 'Select Start Date',
prefixIcon: IconButton(
icon: Icon(
Icons.date_range,
color: primaryColor,
),
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(() {
startdate = DateFormat('dd-MMM-yyyy').format(selectdate);
});
if(startdate!=''){
setState(() {
updateOfferStartDateController.text=startdate.toString();
});
}
else {
AppSettings.longFailedToast('Select start date');
}
},
);
},
),
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),
),
),
),
),
const SizedBox(
height: 20,
),
Container(
child: TextFormField(
readOnly: true,
cursorColor: greyColor,
controller: updateOfferEndDateController,
decoration: InputDecoration(
labelText: 'Select end Date',
prefixIcon: IconButton(
icon: Icon(
Icons.date_range,
color: primaryColor,
),
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(() {
enddate = DateFormat('dd-MMM-yyyy').format(selectdate);
});
if(enddate!=''){
setState(() {
updateOfferEndDateController.text=enddate.toString();
});
}
else {
AppSettings.longFailedToast('Select end date');
}
},
);
},
),
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),
),
),
),
),//address description
const SizedBox(
height: 30,
),
],
),
),
actions: <Widget>[
TextButton(
child: Text('Cancel', style: textButtonStyle()),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: Text('Update', style: textButtonStyle()),
onPressed: () async {
if (updateOfferNameController.text != '' ) {
AppSettings.preLoaderDialog(context);
Map<String, dynamic> payload = {
"offer_name": updateOfferNameController.text.toString(),
"offer_code": updateOfferCodeController.text.toString(),
"description":updateOfferDescriptionController.text.toString(),
"category":dropdownTypeOfCategory.toString(),
"starting_date":updateOfferStartDateController.text.toString(),
"ending_date": updateOfferEndDateController.text.toString(),
"picture": [
{
"url":updateofferUrl
}
],
"offer_status": "active",
};
bool offerStatus = await AppSettings.updateOffers(object.offer_code, payload);
try {
if (offerStatus) {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longSuccessToast(
"Offer Updated Successfully");
updateOfferNameController.text = '';
updateOfferCodeController.text = '';
updateOfferDescriptionController.text = '';
updateOfferStartDateController.text = '';
updateOfferEndDateController.text = '';
await getActiveOffersViewData();
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const OffersData()),
);
} else {
Navigator.of(context, rootNavigator: true).pop();
AppSettings.longFailedToast(
"Offer upadtion failed");
Navigator.of(context).pop();
}
} catch (exception) {
Navigator.of(context).pop();
print(exception);
}
} else {
AppSettings.longFailedToast("enter details");
}
},
),
],
);
},
);
},
);
}
Future<void> getActiveOffersViewData() async {
isActiveDataLoading = true;
try {
var data = await AppSettings.getOffers();
setState(() {
List<dynamic> responseData = jsonDecode(data)['data'];
activeOffersList = responseData
.map((jsonObject) => GetOffersDetailsModel.fromJson(jsonObject))
.toList();
isActiveDataLoading = false;
});
} catch (error) {
setState(() {
isActiveDataLoading = false;
isSereverIssueConnected = true;
});
}
}
@override
void initState() {
super.initState();
getActiveOffersViewData();
_pageController = PageController(initialPage: widget.position);
}
void removeItem(int index) {
setState(() {
widget.userdata.removeAt(index);
if (_currentPageIndex > 0) {
_currentPageIndex--;
}
});
_pageController = PageController(initialPage: _currentPageIndex);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Offers Details'),
backgroundColor: primaryColor,
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () async {
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const OffersData()),
);
},
),
),
body: PageView.builder(
controller: _pageController,
itemCount: widget.userdata.length,
onPageChanged: (int index) {
setState(() {
_currentPageIndex = index;
});
},
itemBuilder: (BuildContext context, int index) {
var object = widget.userdata[index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
children: [
Container(
width: MediaQuery.of(context).size.width, // Set width to screen width
height: 350, // Set your desired height
child: GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ZoomedImageView(
imageUrl: widget.userdata[index].picture.isEmpty
? "https://assets.aboutamazon.com/dims4/default/1db03c8/2147483647/strip/false/crop/2000x1125+0+0/resize/1200x675!/quality/90/?url=https%3A%2F%2Famazon-blogs-brightspot.s3.amazonaws.com%2Fa3%2Fc2%2F5c0b93db41d789be1bec015003bd%2Fpharmacy-hero-2000x1125.jpg"
: widget.userdata[index].picture[0].url,
),
),
);
},
child: widget.userdata[index].picture.isEmpty
? Image.network(
"https://assets.aboutamazon.com/dims4/default/1db03c8/2147483647/strip/false/crop/2000x1125+0+0/resize/1200x675!/quality/90/?url=https%3A%2F%2Famazon-blogs-brightspot.s3.amazonaws.com%2Fa3%2Fc2%2F5c0b93db41d789be1bec015003bd%2Fpharmacy-hero-2000x1125.jpg",
fit: BoxFit.cover,
)
: Image.network(
widget.userdata[index].picture[0].url,
fit: BoxFit.cover,
),
),
),
Positioned(
left: 5.0, // Adjust this value as needed
top: MediaQuery.of(context).size.height / 5 - 16.0, // Center vertically
child: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.white),
onPressed: () {
if (_pageController.page! > 0) {
_pageController.previousPage(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}
},
),
),
Positioned(
right: 5.0, // Adjust this value as needed
top: MediaQuery.of(context).size.height / 5 - 16.0, // Center vertically
child: IconButton(
icon: Icon(Icons.arrow_forward_ios, color: Colors.white),
onPressed: () {
if (_pageController.page! < widget.userdata.length - 1) {
_pageController.nextPage(
duration: Duration(milliseconds: 300),
curve: Curves.easeInOut,
);
}
},
),
),
],
),
const SizedBox(
height: 10,
),
Padding(
padding: EdgeInsets.only(left: 16.0), // Add left padding to all RichText widgets
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Name: ',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: widget.userdata[index].offer_name,
style: TextStyle(
color: primaryColor,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
const SizedBox(
height: 5,
),
Padding(
padding: EdgeInsets.only(left: 16.0), // Add left padding to all RichText widgets
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Code: ',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: widget.userdata[index].offer_code,
style: TextStyle(
color: primaryColor,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
const SizedBox(
height: 5,
),
Padding(
padding: EdgeInsets.only(left: 16.0), // Add left padding to all RichText widgets
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Description: ',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: widget.userdata[index].description ?? "",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: primaryColor,
),
),
],
),
),
),
const SizedBox(
height: 5,
),
Padding(
padding: EdgeInsets.only(left: 16.0), // Add left padding to all RichText widgets
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'Category: ',
style: TextStyle(
color: Colors.black,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: widget.userdata[index].category ?? "",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: primaryColor,
),
),
],
),
),
),
const SizedBox(
height: 5,
),
Padding(
padding: EdgeInsets.only(left: 16.0), // Add left padding to all RichText widgets
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'StartDate: ',
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: widget.userdata[index].starting_date ?? "",
style: TextStyle(
color: primaryColor,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
const SizedBox(
height: 5,
),
Padding(
padding: EdgeInsets.only(left: 16.0), // Add left padding to all RichText widgets
child: RichText(
text: TextSpan(
style: DefaultTextStyle.of(context).style,
children: <TextSpan>[
TextSpan(
text: 'EndDate: ',
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: widget.userdata[index].ending_date ?? "",
style: TextStyle(
color: primaryColor,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
],
),
),
),
const SizedBox(
height: 15,
),
Padding(
padding: EdgeInsets.only(left: 16.0), // Add left padding
child: Row(
children: [
Switch(
value: false,
onChanged: (value) {
setState(() {
switchValue = value;
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Are you sure you want to in_active this Offer?',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [
TextButton(
onPressed: () async {
// Perform the action
print("offercode${widget.userdata[index].offer_code}");
bool deleteOfferStatus =
await AppSettings.deleteOffers(
widget.userdata[index].offer_code);
if(deleteOfferStatus){
widget.userdata.remove(widget.userdata[index]);
switchValue=false;
}
else{
switchValue=false;
}
await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const OffersData()),
); // Close the dialog
},
child: const Text('Yes',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(false);
},
child: const Text('No',
style: TextStyle(
color: primaryColor,
fontSize: 20,
)),
),
],
);
},
);
});
},
),
const SizedBox(
width: 100,
),
IconButton(
icon: Icon(Icons.edit),
onPressed: () {
showUpdateOfferDialog(object, index);
},
),
],
),
),
],
);
},
),
);
}
}

@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import 'package:healthcare_pharmacy/settings.dart';
import 'package:photo_view/photo_view.dart';
class ZoomableImage extends StatelessWidget {
final String imageUrl;
ZoomableImage(this.imageUrl);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: primaryColor, // Set the background color
title: Text('Preview Image'), // Set the title text
actions: [
IconButton(
icon: Icon(Icons.close),
onPressed: () {
Navigator.pop(context);
},
),
],
),
body: Center(
child: imageUrl.isNotEmpty
? PhotoView(
imageProvider: NetworkImage(imageUrl),
minScale: PhotoViewComputedScale.contained,
maxScale: PhotoViewComputedScale.contained * 3.0,
)
: Image.asset(
'images/mobilebg.png', // Path to your default image
fit: BoxFit.cover,
),
),
);
}
}

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

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

@ -5,26 +5,34 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import agora_rtc_engine
import cloud_firestore import cloud_firestore
import device_info_plus_macos import device_info_plus_macos
import file_selector_macos
import firebase_core import firebase_core
import firebase_messaging import firebase_messaging
import firebase_storage
import flutter_local_notifications import flutter_local_notifications
import geolocator_apple import geolocator_apple
import location import location
import package_info_plus_macos import package_info_plus_macos
import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AgoraRtcEnginePlugin.register(with: registry.registrar(forPlugin: "AgoraRtcEnginePlugin"))
FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin"))
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
FLTFirebaseStoragePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseStoragePlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
} }

@ -7,14 +7,21 @@ packages:
name: _flutterfire_internals name: _flutterfire_internals
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.2" version: "1.3.16"
agora_rtc_engine:
dependency: "direct main"
description:
name: agora_rtc_engine
url: "https://pub.dartlang.org"
source: hosted
version: "5.3.1"
archive: archive:
dependency: transitive dependency: transitive
description: description:
name: archive name: archive
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.3.7" version: "3.4.2"
args: args:
dependency: transitive dependency: transitive
description: description:
@ -79,26 +86,26 @@ packages:
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
cloud_firestore: cloud_firestore:
dependency: "direct dev" dependency: "direct main"
description: description:
name: cloud_firestore name: cloud_firestore
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.8.0" version: "4.14.0"
cloud_firestore_platform_interface: cloud_firestore_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: cloud_firestore_platform_interface name: cloud_firestore_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.15.0" version: "6.1.0"
cloud_firestore_web: cloud_firestore_web:
dependency: transitive dependency: transitive
description: description:
name: cloud_firestore_web name: cloud_firestore_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.6.0" version: "3.9.0"
cloudinary_public: cloudinary_public:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -161,7 +168,7 @@ packages:
name: dbus name: dbus
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.7.3" version: "0.7.4"
device_info_plus: device_info_plus:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -217,7 +224,7 @@ packages:
name: dio name: dio
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.2.0+1" version: "5.4.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -239,53 +246,116 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.4" version: "6.1.4"
firebase_core: file_selector_linux:
dependency: transitive
description:
name: file_selector_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.2"
file_selector_macos:
dependency: transitive
description:
name: file_selector_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.3+1"
file_selector_platform_interface:
dependency: transitive
description:
name: file_selector_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.0"
file_selector_windows:
dependency: transitive dependency: transitive
description:
name: file_selector_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.3"
firebase_core:
dependency: "direct main"
description: description:
name: firebase_core name: firebase_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.13.1" version: "2.24.2"
firebase_core_platform_interface: firebase_core_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: firebase_core_platform_interface name: firebase_core_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.8.0" version: "5.0.0"
firebase_core_web: firebase_core_web:
dependency: transitive dependency: transitive
description: description:
name: firebase_core_web name: firebase_core_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.0" version: "2.10.0"
firebase_messaging: firebase_messaging:
dependency: "direct dev" dependency: "direct main"
description: description:
name: firebase_messaging name: firebase_messaging
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "14.6.2" version: "14.7.10"
firebase_messaging_platform_interface: firebase_messaging_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: firebase_messaging_platform_interface name: firebase_messaging_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.5.2" version: "4.5.18"
firebase_messaging_web: firebase_messaging_web:
dependency: transitive dependency: transitive
description: description:
name: firebase_messaging_web name: firebase_messaging_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.2" version: "3.5.18"
firebase_storage:
dependency: "direct main"
description:
name: firebase_storage
url: "https://pub.dartlang.org"
source: hosted
version: "11.6.0"
firebase_storage_platform_interface:
dependency: transitive
description:
name: firebase_storage_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.3"
firebase_storage_web:
dependency: transitive
description:
name: firebase_storage_web
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.17"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_barcode_scanner:
dependency: "direct dev"
description:
name: flutter_barcode_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_callkeep:
dependency: "direct main"
description:
name: flutter_callkeep
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.2"
flutter_cupertino_datetime_picker: flutter_cupertino_datetime_picker:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -320,9 +390,9 @@ packages:
name: flutter_lints name: flutter_lints
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.2"
flutter_local_notifications: flutter_local_notifications:
dependency: "direct dev" dependency: "direct main"
description: description:
name: flutter_local_notifications name: flutter_local_notifications
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -342,11 +412,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.0.0" version: "5.0.0"
flutter_localizations: flutter_native_contact_picker:
dependency: transitive dependency: "direct dev"
description: flutter description:
source: sdk name: flutter_native_contact_picker
version: "0.0.0" url: "https://pub.dartlang.org"
source: hosted
version: "0.0.6"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
@ -361,20 +433,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
flutter_styled_toast: flutter_share:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_styled_toast name: flutter_share
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.3" version: "2.0.0"
flutter_svg: flutter_svg:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_svg name: flutter_svg
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.3" version: "1.1.6"
flutter_svg_provider: flutter_svg_provider:
dependency: "direct main" dependency: "direct main"
description: description:
@ -398,28 +470,35 @@ packages:
name: fluttertoast name: fluttertoast
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "8.2.2" version: "8.2.4"
gallery_saver:
dependency: "direct dev"
description:
name: gallery_saver
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.2"
geocoding: geocoding:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: geocoding name: geocoding
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
geocoding_android: geocoding_android:
dependency: transitive dependency: transitive
description: description:
name: geocoding_android name: geocoding_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.2"
geocoding_ios: geocoding_ios:
dependency: transitive dependency: transitive
description: description:
name: geocoding_ios name: geocoding_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.1.1"
geocoding_platform_interface: geocoding_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -440,35 +519,35 @@ packages:
name: geolocator_android name: geolocator_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.8" version: "4.3.1"
geolocator_apple: geolocator_apple:
dependency: transitive dependency: transitive
description: description:
name: geolocator_apple name: geolocator_apple
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.6" version: "2.3.5"
geolocator_platform_interface: geolocator_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: geolocator_platform_interface name: geolocator_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.7" version: "4.1.0"
geolocator_web: geolocator_web:
dependency: transitive dependency: transitive
description: description:
name: geolocator_web name: geolocator_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.6" version: "2.2.1"
geolocator_windows: geolocator_windows:
dependency: transitive dependency: transitive
description: description:
name: geolocator_windows name: geolocator_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.1" version: "0.1.3"
get: get:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -503,7 +582,7 @@ packages:
name: google_maps_flutter_android name: google_maps_flutter_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.15" version: "2.4.16"
google_maps_flutter_ios: google_maps_flutter_ios:
dependency: transitive dependency: transitive
description: description:
@ -517,14 +596,14 @@ packages:
name: google_maps_flutter_platform_interface name: google_maps_flutter_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.7" version: "2.4.0"
google_maps_flutter_web: google_maps_flutter_web:
dependency: transitive dependency: transitive
description: description:
name: google_maps_flutter_web name: google_maps_flutter_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.0+1" version: "0.5.3"
google_maps_place_picker_mb: google_maps_place_picker_mb:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -561,54 +640,68 @@ packages:
source: hosted source: hosted
version: "4.0.2" version: "4.0.2"
image: image:
dependency: transitive dependency: "direct main"
description: description:
name: image name: image
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.3" version: "3.3.0"
image_picker: image_picker:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.7+5" version: "0.8.9"
image_picker_android: image_picker_android:
dependency: transitive dependency: transitive
description: description:
name: image_picker_android name: image_picker_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.6+19" version: "0.8.7+4"
image_picker_for_web: image_picker_for_web:
dependency: transitive dependency: transitive
description: description:
name: image_picker_for_web name: image_picker_for_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.12" version: "2.2.0"
image_picker_ios: image_picker_ios:
dependency: transitive dependency: transitive
description: description:
name: image_picker_ios name: image_picker_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.8.7+4" version: "0.8.8"
image_picker_linux:
dependency: transitive
description:
name: image_picker_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
image_picker_macos:
dependency: transitive
description:
name: image_picker_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.1"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: image_picker_platform_interface name: image_picker_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.6.4" version: "2.9.0"
imei_plugin: image_picker_windows:
dependency: "direct dev" dependency: transitive
description: description:
name: imei_plugin name: image_picker_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "0.2.1"
intl: intl:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -686,6 +779,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
nested: nested:
dependency: transitive dependency: transitive
description: description:
@ -743,7 +843,7 @@ packages:
source: hosted source: hosted
version: "1.0.5" version: "1.0.5"
path: path:
dependency: transitive dependency: "direct dev"
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -763,20 +863,41 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.1"
path_provider:
dependency: "direct dev"
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.15"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
name: path_provider_linux name: path_provider_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.11" version: "2.2.0"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: path_provider_platform_interface name: path_provider_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.6" version: "2.1.0"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
@ -785,40 +906,40 @@ packages:
source: hosted source: hosted
version: "2.0.7" version: "2.0.7"
permission_handler: permission_handler:
dependency: "direct dev" dependency: "direct main"
description: description:
name: permission_handler name: permission_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "10.3.0" version: "10.4.5"
permission_handler_android: permission_handler_android:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_android name: permission_handler_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "10.2.3" version: "10.3.6"
permission_handler_apple: permission_handler_apple:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_apple name: permission_handler_apple
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "9.1.0" version: "9.1.4"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.10.0" version: "3.12.0"
permission_handler_windows: permission_handler_windows:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_windows name: permission_handler_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.2" version: "0.1.3"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -839,14 +960,14 @@ packages:
name: platform name: platform
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.0" version: "3.1.1"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.5"
pointycastle: pointycastle:
dependency: transitive dependency: transitive
description: description:
@ -867,7 +988,35 @@ packages:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.5" version: "6.1.1"
pull_to_refresh:
dependency: "direct dev"
description:
name: pull_to_refresh
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
qr:
dependency: transitive
description:
name: qr
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
qr_code_scanner:
dependency: "direct dev"
description:
name: qr_code_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
qr_flutter:
dependency: "direct dev"
description:
name: qr_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
quantity_input: quantity_input:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -881,56 +1030,63 @@ packages:
name: sanitize_html name: sanitize_html
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.1.0"
share:
dependency: "direct dev"
description:
name: share
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.4"
shared_preferences: shared_preferences:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.2.0"
shared_preferences_android: shared_preferences_android:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_android name: shared_preferences_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.2.0"
shared_preferences_foundation: shared_preferences_foundation:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_foundation name: shared_preferences_foundation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.2" version: "2.3.3"
shared_preferences_linux: shared_preferences_linux:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_linux name: shared_preferences_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
shared_preferences_platform_interface: shared_preferences_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_platform_interface name: shared_preferences_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
shared_preferences_web: shared_preferences_web:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_web name: shared_preferences_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.0" version: "2.2.0"
shared_preferences_windows: shared_preferences_windows:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_windows name: shared_preferences_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.3.0"
sizer: sizer:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -1005,7 +1161,7 @@ packages:
name: tuple name: tuple
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.1" version: "2.0.2"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -1021,7 +1177,7 @@ packages:
source: hosted source: hosted
version: "2.2.0" version: "2.2.0"
url_launcher: url_launcher:
dependency: "direct dev" dependency: "direct main"
description: description:
name: url_launcher name: url_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
@ -1033,7 +1189,7 @@ packages:
name: url_launcher_android name: url_launcher_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.35" version: "6.0.38"
url_launcher_ios: url_launcher_ios:
dependency: transitive dependency: transitive
description: description:
@ -1054,28 +1210,28 @@ packages:
name: url_launcher_macos name: url_launcher_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.5" version: "3.0.6"
url_launcher_platform_interface: url_launcher_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_platform_interface name: url_launcher_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.3"
url_launcher_web: url_launcher_web:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_web name: url_launcher_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.17" version: "2.0.18"
url_launcher_windows: url_launcher_windows:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_windows name: url_launcher_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.6" version: "3.0.7"
uuid: uuid:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1090,6 +1246,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.2"
visibility_detector:
dependency: "direct dev"
description:
name: visibility_detector
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.0+2"
web_socket_channel:
dependency: "direct main"
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
win32: win32:
dependency: transitive dependency: transitive
description: description:
@ -1110,7 +1280,7 @@ packages:
name: xml name: xml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.4.1" version: "6.1.0"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:

@ -10,12 +10,18 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
firebase_core: ^2.24.2
web_socket_channel:
flutter_callkeep:
url_launcher: ^6.0.10
firebase_messaging: ^14.4.1
flutter_local_notifications: ^9.0.2
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
location: ^4.4.0 location: ^4.4.0
geolocator: ^9.0.2 geolocator: ^9.0.2
google_api_headers: ^1.2.0 google_api_headers: ^1.2.0
google_maps_flutter: ^2.2.3 google_maps_flutter: ^2.2.3
image: ^3.0.1
google_maps_webservice: ^0.0.20-nullsafety.5 google_maps_webservice: ^0.0.20-nullsafety.5
http: ^0.13.5 http: ^0.13.5
provider: ^6.0.5 provider: ^6.0.5
@ -23,22 +29,28 @@ dependencies:
uuid: ^3.0.7 uuid: ^3.0.7
flutter_svg_provider: ^1.0.3 flutter_svg_provider: ^1.0.3
flutter_svg: ^1.0.1 flutter_svg: ^1.0.1
agora_rtc_engine: ^5.3.1
permission_handler:
cloud_firestore:
firebase_storage:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^2.0.0 flutter_lints: ^2.0.0
http: ^0.13.5 http: ^0.13.5
quantity_input: ^1.0.2
shared_preferences: ^2.0.15 shared_preferences: ^2.0.15
sizer: ^2.0.11 sizer: ^2.0.11
geolocator: ^9.0.2 geolocator: ^9.0.2
geocoding: ^2.0.4 geocoding: ^2.0.4
image_picker: ^0.8.6+1 image_picker: ^0.8.6+1
gallery_saver: ^2.0.3
flutter_launcher_icons: ^0.11.0 flutter_launcher_icons: ^0.11.0
url_launcher: ^6.1.9 url_launcher: ^6.1.9
intl: ^0.17.0 intl: ^0.17.0
flutter_svg: ^1.0.1 flutter_svg: ^1.0.1
flutter_styled_toast: ^2.1.3
google_maps_place_picker_mb: ^2.0.0-mb.22 google_maps_place_picker_mb: ^2.0.0-mb.22
flutter_datetime_picker: ^1.5.1 flutter_datetime_picker: ^1.5.1
date_time_picker: ^2.1.0 date_time_picker: ^2.1.0
@ -48,7 +60,6 @@ dev_dependencies:
flutter_local_notifications: ^9.0.2 flutter_local_notifications: ^9.0.2
cloud_firestore: ^4.5.2 cloud_firestore: ^4.5.2
flutter_device_type: ^0.4.0 flutter_device_type: ^0.4.0
imei_plugin: ^1.2.0
device_information: ^0.0.4 device_information: ^0.0.4
device_info_plus: ^3.2.4 device_info_plus: ^3.2.4
overlay_support: ^2.1.0 overlay_support: ^2.1.0
@ -62,7 +73,16 @@ 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_native_contact_picker: ^0.0.4
path: ^1.8.0
path_provider: ^2.0.11
visibility_detector: ^0.4.0+2
flutter_share: ^2.0.0
share: ^2.0.4
qr_flutter: ^4.0.0
qr_code_scanner: ^1.0.1
flutter_barcode_scanner: ^2.0.0
pull_to_refresh: ^2.0.0
flutter_icons: flutter_icons:

@ -6,14 +6,26 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <agora_rtc_engine/agora_rtc_engine_plugin.h>
#include <cloud_firestore/cloud_firestore_plugin_c_api.h>
#include <file_selector_windows/file_selector_windows.h>
#include <firebase_core/firebase_core_plugin_c_api.h> #include <firebase_core/firebase_core_plugin_c_api.h>
#include <firebase_storage/firebase_storage_plugin_c_api.h>
#include <geolocator_windows/geolocator_windows.h> #include <geolocator_windows/geolocator_windows.h>
#include <permission_handler_windows/permission_handler_windows_plugin.h> #include <permission_handler_windows/permission_handler_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h> #include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
AgoraRtcEnginePluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AgoraRtcEnginePlugin"));
CloudFirestorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("CloudFirestorePluginCApi"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FirebaseCorePluginCApiRegisterWithRegistrar( FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FirebaseStoragePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseStoragePluginCApi"));
GeolocatorWindowsRegisterWithRegistrar( GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows")); registry->GetRegistrarForPlugin("GeolocatorWindows"));
PermissionHandlerWindowsPluginRegisterWithRegistrar( PermissionHandlerWindowsPluginRegisterWithRegistrar(

@ -3,7 +3,11 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
agora_rtc_engine
cloud_firestore
file_selector_windows
firebase_core firebase_core
firebase_storage
geolocator_windows geolocator_windows
permission_handler_windows permission_handler_windows
url_launcher_windows url_launcher_windows

Loading…
Cancel
Save