fixed ui and categories

This commit is contained in:
2025-04-14 00:43:04 +05:30
parent c2167f57d3
commit 31cc1b9c15
18 changed files with 730 additions and 844 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -0,0 +1,31 @@
Extension Discovery Cache
=========================
This folder is used by `package:extension_discovery` to cache lists of
packages that contains extensions for other packages.
DO NOT USE THIS FOLDER
----------------------
* Do not read (or rely) the contents of this folder.
* Do write to this folder.
If you're interested in the lists of extensions stored in this folder use the
API offered by package `extension_discovery` to get this information.
If this package doesn't work for your use-case, then don't try to read the
contents of this folder. It may change, and will not remain stable.
Use package `extension_discovery`
---------------------------------
If you want to access information from this folder.
Feel free to delete this folder
-------------------------------
Files in this folder act as a cache, and the cache is discarded if the files
are older than the modification time of `.dart_tool/package_config.json`.
Hence, it should never be necessary to clear this cache manually, if you find a
need to do please file a bug.

View File

@@ -0,0 +1 @@
{"version":2,"entries":[{"package":"grocery_app","rootUri":"../","packageUri":"lib/"}]}

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.22.3
3.24.3

View File

@@ -1,52 +1,52 @@
# This is a generated file; do not edit or check into version control.
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/
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_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/
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/
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/
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_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/
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/

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.frontshop.userapp">
>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

View File

@@ -41,10 +41,10 @@ class ProductProvider extends ChangeNotifier {
Future<void> gettAllProduct(BuildContext context, String id, bool status,
String search, bool first) async {
if (isLoadingg || !hasMore) return;
print("kdjfhgkfkjdghkjkdfg");
// if (isLoadingg || !hasMore) return;
if (first) {
print("kdjfhgkfkjdghkjkdfg");
products.clear();
notifyListeners();
}

View File

@@ -1,11 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/network_image.dart';
import 'package:grocery_app/src/core/routes/routes.dart';
import 'package:grocery_app/src/data/all_cart_items.dart';
import 'package:grocery_app/src/logic/provider/bottom_navbar_provider.dart';
import 'package:grocery_app/src/logic/provider/home_provider.dart';
import 'package:grocery_app/src/ui/data_notfound.dart';
@@ -17,9 +15,9 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
import 'package:provider/provider.dart';
import 'package:shimmer/shimmer.dart';
class BestDealScreen extends StatefulWidget {
class BestDealScreen extends StatefulWidget
{
const BestDealScreen({super.key});
@override
State<BestDealScreen> createState() => _BestDealScreenState();
}
@@ -28,18 +26,15 @@ class _BestDealScreenState extends State<BestDealScreen> {
bool _isSearching = false;
TextEditingController _searchController = TextEditingController();
@override
void initState() {
void initState()
{
Provider.of<ProductProvider>(context, listen: false)
.getBestDealProduct(context, '');
super.initState();
}
int calculateDiscountPercentage(double basePrice, double discountPrice) {
print(
"Base Price (Before Discount): $basePrice, Discount Price (After Discount): $discountPrice");
if (basePrice <= 0 || discountPrice <= 0 || discountPrice > basePrice) {
print("Error: Invalid price values.");
return 0;
}

View File

@@ -1,31 +1,20 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/network_image.dart';
import 'package:grocery_app/src/common_widget/textfield_widget.dart';
import 'package:grocery_app/src/core/routes/routes.dart';
import 'package:grocery_app/src/logic/provider/addTocart_provider.dart';
import 'package:grocery_app/src/logic/provider/bottom_navbar_provider.dart';
import 'package:grocery_app/src/logic/provider/home_provider.dart';
import 'package:grocery_app/src/ui/bestdeal/bestdeal_screen.dart';
import 'package:grocery_app/src/ui/card_checkout/card_checkout_screen.dart';
import 'package:grocery_app/src/ui/data_notfound.dart';
import 'package:grocery_app/src/ui/widgets/custom_icon_button.dart';
import 'package:grocery_app/src/ui/widgets/elevated_button.dart';
import 'package:grocery_app/utils/constants/assets_constant.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
import 'package:grocery_app/utils/constants/shared_pref_utils.dart';
import 'package:grocery_app/utils/constants/string_constant.dart';
import 'package:grocery_app/utils/extensions/extensions.dart';
import 'package:grocery_app/utils/extensions/uicontext.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:provider/provider.dart';
import 'package:skeletonizer/skeletonizer.dart';
import 'package:url_launcher/url_launcher.dart';
@@ -58,8 +47,8 @@ class _MycartState extends State<Mycart> {
appBar: AppBar(
backgroundColor: Colors.transparent,
centerTitle: true,
title: Center(
child: const Text(
title: const Center(
child: Text(
'My Cart 🛒',
style: TextStyle(
fontSize: 20,
@@ -99,9 +88,9 @@ class _MycartState extends State<Mycart> {
Widget relatedProduct() {
return Consumer<ProductProvider>(builder: (context, provider, child) {
if (provider.isBestdealingloading) {
return Center(child: CircularProgressIndicator());
return const Center(child: CircularProgressIndicator());
} else if (provider.bestdeal.isEmpty) {
return Center(child: Text(''));
return const Center(child: Text(''));
} else {
return SizedBox(
height: MediaQuery.of(context).size.height * 0.28,
@@ -110,8 +99,7 @@ class _MycartState extends State<Mycart> {
itemCount: provider.bestdeal.length,
itemBuilder: (context, index) {
var bestdealproduct = provider.bestdeal[index];
double cardWidth =
MediaQuery.of(context).size.width * 0.4; // Dynamic width
double cardWidth = MediaQuery.of(context).size.width * 0.4;
return InkWell(
onTap: () {
@@ -156,7 +144,6 @@ class _MycartState extends State<Mycart> {
alignment: Alignment.center,
children: [
AppNetworkImage(
imageUrl: bestdealproduct
.productImages?.first?.url ??
"",
@@ -439,10 +426,9 @@ class _MycartState extends State<Mycart> {
} else {
return ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
separatorBuilder: (_, index) => Padding(
padding: EdgeInsets.only(top: 8.h, bottom: 8.h),
// child: const Divider(thickness: 1),
),
itemCount: provider.allitem.items!.length,
itemBuilder: (context, index) {
@@ -465,12 +451,13 @@ class _MycartState extends State<Mycart> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: 60.h,
width: 100,
decoration: BoxDecoration(
color: Colors.greenAccent.withOpacity(0.1),
borderRadius: BorderRadius.circular(5),
),
child: AppNetworkImage(
imageUrl:
items.product!.productImages!.first.url ?? " ",
backGroundColor: APPCOLOR.bgGrey,
@@ -1075,7 +1062,7 @@ class _MycartState extends State<Mycart> {
top: 15,
left: 15,
child: SizedBox(
width: 200,
width: 170,
child: Text(
banner.altText ?? "Special Event",
style: context.customExtraBold(
@@ -1108,15 +1095,19 @@ class _MycartState extends State<Mycart> {
),
),
Positioned(
right: 15,
bottom: 15,
child: AppNetworkImage(
imageUrl: banner.imageUrl ??
'https://e7.pngegg.com/pngimages/742/816/png-clipart-coca-cola-can-illustration-coca-cola-soft-drink-surge-pepsi-coke-sweetness-cola-thumbnail.png',
backGroundColor: Colors.transparent,
),
),
right: 15,
bottom: 15,
child: SizedBox(
height: 150,
width: 200,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: AppNetworkImage(
imageUrl: banner.imageUrl ??
'https://e7.pngegg.com/pngimages/742/816/png-clipart-coca-cola-can-illustration-coca-cola-soft-drink-surge-pepsi-coke-sweetness-cola-thumbnail.png',
backGroundColor: Colors.transparent,
),
))),
],
),
);

View File

@@ -28,10 +28,10 @@ class DataNotFound extends StatelessWidget {
fit: BoxFit.contain,
),
),
const SizedBox(height: 20),
const SizedBox(height: 5),
Text(
message,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
style: const TextStyle(fontSize: 10, fontWeight: FontWeight.w500),
textAlign: TextAlign.center,
),
],

View File

@@ -28,17 +28,53 @@ class FruitVeggieDetail extends StatefulWidget {
class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
final ScrollController _scrollController = ScrollController();
// @override
// void initState() {
// final productProvider = Provider.of<ProductProvider>(context, listen: false)
// .gettAllProduct(context, "", true, '', true);
// WidgetsBinding.instance.addPostFrameCallback((_) {
// final productProvider =
// Provider.of<ProductProvider>(context, listen: false);
// productProvider.getAllcategory(context);
// productProvider.getCategoryByLevel();
// productProvider.setActiveIndex(0);
// });
// _scrollController.addListener(() {
// if (_scrollController.position.pixels ==
// _scrollController.position.maxScrollExtent) {
// final productProvider =
// Provider.of<ProductProvider>(context, listen: false);
// productProvider.gettAllProduct(context, "", false, '', false);
// }
// });
// super.initState();
// }
// @override
// void dispose() {
// _scrollController.dispose();
// super.dispose();
// }
@override
void initState() {
final productProvider = Provider.of<ProductProvider>(context, listen: false)
.gettAllProduct(context, "", true, '', true);
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
final productProvider =
Provider.of<ProductProvider>(context, listen: false);
// productProvider.gettAllProduct(context, "", true, '', true);
// Initial product fetch
productProvider.gettAllProduct(context, "", true, '', true);
// Fetch categories
productProvider.getAllcategory(context);
productProvider.getCategoryByLevel();
// Set initial tab/index
productProvider.setActiveIndex(0);
});
@@ -47,11 +83,11 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
_scrollController.position.maxScrollExtent) {
final productProvider =
Provider.of<ProductProvider>(context, listen: false);
// Load more products on scroll
productProvider.gettAllProduct(context, "", false, '', false);
}
});
super.initState();
}
@override
@@ -143,8 +179,6 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
return GridView.builder(
controller: _scrollController,
// itemCount: provider.products.length,
itemCount:
provider.products.length + (provider.hasMore ? 1 : 0),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@@ -162,8 +196,6 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
onTap: () {
context.push(
MyRoutes.PRODUCTDETAILS,
// extra: product.id
extra: {
"id": product.id,
"quantity": 1,
@@ -420,23 +452,16 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
}
int calculateDiscountPercentage(double basePrice, double discountPrice) {
print(
"Base Price (Before Discount): $basePrice, Discount Price (After Discount): $discountPrice");
if (basePrice <= 0 || discountPrice <= 0 || discountPrice > basePrice) {
print("Error: Invalid price values.");
return 0;
}
double discountAmount = basePrice - discountPrice;
double discountPercentage = (discountAmount / basePrice) * 100;
return discountPercentage.round();
}
Widget filterCategory() {
final activeIndexProvider = Provider.of<ProductProvider>(context);
return Consumer<ProductProvider>(builder: (context, provider, child) {
if (provider.iscategroyloading) {
return Center(
@@ -483,7 +508,6 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
if (category.id == "all") {
provider.gettAllProduct(context, "", true, '', false);
} else {
// Load filtered products
provider.gettAllProduct(
context, "/category/${category.id}", true, '', false);
}
@@ -501,11 +525,8 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
child: Padding(
padding: const EdgeInsets.only(top: 0, bottom: 0),
child: SizedBox(
//height: 80,
width: 70,
child: Column(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.center,
children: [
if (category.name == "ALL") ...{
if (provider.categoriesss.isNotEmpty)
@@ -543,7 +564,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
child: Center(
child: Column(
children: [
Row(
const Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
@@ -554,14 +575,10 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
],
),
CachedNetworkImage(
/// height: height,
///width: width,
errorWidget:
(context, url, error) {
return Container(
height: 40,
// width: 50,
decoration: BoxDecoration(
color: APPCOLOR.bgGrey,
borderRadius:
@@ -622,29 +639,11 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png'),
],
),
)
// Container(
// child: AppNetworkImage(
// height: 50,
// width: 60,
// imageUrl: provider
// .selectedCategory?.image ??
// 'https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png',
// backGroundColor: APPCOLOR.bgGrey,
// radius: 10,
// ),
// ),
// ),
),
)),
} else ...{
Column(
children: [
CachedNetworkImage(
/// height: height,
///width: width,
errorWidget: (context, url, error) {
return Container(
height: 50,
@@ -685,7 +684,6 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
},
imageBuilder: (context, cIMage) {
return Container(
// width: 60,
height: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(

View File

@@ -1,19 +1,16 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/network_image.dart';
import 'package:grocery_app/src/core/routes/routes.dart';
import 'package:grocery_app/src/logic/provider/home_provider.dart';
import 'package:grocery_app/src/ui/bestdeal/bestdeal_screen.dart';
import 'package:grocery_app/src/ui/data_notfound.dart';
import 'package:grocery_app/src/ui/fruitvegidetail/fruit_veggie_detail.dart';
import 'package:grocery_app/src/ui/header.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
import 'package:grocery_app/utils/constants/shared_pref_utils.dart';
import 'package:grocery_app/utils/constants/string_constant.dart';
import 'package:grocery_app/utils/extensions/extensions.dart';
import 'package:grocery_app/utils/extensions/uicontext.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:provider/provider.dart';
@@ -92,10 +89,14 @@ class _HomeScreenState extends State<HomeScreen> {
return ListTile(
title: Row(
children: [
AppNetworkImage(
imageUrl: suggestion.productImages!.first.url,
backGroundColor: APPCOLOR.bgGrey,
radius: 10,
SizedBox(
width: 30,
height: 30,
child: AppNetworkImage(
imageUrl: suggestion.productImages!.first.url,
backGroundColor: APPCOLOR.bgGrey,
radius: 10,
),
),
Text(suggestion.name),
],
@@ -129,17 +130,16 @@ class _HomeScreenState extends State<HomeScreen> {
top: 0,
),
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Header(),
const SizedBox(
height: 15,
),
Row(
children: [
Expanded(
// ✅ Move Expanded Here
child: Consumer<ProductProvider>(
builder: (context, provider, child) {
return CompositedTransformTarget(
@@ -166,9 +166,6 @@ class _HomeScreenState extends State<HomeScreen> {
fillColor: Colors.transparent,
suffixIcon: InkWell(
onTap: () {
print(
"klfklhjklfklhg ${_searchController.text}");
provider.getHomeProduct(context, "",
_searchController.text, '', '', '');
},
@@ -210,83 +207,6 @@ class _HomeScreenState extends State<HomeScreen> {
),
],
),
// Row(
// children: [
// Consumer<ProductProvider>(
// builder: (context, provider, child)
// {
// return
// CompositedTransformTarget(
// link: _layerLink,
// child: Expanded(
// child: Container(
// height: 50,
// decoration: BoxDecoration(
// color: APPCOLOR.bgGrey,
// borderRadius: BorderRadius.circular(5),
// ),
// child: TextFormField(
// controller: _searchController,
// onChanged: (value) {
// provider.searchProducts(value);
// if (value.isNotEmpty) {
// _showOverlay(context);
// } else {
// _clearOverlay();
// }
// // provider.searchValue = value;
// },
// decoration: InputDecoration(
// border: InputBorder.none,
// fillColor: Colors.transparent,
// suffixIcon: InkWell(
// onTap: () {
// provider.getHomeProduct(context, "",
// provider.searchValue, '', '', '');
// },
// child: Icon(MdiIcons.magnify)),
// hintText: 'Search',
// hintStyle: context.customRegular(
// APPCOLOR.grey666666, 18),
// isCollapsed: true,
// contentPadding: const EdgeInsets.symmetric(
// vertical: 10, horizontal: 10),
// ),
// ),
// ),
// ),
// );
// }),
// const SizedBox(
// width: 10,
// ),
// InkWell(
// onTap: () {
// showSortBottomSheet(context);
// },
// child: Container(
// height: 50,
// width: 50,
// decoration: BoxDecoration(
// color: APPCOLOR.lightGreen,
// borderRadius: BorderRadius.circular(5),
// ),
// child: Center(
// child: Icon(
// MdiIcons.tuneVariant,
// color: Colors.white,
// ),
// ),
// ),
// ),
// ],
// ),
const SizedBox(
height: 15,
),
@@ -301,13 +221,6 @@ class _HomeScreenState extends State<HomeScreen> {
),
InkWell(
onTap: () {
// Navigator.of(context).push(MaterialPageRoute(
// builder: (context) {
// return const FruitVeggieDetail();
// },
// ));
context.push(MyRoutes.FRUITVEGGIEDETAIL);
},
child: Text(
@@ -403,19 +316,19 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
),
SizedBox(height: 10),
const SizedBox(height: 10),
Container(
height: 15,
width: cardWidth * 0.8,
color: Colors.grey[300],
),
SizedBox(height: 5),
const SizedBox(height: 5),
Container(
height: 12,
width: cardWidth * 0.5,
color: Colors.grey[300],
),
SizedBox(height: 5),
const SizedBox(height: 5),
const Spacer(),
Row(
children: [
@@ -466,8 +379,6 @@ class _HomeScreenState extends State<HomeScreen> {
onTap: () {
context.push(
MyRoutes.PRODUCTDETAILS,
// extra: bestdealproduct.id
extra: {
"id": bestdealproduct.id,
"quantity": 1,
@@ -482,13 +393,6 @@ class _HomeScreenState extends State<HomeScreen> {
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
// BoxShadow(
// color: Colors.grey.withOpacity(0.1),
// blurRadius: 1,
// offset: const Offset(5, 5),
// ),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -497,22 +401,11 @@ class _HomeScreenState extends State<HomeScreen> {
child: Container(
height: MediaQuery.of(context).size.height *
0.12,
// width: cardWidth * 0.9,
decoration: BoxDecoration(
color: APPCOLOR.bgGrey,
borderRadius: BorderRadius.circular(15),
boxShadow: [
// BoxShadow(
// color: Colors.grey.withOpacity(0.1),
// blurRadius: 1,
// offset: const Offset(5, 5),
// ),
],
),
child: Stack(
//alignment: Alignment.center,
children: [
AppNetworkImage(
imageUrl: bestdealproduct
@@ -536,7 +429,7 @@ class _HomeScreenState extends State<HomeScreen> {
child: Text(
"${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct.discountPrice))}% \nOFF",
textAlign: TextAlign.center,
style: TextStyle(
style: const TextStyle(
color: Colors.white,
fontWeight:
FontWeight.bold,
@@ -551,7 +444,6 @@ class _HomeScreenState extends State<HomeScreen> {
SizedBox(
height: MediaQuery.of(context).size.height *
0.01),
Text(
bestdealproduct.name ?? "",
textAlign: TextAlign.left,
@@ -571,10 +463,6 @@ class _HomeScreenState extends State<HomeScreen> {
style: context.customMedium(
Colors.grey.withOpacity(0.8), 12),
),
// SizedBox(
// height:
// MediaQuery.of(context).size.height *
// 0.005),
const Spacer(),
Row(
children: [
@@ -635,7 +523,7 @@ class _HomeScreenState extends State<HomeScreen> {
child: provider.isLoading[
bestdealproduct.id] ??
false
? Padding(
? const Padding(
padding:
const EdgeInsets.all(
8.0),
@@ -673,14 +561,9 @@ class _HomeScreenState extends State<HomeScreen> {
}
int calculateDiscountPercentage(double basePrice, double discountPrice) {
print(
"Base Price (Before Discount): $basePrice, Discount Price (After Discount): $discountPrice");
if (basePrice <= 0 || discountPrice <= 0 || discountPrice > basePrice) {
print("Error: Invalid price values.");
return 0;
}
double discountAmount = basePrice - discountPrice;
double discountPercentage = (discountAmount / basePrice) * 100;
@@ -702,7 +585,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
)
: provider.banner.isEmpty
? SizedBox.shrink()
? const SizedBox.shrink()
: CarouselSlider(
options: CarouselOptions(
height: 180,
@@ -719,6 +602,7 @@ class _HomeScreenState extends State<HomeScreen> {
enlargeFactor: 0.3,
),
items: provider.banner.map((banner) {
return Builder(
builder: (BuildContext context) {
return Container(
@@ -733,7 +617,7 @@ class _HomeScreenState extends State<HomeScreen> {
top: 15,
left: 15,
child: SizedBox(
width: 200,
width: 170,
child: Text(
banner.altText ?? "Special Event",
style: context.customExtraBold(
@@ -766,12 +650,19 @@ class _HomeScreenState extends State<HomeScreen> {
),
),
Positioned(
right: 15,
bottom: 15,
child: AppNetworkImage(
imageUrl: banner.imageUrl ??
'https://e7.pngegg.com/pngimages/742/816/png-clipart-coca-cola-can-illustration-coca-cola-soft-drink-surge-pepsi-coke-sweetness-cola-thumbnail.png',
backGroundColor: Colors.transparent,
right: 0,
bottom: 0,
child: Container(
height: 150,
width: 200,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: AppNetworkImage(
imageUrl: banner.imageUrl ??
'https://e7.pngegg.com/pngimages/742/816/png-clipart-coca-cola-can-illustration-coca-cola-soft-drink-surge-pepsi-coke-sweetness-cola-thumbnail.png',
backGroundColor: Colors.transparent,
),
),
),
),
],
@@ -785,7 +676,6 @@ class _HomeScreenState extends State<HomeScreen> {
}
Future<void> _launchUrl(url) async {
print("jdhfjkgh ${url}");
final Uri uri = Uri.parse(url);
if (!await launchUrl(uri, mode: LaunchMode.externalApplication)) {
throw 'Could not launch $url';
@@ -832,7 +722,7 @@ class _HomeScreenState extends State<HomeScreen> {
},
)
: provider.homeproducts.isEmpty
? Center(child: Text(''))
? const Center(child: Text(''))
: GridView.builder(
shrinkWrap: true,
itemCount: provider.homeproducts.length,
@@ -863,7 +753,6 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
Container(
height: 95,
// width: 80,
decoration: BoxDecoration(
color: APPCOLOR.bgGrey,
borderRadius: BorderRadius.circular(5),

View File

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/network_image.dart';
@@ -25,8 +24,7 @@ class _MyOrderScreenState extends State<MyOrderScreen> {
super.initState();
}
String convertUtcToIst(String utcTime)
{
String convertUtcToIst(String utcTime) {
DateTime utcDateTime = DateTime.parse(utcTime).toUtc();
DateTime istDateTime =
@@ -79,16 +77,14 @@ class _MyOrderScreenState extends State<MyOrderScreen> {
child:
Consumer<OrderProvider>(builder: (context, orderProvider, child) {
if (orderProvider.isloading) {
return Center(child: CircularProgressIndicator());
return const Center(child: CircularProgressIndicator());
}
if (orderProvider.orderList.isEmpty) {
return Center(
return const Center(
child: DataNotFound(
imagePath: 'assets/images/wishlist.jpg',
message: "No Order Available! ",
// width: 200.w,
// height: 200.h,
message: "No Order!",
));
}
@@ -129,7 +125,6 @@ class _MyOrderScreenState extends State<MyOrderScreen> {
alignment: Alignment.center,
children: [
AppNetworkImage(
imageUrl: order.orderItems!.first
.productImage,
backGroundColor:

View File

@@ -5,17 +5,9 @@ import 'package:gap/gap.dart';
import 'package:go_router/go_router.dart';
import 'package:grocery_app/src/common_widget/network_image.dart';
import 'package:grocery_app/src/core/routes/routes.dart';
import 'package:grocery_app/src/logic/provider/bottom_navbar_provider.dart';
import 'package:grocery_app/src/logic/provider/home_provider.dart';
import 'package:grocery_app/src/logic/provider/profile_provider.dart';
import 'package:grocery_app/src/ui/card_checkout/card_checkout_screen.dart';
import 'package:grocery_app/src/ui/edit_profile/edit_profile_screen.dart';
import 'package:grocery_app/src/ui/mapscreen/map_screen.dart';
import 'package:grocery_app/src/ui/message/message_screen.dart';
import 'package:grocery_app/src/ui/notification/notification_screen.dart';
import 'package:grocery_app/src/ui/rating_review/rating_review_screen.dart';
import 'package:grocery_app/src/ui/static_page/tersandconditions.dart';
import 'package:grocery_app/src/ui/widgets/custom_text_field.dart';
import 'package:grocery_app/src/ui/widgets/elevated_button.dart';
import 'package:grocery_app/utils/constants/color_constant.dart';
@@ -25,7 +17,6 @@ import 'package:grocery_app/utils/extensions/extensions.dart';
import 'package:grocery_app/utils/extensions/uicontext.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
class ProfileScreen extends StatefulWidget {
const ProfileScreen({super.key});
@@ -68,7 +59,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
@override
Widget build(BuildContext context) {
print("jdfgkjhgjh ${APPSTRING.userProfile}");
return Scaffold(
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
@@ -101,7 +92,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
const SizedBox(
height: 30,
),
//Spacer(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@@ -203,14 +194,14 @@ class _ProfileScreenState extends State<ProfileScreen> {
title: const Text('Edit Profile'),
trailing: Icon(MdiIcons.chevronRight),
),
ListTile(
onTap: () {
_showBottomSheet(context);
},
leading: Icon(MdiIcons.lockOutline),
title: const Text('Change Password'),
trailing: Icon(MdiIcons.chevronRight),
),
// ListTile(
// onTap: () {
// _showBottomSheet(context);
// },
// leading: Icon(MdiIcons.lockOutline),
// title: const Text('Change Password'),
// trailing: Icon(MdiIcons.chevronRight),
// ),
// ListTile(
// onTap: () {
// // Navigator.of(context).push(MaterialPageRoute(
@@ -284,12 +275,7 @@ class _ProfileScreenState extends State<ProfileScreen> {
title: const Text('Term & Conditions'),
trailing: Icon(MdiIcons.chevronRight),
),
// ListTile(
// onTap: () {},
// leading: Icon(MdiIcons.basketOutline),
// title: const Text('Grocery List'),
// trailing: Icon(MdiIcons.chevronRight),
// ),
],
),
),

View File

@@ -748,18 +748,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
@@ -804,10 +804,10 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
material_design_icons_flutter:
dependency: "direct main"
description:
@@ -820,10 +820,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
mime:
dependency: transitive
description:
@@ -1177,10 +1177,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
typed_data:
dependency: transitive
description:
@@ -1297,10 +1297,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.5"
web:
dependency: transitive
description: