updateProfile

This commit is contained in:
2025-02-03 01:29:42 +05:30
parent 42aaa7cdad
commit 1f7254ecaa
48 changed files with 6088 additions and 2473 deletions

View File

@@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:fluttertoast/fluttertoast.dart';
@@ -79,10 +80,25 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
Widget productWidget() {
return Consumer<ProductProvider>(builder: (context, provider, child) {
if (provider.isLoadingg) {
if (provider.isLoadingg)
{
return Padding(
padding: const EdgeInsets.only(left: 120),
child: CircularProgressIndicator(),
child: Center(
child: Container(
width: 30,
height: 30,
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: APPCOLOR.bgGrey,
width: 1,
)),
child: const Center(
child: CupertinoActivityIndicator(),
),
)),
);
} else if (provider.products.isEmpty) {
return Padding(
@@ -106,8 +122,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
crossAxisSpacing: 10,
mainAxisSpacing: 10,
),
itemBuilder: (context, index)
{
itemBuilder: (context, index) {
var product = provider.products[index];
return InkWell(
@@ -189,31 +204,31 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
// ),
// ),
Positioned(
right: 5,
top: 5,
child: InkWell(
onTap: () async {
if (await SharedPrefUtils
.getToken() !=
null) {
provider.toggleWishlist(
context, product.id!);
} else {
context.push(MyRoutes.SIGNUP);
}
},
child: Icon(
provider.wishlist.contains(product.id)
? Icons.favorite
: Icons.favorite_border,
color: provider.wishlist
.contains(product.id)
? Colors.red
: Colors.grey,
),
),
),
// Positioned(
// right: 5,
// top: 5,
// child: InkWell(
// onTap: () async {
// if (await SharedPrefUtils
// .getToken() !=
// null) {
// provider.toggleWishlist(
// context, product.id!);
// } else {
// context.push(MyRoutes.SIGNUP);
// }
// },
// child: Icon(
// provider.wishlist.contains(product.id)
// ? Icons.favorite
// : Icons.favorite_border,
// color: provider.wishlist
// .contains(product.id)
// ? Colors.red
// : Colors.grey,
// ),
// ),
// ),
],
),
),
@@ -221,7 +236,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
Text(
product.name ?? " ",
textAlign: TextAlign.left,
maxLines: 2,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: context.customMedium(
APPCOLOR.balck1A1A1A, 14),
@@ -238,6 +253,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
),
),
const SizedBox(height: 3),
Spacer(),
Row(
children: [
Column(
@@ -281,7 +297,7 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
if (await SharedPrefUtils.getToken() !=
null) {
await provider.addToCart(
context, product.id!);
context, product.id!, 1);
} else {
context.push(MyRoutes.SIGNUP);
}
@@ -327,6 +343,8 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
),
),
),
],
),
],
@@ -348,7 +366,21 @@ class _FruitVeggieDetailState extends State<FruitVeggieDetail> {
final activeIndexProvider = Provider.of<ProductProvider>(context);
return Consumer<ProductProvider>(builder: (context, provider, child) {
if (provider.iscategroyloading) {
return Center(child: CircularProgressIndicator());
return Center(
child: Container(
width: 20,
height: 20,
decoration: BoxDecoration(
color: APPCOLOR.bgGrey,
borderRadius: BorderRadius.circular(10),
border: Border.all(
color: APPCOLOR.bgGrey,
width: 1,
)),
child: const Center(
child: CupertinoActivityIndicator(),
),
));
} else if (provider.categoryList.isEmpty) {
return Center(child: Text('No products available'));
} else {