final after change app

This commit is contained in:
2025-05-10 13:09:19 +05:30
parent bf7a7a96bd
commit e10f6747c9
21 changed files with 891 additions and 880 deletions

BIN
.DS_Store vendored

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1 @@
3.24.3 3.24.1

View File

@@ -1,63 +1,63 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
connectivity_plus=/Users/apple/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/ connectivity_plus=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/
file_selector_linux=/Users/apple/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2/ file_selector_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2/
file_selector_macos=/Users/apple/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2/ file_selector_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2/
file_selector_windows=/Users/apple/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+3/ file_selector_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+3/
firebase_core=/Users/apple/.pub-cache/hosted/pub.dev/firebase_core-3.13.0/ firebase_core=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_core-3.13.0/
firebase_core_web=/Users/apple/.pub-cache/hosted/pub.dev/firebase_core_web-2.22.0/ firebase_core_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_core_web-2.22.0/
firebase_messaging=/Users/apple/.pub-cache/hosted/pub.dev/firebase_messaging-15.2.5/ firebase_messaging=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_messaging-15.2.5/
firebase_messaging_web=/Users/apple/.pub-cache/hosted/pub.dev/firebase_messaging_web-3.10.5/ firebase_messaging_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_messaging_web-3.10.5/
flutter_inappwebview=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview-6.0.0/ flutter_inappwebview=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview-6.0.0/
flutter_inappwebview_android=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.0.13/ flutter_inappwebview_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.0.13/
flutter_inappwebview_ios=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/ flutter_inappwebview_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/
flutter_inappwebview_macos=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.0.11/ flutter_inappwebview_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.0.11/
flutter_inappwebview_web=/Users/apple/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.0.8/ flutter_inappwebview_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.0.8/
flutter_local_notifications=/Users/apple/.pub-cache/hosted/pub.dev/flutter_local_notifications-18.0.1/ flutter_local_notifications=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_local_notifications-18.0.1/
flutter_local_notifications_linux=/Users/apple/.pub-cache/hosted/pub.dev/flutter_local_notifications_linux-5.0.0/ flutter_local_notifications_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_local_notifications_linux-5.0.0/
flutter_plugin_android_lifecycle=/Users/apple/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.22/ flutter_plugin_android_lifecycle=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.22/
fluttertoast=/Users/apple/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/ fluttertoast=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/
geocoding=/Users/apple/.pub-cache/hosted/pub.dev/geocoding-3.0.0/ geocoding=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding-3.0.0/
geocoding_android=/Users/apple/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/ geocoding_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/
geocoding_ios=/Users/apple/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/ geocoding_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/
geolocator=/Users/apple/.pub-cache/hosted/pub.dev/geolocator-13.0.2/ geolocator=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator-13.0.2/
geolocator_android=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_android-4.6.1/ geolocator_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_android-4.6.1/
geolocator_apple=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/ geolocator_apple=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/
geolocator_web=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/ geolocator_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/
geolocator_windows=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/ geolocator_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/
google_api_headers=/Users/apple/.pub-cache/hosted/pub.dev/google_api_headers-1.6.0/ google_api_headers=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_api_headers-1.6.0/
google_maps_flutter=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter-2.10.0/ google_maps_flutter=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter-2.10.0/
google_maps_flutter_android=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.14.7/ google_maps_flutter_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.14.7/
google_maps_flutter_ios=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.13.2/ google_maps_flutter_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.13.2/
google_maps_flutter_web=/Users/apple/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.10/ google_maps_flutter_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.10/
image_picker=/Users/apple/.pub-cache/hosted/pub.dev/image_picker-1.1.2/ image_picker=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker-1.1.2/
image_picker_android=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+12/ image_picker_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+12/
image_picker_for_web=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6/ image_picker_for_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6/
image_picker_ios=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2/ image_picker_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2/
image_picker_linux=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/ image_picker_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/
image_picker_macos=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2/ image_picker_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2/
image_picker_windows=/Users/apple/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/ image_picker_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/
package_info_plus=/Users/apple/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/ package_info_plus=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/
path_provider=/Users/apple/.pub-cache/hosted/pub.dev/path_provider-2.1.5/ path_provider=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider-2.1.5/
path_provider_android=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/ path_provider_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/
path_provider_foundation=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/ path_provider_foundation=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/
path_provider_linux=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/ path_provider_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/apple/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/ path_provider_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/
permission_handler=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/ permission_handler=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/
permission_handler_android=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.13/ permission_handler_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.13/
permission_handler_apple=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.7/ permission_handler_apple=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.7/
permission_handler_html=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5/ permission_handler_html=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5/
permission_handler_windows=/Users/apple/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/ permission_handler_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/
shared_preferences=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences-2.3.3/ shared_preferences=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences-2.3.3/
shared_preferences_android=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.2/ shared_preferences_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.2/
shared_preferences_foundation=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/ shared_preferences_foundation=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/
shared_preferences_linux=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/ shared_preferences_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/
shared_preferences_web=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/ shared_preferences_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/
shared_preferences_windows=/Users/apple/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/ shared_preferences_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/
sqflite=/Users/apple/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/ sqflite=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/
url_launcher=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher-6.3.1/ url_launcher=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher-6.3.1/
url_launcher_android=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.9/ url_launcher_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.9/
url_launcher_ios=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/ url_launcher_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/
url_launcher_linux=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/ url_launcher_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/
url_launcher_macos=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2/ url_launcher_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2/
url_launcher_web=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.3/ url_launcher_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.3/
url_launcher_windows=/Users/apple/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/ url_launcher_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.4/

File diff suppressed because one or more lines are too long

BIN
android/.DS_Store vendored

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -28,7 +28,9 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async
await Firebase.initializeApp(); await Firebase.initializeApp();
print("💬 Background Message Received: ${message.notification?.title}"); print("💬 Background Message Received: ${message.notification?.title}");
if (message.notification != null) { if (message.notification != null) {
NotificationService.flutterLocalNotificationsPlugin.show( NotificationService.flutterLocalNotificationsPlugin.show(
message.hashCode, message.hashCode,
message.notification!.title, message.notification!.title,
message.notification!.body, message.notification!.body,
@@ -39,6 +41,7 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async
channelDescription: 'Used for important notifications.', channelDescription: 'Used for important notifications.',
importance: Importance.max, importance: Importance.max,
priority: Priority.high, priority: Priority.high,
), ),
), ),
); );

View File

@@ -68,8 +68,9 @@
// }; // };
// } // }
// To parse this JSON data, do
//
// final couponResponse = couponResponseFromJson(jsonString);
// To parse this JSON data, do // To parse this JSON data, do
// //
@@ -77,40 +78,41 @@
import 'dart:convert'; import 'dart:convert';
CouponResponse couponResponseFromJson(String str) => CouponResponse.fromJson(json.decode(str)); CouponResponse couponResponseFromJson(String str) =>
CouponResponse.fromJson(json.decode(str));
String couponResponseToJson(CouponResponse data) => json.encode(data.toJson()); String couponResponseToJson(CouponResponse data) => json.encode(data.toJson());
class CouponResponse { class CouponResponse {
bool? isValid; bool? isValid;
int? originalPrice; double? originalPrice;
int? eligibleSubtotal; double? eligibleSubtotal;
int? discountAmount; dynamic? discountAmount;
int? finalPrice; double? finalPrice;
String? message; String? message;
CouponDetails? couponDetails; CouponDetails? couponDetails;
CouponResponse({ CouponResponse({
this.isValid, this.isValid,
this.originalPrice, this.originalPrice,
this.eligibleSubtotal, this.eligibleSubtotal,
this.discountAmount, this.discountAmount,
this.finalPrice, this.finalPrice,
this.message, this.message,
this.couponDetails, this.couponDetails,
}); });
factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse( factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse(
isValid: json["isValid"], isValid: json["isValid"],
originalPrice: json["originalPrice"], originalPrice: json["originalPrice"].toDouble(),
eligibleSubtotal: json["eligibleSubtotal"], eligibleSubtotal: json["eligibleSubtotal"].toDouble(),
discountAmount: json["discountAmount"], discountAmount: json["discountAmount"],
finalPrice: json["finalPrice"], finalPrice: json["finalPrice"].toDouble(),
message: json["message"], message: json["message"],
couponDetails: CouponDetails.fromJson(json["couponDetails"]), couponDetails: CouponDetails.fromJson(json["couponDetails"]),
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"isValid": isValid, "isValid": isValid,
"originalPrice": originalPrice, "originalPrice": originalPrice,
"eligibleSubtotal": eligibleSubtotal, "eligibleSubtotal": eligibleSubtotal,
@@ -118,30 +120,29 @@ class CouponResponse {
"finalPrice": finalPrice, "finalPrice": finalPrice,
"message": message, "message": message,
"couponDetails": couponDetails!.toJson(), "couponDetails": couponDetails!.toJson(),
}; };
} }
class CouponDetails { class CouponDetails {
String? code; String? code;
String ?type; String? type;
String ?discountValue; String? discountValue;
CouponDetails({ CouponDetails({
this.code, this.code,
this.type, this.type,
this.discountValue, this.discountValue,
}); });
factory CouponDetails.fromJson(Map<String, dynamic> json) => CouponDetails( factory CouponDetails.fromJson(Map<String, dynamic> json) => CouponDetails(
code: json["code"], code: json["code"],
type: json["type"], type: json["type"],
discountValue: json["discountValue"], discountValue: json["discountValue"],
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
"code": code, "code": code,
"type": type, "type": type,
"discountValue": discountValue, "discountValue": discountValue,
}; };
} }

View File

@@ -256,7 +256,6 @@ class AddtocartProvider extends ChangeNotifier {
print("ijdfhjhgjfgihj $data"); print("ijdfhjhgjfgihj $data");
try { try {
var result = await _homeRepo.applyCoupon(data); var result = await _homeRepo.applyCoupon(data);
return result.fold( return result.fold(
(error) { (error) {
@@ -273,8 +272,9 @@ class AddtocartProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
return false; return false;
}, },
(response) (response)
{ {
print("dfkhjkfgdkfkgh ");
if (response != null) { if (response != null) {
couponResponse = response; couponResponse = response;
_couponId = id; _couponId = id;

View File

@@ -144,7 +144,7 @@ class ProductProvider extends ChangeNotifier {
"minPrice": "${minPrice}", "minPrice": "${minPrice}",
"maxPrice": maxprice, "maxPrice": maxprice,
"search": search, "search": search,
"sortBy": orderby, "sortBy": 'basePrice',
"sortOrder": "asc" "sortOrder": "asc"
}; };
} else { } else {
@@ -157,6 +157,8 @@ class ProductProvider extends ChangeNotifier {
"sortOrder": "asc" "sortOrder": "asc"
}; };
} }
print("ljdkgkjdfghkj ${data}");
var result = await _homeRepo.getAllProduct(data, context, id); var result = await _homeRepo.getAllProduct(data, context, id);
return result.fold( return result.fold(
@@ -180,11 +182,14 @@ class ProductProvider extends ChangeNotifier {
ProductDetailsData productDetails = ProductDetailsData(); ProductDetailsData productDetails = ProductDetailsData();
bool isProductLoading = true; bool isProductLoading = true;
Future<void> getProduuctDetails( Future<bool> getProduuctDetails(
BuildContext context, String id, int quantity, String price) async { BuildContext context, String id, int quantity, String price) async {
var data = {}; var data = {};
context.showLoader(show: true);
productDetails = ProductDetailsData(); productDetails = ProductDetailsData();
isProductLoading = true; isProductLoading = true;
quantitys = quantity; quantitys = quantity;
_totalPrice = quantity * (double.parse(price)); _totalPrice = quantity * (double.parse(price));
notifyListeners(); notifyListeners();
@@ -192,13 +197,18 @@ class ProductProvider extends ChangeNotifier {
var result = await _homeRepo.getProductDetails(data, context, id); var result = await _homeRepo.getProductDetails(data, context, id);
return result.fold( return result.fold(
(error) { (error) {
context.showLoader(show: false);
isProductLoading = false; isProductLoading = false;
notifyListeners(); notifyListeners();
return false;
}, },
(response) { (response) {
context.showLoader(show: false);
productDetails = response!; productDetails = response!;
isProductLoading = false; isProductLoading = false;
notifyListeners(); notifyListeners();
return true;
}, },
); );
} }
@@ -524,8 +534,10 @@ class ProductProvider extends ChangeNotifier {
), ),
); );
}, },
(response) { (response)
cartItems.add(productId); // Add product to cart async {
cartItems.add(productId);
Fluttertoast.showToast( Fluttertoast.showToast(
msg: "Added to cart successfully!", msg: "Added to cart successfully!",
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@@ -535,7 +547,7 @@ class ProductProvider extends ChangeNotifier {
fontSize: 14.0, fontSize: 14.0,
); );
iscardAdded = true; iscardAdded = true;
notifyListeners(); // Update UI after adding to cart notifyListeners();
}, },
); );
} catch (e) { } catch (e) {

View File

@@ -143,7 +143,6 @@ class ProductRepo {
.map((item) => ProductCategoryModel.fromJson(item)) .map((item) => ProductCategoryModel.fromJson(item))
.toList(); .toList();
if (response != null && response.data != null) { if (response != null && response.data != null) {
final List<ProductCategoryModel> productModels = (response.data as List) final List<ProductCategoryModel> productModels = (response.data as List)
.map((item) => ProductCategoryModel.fromJson(item)) .map((item) => ProductCategoryModel.fromJson(item))
.toList(); .toList();
@@ -236,7 +235,7 @@ class ProductRepo {
FutureResult<CouponResponse> applyCoupon(data) async { FutureResult<CouponResponse> applyCoupon(data) async {
try { try {
var response = await _productService.applyCoupon(data); var response = await _productService.applyCoupon(data);
print("jdjkgdfjkhdfg ");
CouponResponse couponresponse = CouponResponse couponresponse =
couponResponseFromJson(response.toString()); couponResponseFromJson(response.toString());
print("jdjkgdfjkhdfg $couponresponse"); print("jdjkgdfjkhdfg $couponresponse");

View File

@@ -2,14 +2,13 @@ import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
class NotificationService { class NotificationService {
static final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = static final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin(); FlutterLocalNotificationsPlugin();
static Future<void> init() async { static Future<void> init() async {
const AndroidInitializationSettings initializationSettingsAndroid = const AndroidInitializationSettings initializationSettingsAndroid =
AndroidInitializationSettings('@mipmap/ic_launcher'); AndroidInitializationSettings('logo');
const DarwinInitializationSettings initializationSettingsIOS = const DarwinInitializationSettings initializationSettingsIOS =
DarwinInitializationSettings( DarwinInitializationSettings(

View File

@@ -297,15 +297,31 @@ class _BestDealScreenState extends State<BestDealScreen> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
var bestdealproduct = provider.bestdeal[index]; var bestdealproduct = provider.bestdeal[index];
return InkWell( return InkWell(
onTap: () { onTap: () async {
context.push(
MyRoutes.PRODUCTDETAILS, var status = await provider.getProduuctDetails(
extra: { context, bestdealproduct.id, 1, bestdealproduct.discountPrice);
"id": bestdealproduct.id, if (status) {
"quantity": 1, context.push(
"price": bestdealproduct.discountPrice, MyRoutes.PRODUCTDETAILS,
}, extra: {
); "id": bestdealproduct.id,
"quantity": 1,
"price": bestdealproduct.discountPrice,
},
);
}
// context.push(
// MyRoutes.PRODUCTDETAILS,
// extra: {
// "id": bestdealproduct.id,
// "quantity": 1,
// "price": bestdealproduct.discountPrice,
// },
// );
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(

View File

@@ -101,15 +101,28 @@ class _MycartState extends State<Mycart> {
double cardWidth = MediaQuery.of(context).size.width * 0.4; double cardWidth = MediaQuery.of(context).size.width * 0.4;
return InkWell( return InkWell(
onTap: () { onTap: () async {
context.push( var status = await provider.getProduuctDetails(context,
MyRoutes.PRODUCTDETAILS, bestdealproduct.id, 1, bestdealproduct.discountPrice);
extra: { if (status) {
"id": bestdealproduct.id, context.push(
"quantity": 1, MyRoutes.PRODUCTDETAILS,
"price": bestdealproduct.discountPrice, extra: {
}, "id": bestdealproduct.id,
); "quantity": 1,
"price": bestdealproduct.discountPrice,
},
);
}
// context.push(
// MyRoutes.PRODUCTDETAILS,
// extra: {
// "id": bestdealproduct.id,
// "quantity": 1,
// "price": bestdealproduct.discountPrice,
// },
// );
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@@ -216,8 +229,11 @@ class _MycartState extends State<Mycart> {
onTap: () async { onTap: () async {
if (await SharedPrefUtils.getToken() != if (await SharedPrefUtils.getToken() !=
null) { null) {
await provider.addToCart( await Provider.of<AddtocartProvider>(
context, bestdealproduct.id!, 1); context,
listen: false)
.addToCart(
context, bestdealproduct.id!, 1);
} else { } else {
context.push(MyRoutes.SIGNUP); context.push(MyRoutes.SIGNUP);
} }
@@ -410,15 +426,30 @@ class _MycartState extends State<Mycart> {
var items = provider.allitem.items![index]; var items = provider.allitem.items![index];
return InkWell( return InkWell(
onTap: () { onTap: () async {
context.push( var status =
MyRoutes.PRODUCTDETAILS, await Provider.of<ProductProvider>(context, listen: false)
extra: { .getProduuctDetails(context, items.product!.id!,
"id": items.product!.id, items.quantity!, items.product!.discountPrice!);
"quantity": items.quantity, if (status) {
"price": items.product!.discountPrice, context.push(
}, MyRoutes.PRODUCTDETAILS,
); extra: {
"id": items.product!.id,
"quantity": items.quantity,
"price": items.product!.discountPrice,
},
);
}
// context.push(
// MyRoutes.PRODUCTDETAILS,
// extra: {
// "id": items.product!.id,
// "quantity": items.quantity,
// "price": items.product!.discountPrice,
// },
// );
}, },
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w), padding: EdgeInsets.symmetric(horizontal: 10.w),

View File

@@ -108,27 +108,21 @@ class CouponsScreen extends StatelessWidget {
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
child: Stack( child: Stack(
children: [ children: [
// Background Image
Positioned.fill( Positioned.fill(
child: Image.network( child: Image.network(
coupon.imageUrl, coupon.imageUrl,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
// Blur Effect
Positioned.fill( Positioned.fill(
child: BackdropFilter( child: BackdropFilter(
filter: filter:
ImageFilter.blur(sigmaX: 5, sigmaY: 5), ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container( child: Container(
color: Colors.black.withOpacity( color: Colors.black.withOpacity(0.3),
0.3), // Dark overlay for readability
), ),
), ),
), ),
// Coupon Content
Padding( Padding(
padding: EdgeInsets.all(16.0), padding: EdgeInsets.all(16.0),
child: Column( child: Column(
@@ -139,8 +133,7 @@ class CouponsScreen extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors color: Colors.white,
.white, // Ensure contrast with background
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5),
@@ -151,8 +144,7 @@ class CouponsScreen extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors color: Colors.white,
.white, // Ensure contrast with background
), ),
), ),
Text( Text(
@@ -162,19 +154,20 @@ class CouponsScreen extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: color: Colors.white,
Colors.white, // Highlight price
), ),
), ),
], ],
), ),
SizedBox(height: 5), SizedBox(height: 5),
Text( Text(
"${coupon.discountValue ?? ''}", coupon.type == "PERCENTAGE"
? "${coupon.discountValue ?? ''}%"
: "${coupon.discountValue ?? ''}",
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 20,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.amber, // Highlight price color: Colors.amber,
), ),
), ),
SizedBox(height: 5), SizedBox(height: 5),
@@ -183,13 +176,10 @@ class CouponsScreen extends StatelessWidget {
style: TextStyle(color: Colors.white70), style: TextStyle(color: Colors.white70),
), ),
SizedBox(height: 10), SizedBox(height: 10),
// Coupon Code and Apply Button
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
// Coupon Code Box
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 10, vertical: 5), horizontal: 10, vertical: 5),
@@ -209,18 +199,18 @@ class CouponsScreen extends StatelessWidget {
), ),
), ),
), ),
// Apply Button
ElevatedButton( ElevatedButton(
onPressed: isCouponValid onPressed: isCouponValid
? () async { ? () async
{
var status = await provider var status = await provider
.applyCoupon( .applyCoupon(
context, context,
cartId, cartId,
coupon.code, coupon.code,
coupon.id); coupon.id);
if (status) { if (status)
{
Navigator.pop(context); Navigator.pop(context);
} }
} }

View File

@@ -202,17 +202,30 @@ class _FavouriteScreenState extends State<FavouriteScreen>
_animationController.forward(from: 0); _animationController.forward(from: 0);
return GestureDetector( return GestureDetector(
onTap: () { onTap: () async {
context.push( var status = await provider.getProduuctDetails(
MyRoutes.PRODUCTDETAILS, context, productId, 1, product.discountPrice);
// extra: productId if (status) {
context.push(
MyRoutes.PRODUCTDETAILS,
extra: {
"id": productId,
"quantity": 1,
"price": product.discountPrice,
},
);
}
extra: { // context.push(
"id": productId, // MyRoutes.PRODUCTDETAILS,
"quantity": 1, // // extra: productId
"price": product.discountPrice,
}, // extra: {
); // "id": productId,
// "quantity": 1,
// "price": product.discountPrice,
// },
// );
}, },
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),

View File

@@ -156,15 +156,28 @@ class _CtegoryProductState extends State<CtegoryProduct> {
} }
var product = provider.products[index]; var product = provider.products[index];
return InkWell( return InkWell(
onTap: () { onTap: () async {
context.push( var status = await provider.getProduuctDetails(
MyRoutes.PRODUCTDETAILS, context, product.id, 1, product.discountPrice);
extra: { if (status) {
"id": product.id, context.push(
"quantity": 1, MyRoutes.PRODUCTDETAILS,
"price": product.discountPrice, extra: {
}, "id": product.id,
); "quantity": 1,
"price": product.discountPrice,
},
);
}
// context.push(
// MyRoutes.PRODUCTDETAILS,
// extra: {
// "id": product.id,
// "quantity": 1,
// "price": product.discountPrice,
// },
// );
}, },
child: Container( child: Container(
height: itemHeight, height: itemHeight,

View File

@@ -103,19 +103,19 @@ class _HomeScreenState extends State<HomeScreen> {
Text(suggestion.name), Text(suggestion.name),
], ],
), ),
onTap: () { onTap: () async {
// _searchController.text = suggestion.name; var status = await searchProvider.getProduuctDetails(
// searchProvider.getHomeProduct( context, suggestion.id, 1, suggestion.discountPrice);
// context, "", suggestion.name, '', '', ''); if (status) {
context.push(
context.push( MyRoutes.PRODUCTDETAILS,
MyRoutes.PRODUCTDETAILS, extra: {
extra: { "id": suggestion.id,
"id": suggestion.id, "quantity": 1,
"quantity": 1, "price": suggestion.discountPrice,
"price": suggestion.discountPrice, },
}, );
); }
_clearOverlay(); _clearOverlay();
}, },
@@ -393,15 +393,22 @@ class _HomeScreenState extends State<HomeScreen> {
MediaQuery.of(context).size.width * 0.4; MediaQuery.of(context).size.width * 0.4;
return InkWell( return InkWell(
onTap: () { onTap: () async {
context.push( var status = await provider.getProduuctDetails(
MyRoutes.PRODUCTDETAILS, context,
extra: { bestdealproduct.id,
"id": bestdealproduct.id, 1,
"quantity": 1, bestdealproduct.discountPrice);
"price": bestdealproduct.discountPrice, if (status) {
}, context.push(
); MyRoutes.PRODUCTDETAILS,
extra: {
"id": bestdealproduct.id,
"quantity": 1,
"price": bestdealproduct.discountPrice,
},
);
}
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@@ -461,8 +468,6 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * height: MediaQuery.of(context).size.height *
0.01), 0.01),
Text( Text(
bestdealproduct.name ?? "", bestdealproduct.name ?? "",
textAlign: TextAlign.left, textAlign: TextAlign.left,
@@ -756,15 +761,19 @@ class _HomeScreenState extends State<HomeScreen> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
var product = provider.homeproducts[index]; var product = provider.homeproducts[index];
return InkWell( return InkWell(
onTap: () { onTap: () async {
context.push( var status = await provider.getProduuctDetails(
MyRoutes.PRODUCTDETAILS, context, product.id, 1, product.discountPrice);
extra: { if (status) {
"id": product.id, context.push(
"quantity": 1, MyRoutes.PRODUCTDETAILS,
"price": product.discountPrice, extra: {
}, "id": product.id,
); "quantity": 1,
"price": product.discountPrice,
},
);
}
}, },
child: SizedBox( child: SizedBox(
child: Column( child: Column(

View File

@@ -46,8 +46,8 @@ class _ProductDetailsState extends State<ProductDetails> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
Provider.of<ProductProvider>(context, listen: false) // Provider.of<ProductProvider>(context, listen: false)
.getProduuctDetails(context, widget.id, widget.quantity, widget.price); // .getProduuctDetails(context, widget.id, widget.quantity, widget.price);
} }
double value = 3.5; double value = 3.5;
@@ -962,11 +962,9 @@ class _ProductDetailsState extends State<ProductDetails> {
} }
String formatDate(String dateStr) { String formatDate(String dateStr) {
// Parse the date string to DateTime
DateTime date = DateTime.parse(dateStr).toLocal(); DateTime date = DateTime.parse(dateStr).toLocal();
// Format the date return DateFormat('MMMM d, yyyy').format(date);
return DateFormat('MMMM d, yyyy').format(date); // "February 4, 2025"
} }
Widget bestDeal() { Widget bestDeal() {
@@ -986,15 +984,28 @@ class _ProductDetailsState extends State<ProductDetails> {
double cardWidth = MediaQuery.of(context).size.width * 0.4; double cardWidth = MediaQuery.of(context).size.width * 0.4;
return InkWell( return InkWell(
onTap: () { onTap: () async {
context.push( var status = await provider.getProduuctDetails(context,
MyRoutes.PRODUCTDETAILS, bestdealproduct.id, 1, bestdealproduct.discountPrice);
extra: { if (status) {
"id": bestdealproduct.id, context.push(
"quantity": 1, MyRoutes.PRODUCTDETAILS,
"price": bestdealproduct.discountPrice, extra: {
}, "id": bestdealproduct.id,
); "quantity": 1,
"price": bestdealproduct.discountPrice,
},
);
}
// context.push(
// MyRoutes.PRODUCTDETAILS,
// extra: {
// "id": bestdealproduct.id,
// "quantity": 1,
// "price": bestdealproduct.discountPrice,
// },
// );
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
@@ -1244,89 +1255,3 @@ class _ProductDetailsState extends State<ProductDetails> {
}); });
} }
} }
// Widget _slider(BuildContext context) {
// double height = MediaQuery.of(context).size.height * .43;
// double statusBarHeight = MediaQuery.of(context).padding.top;
// // Fetch product data from Provider
// final productProvider = Provider.of<ProductProvider>(context);
// Product? model = productProvider.selectedProduct; // Ensure you have a selected product
// if (model == null) {
// return Center(child: CircularProgressIndicator()); // Show loading if no product data
// }
// return GestureDetector(
// onTap: () {
// Navigator.push(
// context,
// PageRouteBuilder(
// pageBuilder: (_, __, ___) => ProductPreview(
// pos: _curSlider,
// secPos: widget.secPos,
// index: widget.index,
// id: model.id,
// imgList: sliderList,
// list: widget.list,
// video: model.video,
// videoType: model.videType,
// from: true,
// ),
// ),
// );
// },
// child: Stack(
// children: <Widget>[
// Container(
// alignment: Alignment.center,
// padding: EdgeInsets.only(top: statusBarHeight + kToolbarHeight),
// child: PageView.builder(
// physics: const BouncingScrollPhysics(),
// itemCount: sliderList.length,
// scrollDirection: Axis.horizontal,
// controller: _pageController,
// reverse: false,
// onPageChanged: (index) {
// setState(() {
// _curSlider = index;
// });
// },
// itemBuilder: (BuildContext context, int i) {
// return sliderList[i] != "youtube"
// ? networkImageCommon(sliderList[i]!, height, true)
// : playIcon(model);
// },
// ),
// ),
// Positioned(
// bottom: 30,
// height: 20,
// width: MediaQuery.of(context).size.width,
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: List.generate(
// sliderList.length,
// (index) => AnimatedContainer(
// duration: const Duration(milliseconds: 500),
// width: _curSlider == index ? 30.0 : 8.0,
// height: 8.0,
// margin: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 4.0),
// decoration: BoxDecoration(
// border: Border.all(
// color: Theme.of(context).colorScheme.primary),
// borderRadius: BorderRadius.circular(20.0),
// color: _curSlider == index
// ? Theme.of(context).colorScheme.primary
// : Colors.transparent,
// ),
// ),
// ),
// ),
// ),
// indicatorImage(model),
// ],
// ),
// );
// }