Skip to content
Snippets Groups Projects
Commit 97e6dc68 authored by Om Akbari's avatar Om Akbari
Browse files

Adding WishList Screen

parent 1f5fb0a5
No related branches found
No related tags found
1 merge request!3Main product
......@@ -3,7 +3,7 @@ class ProductModel {
String productImage;
int productPrice;
String productId;
String productQuantity;
int productQuantity;
ProductModel(
{this.productId,
this.productImage,
......
import 'package:flutter/material.dart';
import 'package:food_app/screens/home_screens/my_profile/my_profile.dart';
import 'package:food_app/screens/review_cart/review_cart.dart';
import 'package:food_app/screens/wishList/wish_List.dart';
import '../../config/colors.dart';
......@@ -98,7 +99,14 @@ class DrawerSide extends StatelessWidget {
listTile(
iconData: Icons.notifications_outlined, title: "Notification"),
listTile(iconData: Icons.star_outline, title: "Rating & Review"),
listTile(iconData: Icons.favorite_outline, title: "Wishlist"),
listTile(
iconData: Icons.favorite_outline,
title: "Wishlist",
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => WishList(),
));
}),
listTile(iconData: Icons.copy_outlined, title: "Complaints"),
listTile(iconData: Icons.format_quote_outlined, title: "FAQs"),
Container(
......
......@@ -91,6 +91,7 @@ class ReviewCart extends StatelessWidget {
),
SingleItem(
isBool: true,
wishList: false,
productImage: data.cartImage,
productName: data.cartName,
productPrice: data.cartPrice,
......
import 'package:flutter/material.dart';
import 'package:food_app/config/colors.dart';
import 'package:food_app/models/product_model.dart';
import 'package:food_app/models/review_cart_model.dart';
import 'package:food_app/providers/review_cart_provider.dart';
import 'package:food_app/providers/wish_list_provider.dart';
import 'package:food_app/widgets/single_item.dart';
import 'package:provider/provider.dart';
class WishList extends StatefulWidget {
@override
State<WishList> createState() => _WishListState();
}
class _WishListState extends State<WishList> {
WishListProvider wishListProvider;
@override
Widget build(BuildContext context) {
wishListProvider = Provider.of(context);
wishListProvider.getWishListData();
return Scaffold(
appBar: AppBar(
title: Text(
"Wish List",
style: TextStyle(color: textColor, fontSize: 18),
),
),
body: ListView.builder(
itemCount: wishListProvider.getWishList.length,
itemBuilder: (context, index) {
ProductModel data = wishListProvider.getWishList[index];
return Column(
children: [
SizedBox(
height: 10,
),
SingleItem(
isBool: true,
productImage: data.productImage,
productName: data.productName,
productPrice: data.productPrice,
productId: data.productId,
productQuantity: data.productQuantity,
onDelete: () {},
),
],
);
},
),
);
}
}
......@@ -5,6 +5,7 @@ class SingleItem extends StatelessWidget {
bool isBool = false;
String productImage;
String productName;
bool wishList = false;
int productPrice;
String productId;
int productQuantity;
......@@ -16,7 +17,8 @@ class SingleItem extends StatelessWidget {
this.productImage,
this.productName,
this.productPrice,
this.onDelete});
this.onDelete,
this.wishList});
@override
Widget build(BuildContext context) {
return Column(
......@@ -29,7 +31,9 @@ class SingleItem extends StatelessWidget {
child: Container(
height: 100,
child: Center(
child: Image.network(productImage),
child: Image.network(
productImage,
),
),
),
),
......@@ -129,8 +133,8 @@ class SingleItem extends StatelessWidget {
),
)
: Padding(
padding: const EdgeInsets.only(top: 8),
child: Column(
padding: const EdgeInsets.only(top: 8),
child: Column(
children: [
InkWell(
onTap: onDelete,
......@@ -177,7 +181,7 @@ class SingleItem extends StatelessWidget {
)
],
),
)),
)),
),
),
],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment