fixed ui issue
This commit is contained in:
@@ -6,8 +6,8 @@ import 'package:grocery_app/utils/constants/color_constant.dart';
|
||||
|
||||
//Custom AppBar widget
|
||||
class AppNetworkImage extends StatelessWidget {
|
||||
final double height;
|
||||
final double width;
|
||||
// final double height;
|
||||
// final double width;
|
||||
final String imageUrl;
|
||||
final double? noImageTextSize;
|
||||
final bool isBorderShow;
|
||||
@@ -22,8 +22,6 @@ class AppNetworkImage extends StatelessWidget {
|
||||
|
||||
const AppNetworkImage(
|
||||
{super.key,
|
||||
required this.height,
|
||||
required this.width,
|
||||
required this.imageUrl,
|
||||
this.noImageTextSize,
|
||||
this.isBorderShow = false,
|
||||
@@ -38,15 +36,12 @@ class AppNetworkImage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return
|
||||
CachedNetworkImage(
|
||||
return CachedNetworkImage(
|
||||
|
||||
/// height: height,
|
||||
///width: width,
|
||||
errorWidget: (context, url, error) {
|
||||
return Container(
|
||||
height: height,
|
||||
width: width,
|
||||
decoration: BoxDecoration(
|
||||
color: backGroundColor,
|
||||
borderRadius: BorderRadius.circular(radius ?? 0),
|
||||
@@ -57,15 +52,12 @@ class AppNetworkImage extends StatelessWidget {
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
APPASSETS.placeHolder,
|
||||
height: height * 0.4,
|
||||
color: imageColor,
|
||||
)),
|
||||
);
|
||||
},
|
||||
placeholder: (context, url) {
|
||||
return Container(
|
||||
width: width,
|
||||
height: height,
|
||||
decoration: BoxDecoration(
|
||||
color: backGroundColor,
|
||||
borderRadius: BorderRadius.circular(radius ?? 0),
|
||||
@@ -81,7 +73,7 @@ class AppNetworkImage extends StatelessWidget {
|
||||
imageBuilder: (context, cIMage) {
|
||||
return Container(
|
||||
// width: width,
|
||||
height: 100,
|
||||
// height: 100,
|
||||
decoration: BoxDecoration(
|
||||
color: backGroundColor,
|
||||
borderRadius: isFromSlider
|
||||
@@ -109,7 +101,5 @@ class AppNetworkImage extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
imageUrl: imageUrl);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +39,15 @@ class ProductProvider extends ChangeNotifier {
|
||||
|
||||
bool iscroll = true;
|
||||
|
||||
Future<void> gettAllProduct(
|
||||
BuildContext context, String id, bool status, String search) async {
|
||||
Future<void> gettAllProduct(BuildContext context, String id, bool status,
|
||||
String search, bool first) async {
|
||||
if (isLoadingg || !hasMore) return;
|
||||
print("kjldfgjklfjkdgjkhlfg");
|
||||
|
||||
if (first) {
|
||||
print("kdjfhgkfkjdghkjkdfg");
|
||||
products.clear();
|
||||
notifyListeners();
|
||||
}
|
||||
if (id.isNotEmpty) {
|
||||
products.clear();
|
||||
|
||||
@@ -81,6 +86,8 @@ class ProductProvider extends ChangeNotifier {
|
||||
// hasMore = false;
|
||||
// }
|
||||
|
||||
print("jdksgfkgkbfgh ${response}");
|
||||
|
||||
if (response.data != null && response.data!.isNotEmpty) {
|
||||
if (id.isNotEmpty) {
|
||||
products = response.data!;
|
||||
|
||||
@@ -166,8 +166,6 @@ class _BestDealScreenState extends State<BestDealScreen> {
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: AppNetworkImage(
|
||||
height: 70,
|
||||
width: 70,
|
||||
radius: 10,
|
||||
imageUrl: provider.lastImageurl ??
|
||||
"https://5.imimg.com/data5/SELLER/Default/2024/2/385126988/OL/DA/VW/8627346/1l-fortune-sunflower-oil.jpg",
|
||||
@@ -326,166 +324,155 @@ class _BestDealScreenState extends State<BestDealScreen> {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.15, // Dynamic height
|
||||
width: MediaQuery.of(context).size.width *
|
||||
0.4, // Dynamic width
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.bgGrey,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Center(
|
||||
child: AppNetworkImage(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.13,
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.35,
|
||||
imageUrl: bestdealproduct
|
||||
.productImages?.first.url ??
|
||||
"",
|
||||
backGroundColor: Colors.transparent,
|
||||
radius: 10,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 1,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct.discountPrice))}% OFF",
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 15)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
height: MediaQuery.of(context).size.height * 0.15,
|
||||
// width: MediaQuery.of(context).size.width *
|
||||
// 0.4, // Dynamic width
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.bgGrey,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.005),
|
||||
Text(
|
||||
bestdealproduct.name ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 16),
|
||||
),
|
||||
Text(
|
||||
bestdealproduct.unit ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
12,
|
||||
),
|
||||
),
|
||||
if (bestdealproduct!.quantity > 0)
|
||||
Text("In Stock ",
|
||||
style:
|
||||
TextStyle(color: Colors.green, fontSize: 14)),
|
||||
Spacer(),
|
||||
Row(
|
||||
child: Stack(
|
||||
//alignment: Alignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style:
|
||||
context.customSemiBold(Colors.black, 15),
|
||||
),
|
||||
Text(
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context
|
||||
.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
15,
|
||||
)
|
||||
.copyWith(
|
||||
decoration: TextDecoration.lineThrough,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
if (await SharedPrefUtils.getToken() !=
|
||||
null) {
|
||||
await provider.addToWithCart(
|
||||
context,
|
||||
bestdealproduct.id!,
|
||||
bestdealproduct,
|
||||
bestdealproduct
|
||||
.productImages?.first.url);
|
||||
} else {
|
||||
context.push(MyRoutes.SIGNUP);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.035,
|
||||
width:
|
||||
MediaQuery.of(context).size.width * 0.1,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.lightGreen,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: provider.isLoading[
|
||||
bestdealproduct.id] ??
|
||||
false
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 10,
|
||||
width: 10,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
// provider.cartItems
|
||||
// .contains(bestdealproduct.id)
|
||||
// ? 'Added'
|
||||
// :
|
||||
'Add',
|
||||
style: context.customRegular(
|
||||
Colors.white, 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: AppNetworkImage(
|
||||
imageUrl:
|
||||
bestdealproduct.productImages?.first.url ??
|
||||
"",
|
||||
backGroundColor: Colors.transparent,
|
||||
radius: 10,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 1,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct.discountPrice))}% \nOFF",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.005),
|
||||
Text(
|
||||
bestdealproduct.name ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(APPCOLOR.balck1A1A1A, 16),
|
||||
),
|
||||
Text(
|
||||
bestdealproduct.unit ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
12,
|
||||
),
|
||||
),
|
||||
if (bestdealproduct!.quantity > 0)
|
||||
Text("In Stock ",
|
||||
style:
|
||||
TextStyle(color: Colors.green, fontSize: 14)),
|
||||
Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customSemiBold(Colors.black, 15),
|
||||
),
|
||||
Text(
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context
|
||||
.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
15,
|
||||
)
|
||||
.copyWith(
|
||||
decoration: TextDecoration.lineThrough,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
if (await SharedPrefUtils.getToken() != null) {
|
||||
await provider.addToWithCart(
|
||||
context,
|
||||
bestdealproduct.id!,
|
||||
bestdealproduct,
|
||||
bestdealproduct.productImages?.first.url);
|
||||
} else {
|
||||
context.push(MyRoutes.SIGNUP);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height * 0.035,
|
||||
width: MediaQuery.of(context).size.width * 0.1,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.lightGreen,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: provider
|
||||
.isLoading[bestdealproduct.id] ??
|
||||
false
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
height: 10,
|
||||
width: 10,
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.white,
|
||||
strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
// provider.cartItems
|
||||
// .contains(bestdealproduct.id)
|
||||
// ? 'Added'
|
||||
// :
|
||||
'Add',
|
||||
style: context.customRegular(
|
||||
Colors.white, 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -156,10 +156,7 @@ class _MycartState extends State<Mycart> {
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.08,
|
||||
width: cardWidth * 0.7,
|
||||
|
||||
imageUrl: bestdealproduct
|
||||
.productImages?.first?.url ??
|
||||
"",
|
||||
@@ -473,8 +470,7 @@ class _MycartState extends State<Mycart> {
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: AppNetworkImage(
|
||||
width: 60.w,
|
||||
height: 70.h,
|
||||
|
||||
imageUrl:
|
||||
items.product!.productImages!.first.url ?? " ",
|
||||
backGroundColor: APPCOLOR.bgGrey,
|
||||
@@ -1115,8 +1111,7 @@ class _MycartState extends State<Mycart> {
|
||||
right: 15,
|
||||
bottom: 15,
|
||||
child: AppNetworkImage(
|
||||
height: 130,
|
||||
width: 150,
|
||||
|
||||
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,
|
||||
|
||||
@@ -85,8 +85,7 @@ class _FavouriteScreenState extends State<FavouriteScreen>
|
||||
top: 0,
|
||||
right: 0,
|
||||
child: AppNetworkImage(
|
||||
height: 70,
|
||||
width: 70,
|
||||
|
||||
radius: 10,
|
||||
imageUrl: wishListProvider
|
||||
.productDatumlastImageurl ??
|
||||
@@ -214,8 +213,7 @@ class _FavouriteScreenState extends State<FavouriteScreen>
|
||||
.product!.productImages!.first.url ??
|
||||
"https://i.pinimg.com/originals/a5/f3/5f/a5f35fb23e942809da3df91b23718e8d.png",
|
||||
backGroundColor: APPCOLOR.bgGrey,
|
||||
height: 20,
|
||||
width: 20,
|
||||
|
||||
radius: 10,
|
||||
),
|
||||
),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -93,8 +93,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
title: Row(
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height: 25,
|
||||
width: 25,
|
||||
imageUrl: suggestion.productImages!.first.url,
|
||||
backGroundColor: APPCOLOR.bgGrey,
|
||||
radius: 10,
|
||||
@@ -308,6 +306,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
// return const FruitVeggieDetail();
|
||||
// },
|
||||
// ));
|
||||
|
||||
|
||||
context.push(MyRoutes.FRUITVEGGIEDETAIL);
|
||||
},
|
||||
@@ -379,8 +378,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
itemBuilder: (context, index) {
|
||||
double cardWidth = MediaQuery.of(context).size.width * 0.4;
|
||||
return Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(right: 10, bottom: 5, top: 5),
|
||||
padding: const EdgeInsets.only(right: 0, bottom: 0, top: 0),
|
||||
child: Skeletonizer(
|
||||
enabled: provider.isBestdealingloading,
|
||||
child: Container(
|
||||
@@ -478,196 +476,192 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 10, bottom: 5, top: 5),
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
width: cardWidth,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.1),
|
||||
blurRadius: 1,
|
||||
offset: const Offset(5, 5),
|
||||
),
|
||||
// BoxShadow(
|
||||
// color: Colors.grey.withOpacity(0.1),
|
||||
// blurRadius: 1,
|
||||
// offset: const Offset(5, 5),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.12,
|
||||
width: cardWidth * 0.9,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.bgGrey,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height: MediaQuery.of(context)
|
||||
.size
|
||||
.height *
|
||||
0.08,
|
||||
width: cardWidth * 0.7,
|
||||
imageUrl: bestdealproduct
|
||||
.productImages
|
||||
?.first
|
||||
?.url ??
|
||||
"",
|
||||
radius: 10,
|
||||
backGroundColor: Colors.transparent,
|
||||
),
|
||||
Positioned(
|
||||
right: 1,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 10, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius:
|
||||
BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct.discountPrice))}% OFF",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 18)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(
|
||||
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),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.01),
|
||||
Text(
|
||||
bestdealproduct.name ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
APPCOLOR.balck1A1A1A, 14),
|
||||
),
|
||||
SizedBox(
|
||||
height:
|
||||
MediaQuery.of(context).size.height *
|
||||
0.005),
|
||||
Text(
|
||||
bestdealproduct.unit ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
Colors.grey.withOpacity(0.8), 12),
|
||||
),
|
||||
// SizedBox(
|
||||
// height:
|
||||
// MediaQuery.of(context).size.height *
|
||||
// 0.005),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customSemiBold(
|
||||
Colors.black, 15),
|
||||
),
|
||||
Text(
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context
|
||||
.customMedium(
|
||||
Colors.grey
|
||||
.withOpacity(0.8),
|
||||
15)
|
||||
.copyWith(
|
||||
decoration: TextDecoration
|
||||
.lineThrough),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
if (await SharedPrefUtils
|
||||
.getToken() !=
|
||||
null) {
|
||||
await provider.addToCart(context,
|
||||
bestdealproduct.id!, 1);
|
||||
} else {
|
||||
context.push(MyRoutes.SIGNUP);
|
||||
}
|
||||
},
|
||||
|
||||
child: Stack(
|
||||
//alignment: Alignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
imageUrl: bestdealproduct
|
||||
.productImages?.first?.url ??
|
||||
"",
|
||||
radius: 10,
|
||||
backGroundColor: Colors.transparent,
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 5,
|
||||
child: Container(
|
||||
height: MediaQuery.of(context)
|
||||
.size
|
||||
.height *
|
||||
0.035,
|
||||
width: MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.1,
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.lightGreen,
|
||||
color: Colors.red,
|
||||
borderRadius:
|
||||
BorderRadius.circular(5),
|
||||
BorderRadius.circular(100),
|
||||
),
|
||||
child: Center(
|
||||
child: provider.isLoading[
|
||||
bestdealproduct.id] ??
|
||||
false
|
||||
? Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
8.0),
|
||||
child: SizedBox(
|
||||
height: 10,
|
||||
width: 10,
|
||||
child:
|
||||
CircularProgressIndicator(
|
||||
color: Colors
|
||||
.white,
|
||||
strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Add',
|
||||
style:
|
||||
context.customRegular(
|
||||
Colors.white, 12),
|
||||
),
|
||||
child: Text(
|
||||
"${calculateDiscountPercentage(double.parse(bestdealproduct.basePrice), double.parse(bestdealproduct.discountPrice))}% \nOFF",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight:
|
||||
FontWeight.bold,
|
||||
fontSize: 10)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.01),
|
||||
|
||||
Text(
|
||||
bestdealproduct.name ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
APPCOLOR.balck1A1A1A, 14),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.005),
|
||||
Text(
|
||||
bestdealproduct.unit ?? "",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
Colors.grey.withOpacity(0.8), 12),
|
||||
),
|
||||
// SizedBox(
|
||||
// height:
|
||||
// MediaQuery.of(context).size.height *
|
||||
// 0.005),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
"₹${bestdealproduct.discountPrice ?? ""} ",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customSemiBold(
|
||||
Colors.black, 15),
|
||||
),
|
||||
Text(
|
||||
"₹${bestdealproduct.basePrice ?? ""}",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context
|
||||
.customMedium(
|
||||
Colors.grey.withOpacity(0.8),
|
||||
15)
|
||||
.copyWith(
|
||||
decoration: TextDecoration
|
||||
.lineThrough),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: GestureDetector(
|
||||
onTap: () async {
|
||||
if (await SharedPrefUtils
|
||||
.getToken() !=
|
||||
null) {
|
||||
await provider.addToCart(context,
|
||||
bestdealproduct.id!, 1);
|
||||
} else {
|
||||
context.push(MyRoutes.SIGNUP);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.of(context)
|
||||
.size
|
||||
.height *
|
||||
0.035,
|
||||
width: MediaQuery.of(context)
|
||||
.size
|
||||
.width *
|
||||
0.1,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.lightGreen,
|
||||
borderRadius:
|
||||
BorderRadius.circular(5),
|
||||
),
|
||||
child: Center(
|
||||
child: provider.isLoading[
|
||||
bestdealproduct.id] ??
|
||||
false
|
||||
? Padding(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
8.0),
|
||||
child: SizedBox(
|
||||
height: 10,
|
||||
width: 10,
|
||||
child:
|
||||
CircularProgressIndicator(
|
||||
color:
|
||||
Colors.white,
|
||||
strokeWidth: 2),
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'Add',
|
||||
style:
|
||||
context.customRegular(
|
||||
Colors.white, 12),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -775,8 +769,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
right: 15,
|
||||
bottom: 15,
|
||||
child: AppNetworkImage(
|
||||
height: 130,
|
||||
width: 150,
|
||||
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,
|
||||
@@ -850,7 +842,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
crossAxisSpacing: 5,
|
||||
mainAxisSpacing: 5,
|
||||
childAspectRatio: MediaQuery.of(context).size.width /
|
||||
(MediaQuery.of(context).size.height / 1.2),
|
||||
(MediaQuery.of(context).size.height / 1.4),
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
var product = provider.homeproducts[index];
|
||||
@@ -870,13 +862,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 95,
|
||||
// width: 80,
|
||||
decoration: BoxDecoration(
|
||||
color: APPCOLOR.bgGrey,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: AppNetworkImage(
|
||||
height: 80,
|
||||
width: 80,
|
||||
imageUrl: product.productImages!.first.url,
|
||||
backGroundColor: APPCOLOR.bgGrey,
|
||||
radius: 10,
|
||||
@@ -886,7 +878,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
Text(
|
||||
product.name ?? "",
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: context.customMedium(
|
||||
APPCOLOR.balck1A1A1A, 14),
|
||||
|
||||
@@ -321,8 +321,7 @@ class _OrderDetailsScreenState extends State<OrderDetailsScreen> {
|
||||
width: 50,
|
||||
height: 50,
|
||||
child: AppNetworkImage(
|
||||
height: MediaQuery.of(context).size.height * 0.08,
|
||||
width: 48,
|
||||
|
||||
imageUrl: orderitem.productImage ?? "",
|
||||
backGroundColor: Colors.transparent,
|
||||
),
|
||||
|
||||
@@ -129,11 +129,7 @@ class _MyOrderScreenState extends State<MyOrderScreen> {
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height: MediaQuery.of(context)
|
||||
.size
|
||||
.height *
|
||||
0.08,
|
||||
width: 48,
|
||||
|
||||
imageUrl: order.orderItems!.first
|
||||
.productImage,
|
||||
backGroundColor:
|
||||
|
||||
@@ -148,8 +148,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
var productImage =
|
||||
provider.productDetails.data!.productImages![index];
|
||||
return AppNetworkImage(
|
||||
height: MediaQuery.of(context).size.height * 0.08,
|
||||
width: 2000,
|
||||
|
||||
imageUrl: productImage.url,
|
||||
backGroundColor: Colors.transparent,
|
||||
radius: 10,
|
||||
@@ -953,8 +952,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: AppNetworkImage(
|
||||
height: 90,
|
||||
width: 90,
|
||||
|
||||
imageUrl: "",
|
||||
backGroundColor: Colors.transparent,
|
||||
),
|
||||
@@ -1028,9 +1026,7 @@ class _ProductDetailsState extends State<ProductDetails> {
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height: MediaQuery.of(context).size.height *
|
||||
0.08,
|
||||
width: cardWidth * 0.7,
|
||||
|
||||
imageUrl: bestdealproduct
|
||||
.productImages?.first?.url ??
|
||||
"",
|
||||
|
||||
@@ -110,13 +110,15 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
),
|
||||
Stack(
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
Container(
|
||||
height: top < 150 ? 30 : 50,
|
||||
width: top < 150 ? 30 : 50,
|
||||
imageUrl: provider.profile ?? "",
|
||||
radius: 90,
|
||||
backGroundColor: Colors.white,
|
||||
boxFit: BoxFit.fill,
|
||||
child: AppNetworkImage(
|
||||
imageUrl: provider.profile ?? "",
|
||||
radius: 90,
|
||||
backGroundColor: Colors.white,
|
||||
boxFit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -85,8 +85,7 @@ class _RatingReviewScreenState extends State<RatingReviewScreen> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
AppNetworkImage(
|
||||
height: 100,
|
||||
width: 100,
|
||||
|
||||
imageUrl: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTdQLwDqDwd2JfzifvfBTFT8I7iKFFevcedYg&s",
|
||||
backGroundColor: Colors.white,
|
||||
boxFit: BoxFit.cover,
|
||||
|
||||
Reference in New Issue
Block a user