final after change app
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
|||||||
3.24.3
|
3.24.1
|
||||||
124
.flutter-plugins
124
.flutter-plugins
@@ -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
BIN
android/.DS_Store
vendored
Binary file not shown.
BIN
android/app/src/main/res/drawable/logo.png
Normal file
BIN
android/app/src/main/res/drawable/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
@@ -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,
|
||||||
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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,16 +78,17 @@
|
|||||||
|
|
||||||
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;
|
||||||
|
|
||||||
@@ -102,10 +104,10 @@ class CouponResponse {
|
|||||||
|
|
||||||
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"]),
|
||||||
);
|
);
|
||||||
@@ -144,4 +146,3 @@ class CouponDetails {
|
|||||||
"discountValue": discountValue,
|
"discountValue": discountValue,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -257,7 +257,6 @@ class AddtocartProvider extends ChangeNotifier {
|
|||||||
try {
|
try {
|
||||||
var result = await _homeRepo.applyCoupon(data);
|
var result = await _homeRepo.applyCoupon(data);
|
||||||
|
|
||||||
|
|
||||||
return result.fold(
|
return result.fold(
|
||||||
(error) {
|
(error) {
|
||||||
context.showLoader(show: false);
|
context.showLoader(show: false);
|
||||||
@@ -275,6 +274,7 @@ class AddtocartProvider extends ChangeNotifier {
|
|||||||
},
|
},
|
||||||
(response)
|
(response)
|
||||||
{
|
{
|
||||||
|
print("dfkhjkfgdkfkgh ");
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
couponResponse = response;
|
couponResponse = response;
|
||||||
_couponId = id;
|
_couponId = id;
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -297,7 +297,11 @@ 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 {
|
||||||
|
|
||||||
|
var status = await provider.getProduuctDetails(
|
||||||
|
context, bestdealproduct.id, 1, bestdealproduct.discountPrice);
|
||||||
|
if (status) {
|
||||||
context.push(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
extra: {
|
extra: {
|
||||||
@@ -306,6 +310,18 @@ class _BestDealScreenState extends State<BestDealScreen> {
|
|||||||
"price": bestdealproduct.discountPrice,
|
"price": bestdealproduct.discountPrice,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// context.push(
|
||||||
|
// MyRoutes.PRODUCTDETAILS,
|
||||||
|
// extra: {
|
||||||
|
// "id": bestdealproduct.id,
|
||||||
|
// "quantity": 1,
|
||||||
|
// "price": bestdealproduct.discountPrice,
|
||||||
|
// },
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
@@ -101,7 +101,10 @@ 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 {
|
||||||
|
var status = await provider.getProduuctDetails(context,
|
||||||
|
bestdealproduct.id, 1, bestdealproduct.discountPrice);
|
||||||
|
if (status) {
|
||||||
context.push(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
extra: {
|
extra: {
|
||||||
@@ -110,6 +113,16 @@ class _MycartState extends State<Mycart> {
|
|||||||
"price": bestdealproduct.discountPrice,
|
"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,7 +229,10 @@ 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,
|
||||||
|
listen: false)
|
||||||
|
.addToCart(
|
||||||
context, bestdealproduct.id!, 1);
|
context, bestdealproduct.id!, 1);
|
||||||
} else {
|
} else {
|
||||||
context.push(MyRoutes.SIGNUP);
|
context.push(MyRoutes.SIGNUP);
|
||||||
@@ -410,7 +426,12 @@ class _MycartState extends State<Mycart> {
|
|||||||
var items = provider.allitem.items![index];
|
var items = provider.allitem.items![index];
|
||||||
|
|
||||||
return InkWell(
|
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(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
extra: {
|
extra: {
|
||||||
@@ -419,6 +440,16 @@ class _MycartState extends State<Mycart> {
|
|||||||
"price": items.product!.discountPrice,
|
"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),
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,17 +202,30 @@ class _FavouriteScreenState extends State<FavouriteScreen>
|
|||||||
_animationController.forward(from: 0);
|
_animationController.forward(from: 0);
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
|
var status = await provider.getProduuctDetails(
|
||||||
|
context, productId, 1, product.discountPrice);
|
||||||
|
if (status) {
|
||||||
context.push(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
// extra: productId
|
|
||||||
|
|
||||||
extra: {
|
extra: {
|
||||||
"id": productId,
|
"id": productId,
|
||||||
"quantity": 1,
|
"quantity": 1,
|
||||||
"price": product.discountPrice,
|
"price": product.discountPrice,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// context.push(
|
||||||
|
// MyRoutes.PRODUCTDETAILS,
|
||||||
|
// // extra: productId
|
||||||
|
|
||||||
|
// extra: {
|
||||||
|
// "id": productId,
|
||||||
|
// "quantity": 1,
|
||||||
|
// "price": product.discountPrice,
|
||||||
|
// },
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.all(8),
|
padding: EdgeInsets.all(8),
|
||||||
|
|||||||
@@ -156,7 +156,10 @@ class _CtegoryProductState extends State<CtegoryProduct> {
|
|||||||
}
|
}
|
||||||
var product = provider.products[index];
|
var product = provider.products[index];
|
||||||
return InkWell(
|
return InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
|
var status = await provider.getProduuctDetails(
|
||||||
|
context, product.id, 1, product.discountPrice);
|
||||||
|
if (status) {
|
||||||
context.push(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
extra: {
|
extra: {
|
||||||
@@ -165,6 +168,16 @@ class _CtegoryProductState extends State<CtegoryProduct> {
|
|||||||
"price": product.discountPrice,
|
"price": product.discountPrice,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// context.push(
|
||||||
|
// MyRoutes.PRODUCTDETAILS,
|
||||||
|
// extra: {
|
||||||
|
// "id": product.id,
|
||||||
|
// "quantity": 1,
|
||||||
|
// "price": product.discountPrice,
|
||||||
|
// },
|
||||||
|
// );
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: itemHeight,
|
height: itemHeight,
|
||||||
|
|||||||
@@ -103,11 +103,10 @@ 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: {
|
||||||
@@ -116,6 +115,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
"price": suggestion.discountPrice,
|
"price": suggestion.discountPrice,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
_clearOverlay();
|
_clearOverlay();
|
||||||
},
|
},
|
||||||
@@ -393,7 +393,13 @@ 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 {
|
||||||
|
var status = await provider.getProduuctDetails(
|
||||||
|
context,
|
||||||
|
bestdealproduct.id,
|
||||||
|
1,
|
||||||
|
bestdealproduct.discountPrice);
|
||||||
|
if (status) {
|
||||||
context.push(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
extra: {
|
extra: {
|
||||||
@@ -402,6 +408,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
"price": bestdealproduct.discountPrice,
|
"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,7 +761,10 @@ 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 {
|
||||||
|
var status = await provider.getProduuctDetails(
|
||||||
|
context, product.id, 1, product.discountPrice);
|
||||||
|
if (status) {
|
||||||
context.push(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
extra: {
|
extra: {
|
||||||
@@ -765,6 +773,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
"price": product.discountPrice,
|
"price": product.discountPrice,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -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,7 +984,10 @@ 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 {
|
||||||
|
var status = await provider.getProduuctDetails(context,
|
||||||
|
bestdealproduct.id, 1, bestdealproduct.discountPrice);
|
||||||
|
if (status) {
|
||||||
context.push(
|
context.push(
|
||||||
MyRoutes.PRODUCTDETAILS,
|
MyRoutes.PRODUCTDETAILS,
|
||||||
extra: {
|
extra: {
|
||||||
@@ -995,6 +996,16 @@ class _ProductDetailsState extends State<ProductDetails> {
|
|||||||
"price": bestdealproduct.discountPrice,
|
"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),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user