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.
connectivity_plus=/Users/apple/.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_macos=/Users/apple/.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/
firebase_core=/Users/apple/.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_messaging=/Users/apple/.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/
flutter_inappwebview=/Users/apple/.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_ios=/Users/apple/.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_web=/Users/apple/.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_linux=/Users/apple/.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/
fluttertoast=/Users/apple/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/
geocoding=/Users/apple/.pub-cache/hosted/pub.dev/geocoding-3.0.0/
geocoding_android=/Users/apple/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/
geocoding_ios=/Users/apple/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/
geolocator=/Users/apple/.pub-cache/hosted/pub.dev/geolocator-13.0.2/
geolocator_android=/Users/apple/.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_web=/Users/apple/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/
geolocator_windows=/Users/apple/.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_maps_flutter=/Users/apple/.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_ios=/Users/apple/.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/
image_picker=/Users/apple/.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_for_web=/Users/apple/.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_linux=/Users/apple/.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_windows=/Users/apple/.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/
path_provider=/Users/apple/.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_foundation=/Users/apple/.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_windows=/Users/apple/.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_android=/Users/apple/.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_html=/Users/apple/.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/
shared_preferences=/Users/apple/.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_foundation=/Users/apple/.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_web=/Users/apple/.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/
sqflite=/Users/apple/.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_android=/Users/apple/.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_linux=/Users/apple/.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_web=/Users/apple/.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/
connectivity_plus=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/connectivity_plus-6.1.3/
file_selector_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_linux-0.9.3+2/
file_selector_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_macos-0.9.4+2/
file_selector_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/file_selector_windows-0.9.3+3/
firebase_core=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_core-3.13.0/
firebase_core_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_core_web-2.22.0/
firebase_messaging=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_messaging-15.2.5/
firebase_messaging_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/firebase_messaging_web-3.10.5/
flutter_inappwebview=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview-6.0.0/
flutter_inappwebview_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_android-1.0.13/
flutter_inappwebview_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_ios-1.0.13/
flutter_inappwebview_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_macos-1.0.11/
flutter_inappwebview_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_inappwebview_web-1.0.8/
flutter_local_notifications=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_local_notifications-18.0.1/
flutter_local_notifications_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_local_notifications_linux-5.0.0/
flutter_plugin_android_lifecycle=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.22/
fluttertoast=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/fluttertoast-8.2.11/
geocoding=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding-3.0.0/
geocoding_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_android-3.3.1/
geocoding_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geocoding_ios-3.0.1/
geolocator=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator-13.0.2/
geolocator_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_android-4.6.1/
geolocator_apple=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.8+1/
geolocator_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_web-4.1.1/
geolocator_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/
google_api_headers=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_api_headers-1.6.0/
google_maps_flutter=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter-2.10.0/
google_maps_flutter_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.14.7/
google_maps_flutter_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.13.2/
google_maps_flutter_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.10/
image_picker=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker-1.1.2/
image_picker_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_android-0.8.12+12/
image_picker_for_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_for_web-3.0.6/
image_picker_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_ios-0.8.12+2/
image_picker_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_linux-0.2.1+1/
image_picker_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_macos-0.2.1+2/
image_picker_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/image_picker_windows-0.2.1+1/
package_info_plus=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/package_info_plus-4.2.0/
path_provider=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider-2.1.5/
path_provider_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_android-2.2.10/
path_provider_foundation=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.1/
path_provider_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/
permission_handler=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler-11.3.1/
permission_handler_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_android-12.0.13/
permission_handler_apple=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_apple-9.4.7/
permission_handler_html=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_html-0.1.3+5/
permission_handler_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/permission_handler_windows-0.2.1/
shared_preferences=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences-2.3.3/
shared_preferences_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.2/
shared_preferences_foundation=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.4/
shared_preferences_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/
shared_preferences_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/
shared_preferences_windows=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/
sqflite=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/sqflite-2.3.3+1/
url_launcher=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher-6.3.1/
url_launcher_android=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.9/
url_launcher_ios=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/
url_launcher_linux=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.1/
url_launcher_macos=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.2/
url_launcher_web=/Users/rajeevsingh/.pub-cache/hosted/pub.dev/url_launcher_web-2.3.3/
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();
print("💬 Background Message Received: ${message.notification?.title}");
if (message.notification != null) {
NotificationService.flutterLocalNotificationsPlugin.show(
message.hashCode,
message.notification!.title,
message.notification!.body,
@@ -39,6 +41,7 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async
channelDescription: 'Used for important notifications.',
importance: Importance.max,
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
//
@@ -77,16 +78,17 @@
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());
class CouponResponse {
bool? isValid;
int? originalPrice;
int? eligibleSubtotal;
int? discountAmount;
int? finalPrice;
double? originalPrice;
double? eligibleSubtotal;
dynamic? discountAmount;
double? finalPrice;
String? message;
CouponDetails? couponDetails;
@@ -102,10 +104,10 @@ class CouponResponse {
factory CouponResponse.fromJson(Map<String, dynamic> json) => CouponResponse(
isValid: json["isValid"],
originalPrice: json["originalPrice"],
eligibleSubtotal: json["eligibleSubtotal"],
originalPrice: json["originalPrice"].toDouble(),
eligibleSubtotal: json["eligibleSubtotal"].toDouble(),
discountAmount: json["discountAmount"],
finalPrice: json["finalPrice"],
finalPrice: json["finalPrice"].toDouble(),
message: json["message"],
couponDetails: CouponDetails.fromJson(json["couponDetails"]),
);
@@ -123,8 +125,8 @@ class CouponResponse {
class CouponDetails {
String? code;
String ?type;
String ?discountValue;
String? type;
String? discountValue;
CouponDetails({
this.code,
@@ -144,4 +146,3 @@ class CouponDetails {
"discountValue": discountValue,
};
}

View File

@@ -257,7 +257,6 @@ class AddtocartProvider extends ChangeNotifier {
try {
var result = await _homeRepo.applyCoupon(data);
return result.fold(
(error) {
context.showLoader(show: false);
@@ -275,6 +274,7 @@ class AddtocartProvider extends ChangeNotifier {
},
(response)
{
print("dfkhjkfgdkfkgh ");
if (response != null) {
couponResponse = response;
_couponId = id;

View File

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

View File

@@ -143,7 +143,6 @@ class ProductRepo {
.map((item) => ProductCategoryModel.fromJson(item))
.toList();
if (response != null && response.data != null) {
final List<ProductCategoryModel> productModels = (response.data as List)
.map((item) => ProductCategoryModel.fromJson(item))
.toList();
@@ -236,7 +235,7 @@ class ProductRepo {
FutureResult<CouponResponse> applyCoupon(data) async {
try {
var response = await _productService.applyCoupon(data);
print("jdjkgdfjkhdfg ");
CouponResponse couponresponse =
couponResponseFromJson(response.toString());
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:firebase_messaging/firebase_messaging.dart';
class NotificationService {
static final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
static Future<void> init() async {
const AndroidInitializationSettings initializationSettingsAndroid =
AndroidInitializationSettings('@mipmap/ic_launcher');
AndroidInitializationSettings('logo');
const DarwinInitializationSettings initializationSettingsIOS =
DarwinInitializationSettings(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -46,8 +46,8 @@ class _ProductDetailsState extends State<ProductDetails> {
@override
void initState() {
super.initState();
Provider.of<ProductProvider>(context, listen: false)
.getProduuctDetails(context, widget.id, widget.quantity, widget.price);
// Provider.of<ProductProvider>(context, listen: false)
// .getProduuctDetails(context, widget.id, widget.quantity, widget.price);
}
double value = 3.5;
@@ -962,11 +962,9 @@ class _ProductDetailsState extends State<ProductDetails> {
}
String formatDate(String dateStr) {
// Parse the date string to DateTime
DateTime date = DateTime.parse(dateStr).toLocal();
// Format the date
return DateFormat('MMMM d, yyyy').format(date); // "February 4, 2025"
return DateFormat('MMMM d, yyyy').format(date);
}
Widget bestDeal() {
@@ -986,7 +984,10 @@ class _ProductDetailsState extends State<ProductDetails> {
double cardWidth = MediaQuery.of(context).size.width * 0.4;
return InkWell(
onTap: () {
onTap: () async {
var status = await provider.getProduuctDetails(context,
bestdealproduct.id, 1, bestdealproduct.discountPrice);
if (status) {
context.push(
MyRoutes.PRODUCTDETAILS,
extra: {
@@ -995,6 +996,16 @@ class _ProductDetailsState extends State<ProductDetails> {
"price": bestdealproduct.discountPrice,
},
);
}
// context.push(
// MyRoutes.PRODUCTDETAILS,
// extra: {
// "id": bestdealproduct.id,
// "quantity": 1,
// "price": bestdealproduct.discountPrice,
// },
// );
},
child: Padding(
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),
// ],
// ),
// );
// }