diff --git a/lib/views/main/customer/favorites.dart b/lib/views/main/customer/favorites.dart index 6115445..4eefc94 100644 --- a/lib/views/main/customer/favorites.dart +++ b/lib/views/main/customer/favorites.dart @@ -1,6 +1,14 @@ +import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:firebase_storage/firebase_storage.dart'; import 'package:flutter/material.dart'; import '../../../components/search_box.dart'; import '../../../constants/colors.dart'; +import '../../../utilities/products_stream_builder.dart'; +import '../product_categories/children.dart'; +import '../product_categories/men.dart'; +import '../product_categories/others.dart'; +import '../product_categories/sneakers.dart'; +import '../product_categories/women.dart'; class FavoriteScreen extends StatefulWidget { const FavoriteScreen({Key? key}) : super(key: key); @@ -10,39 +18,33 @@ class FavoriteScreen extends StatefulWidget { } class _FavoriteScreenState extends State { + Stream productStream = FirebaseFirestore.instance + .collection('products') + .where('isFav', isEqualTo: true) + .snapshots(); + @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.only( top: 50, - right: 18.0, - left: 18.0, ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SearchBox(), - const SizedBox(height: 20), - Center( - child: Column( - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(20), - child: Image.asset('assets/images/love.gif'), - ), - const SizedBox(height: 10), - const Text( - 'No favorite products', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 20, - color: primaryColor, - ), - ) - ], + child: SingleChildScrollView( + child: Column( + children: [ + Container( + margin: const EdgeInsets.symmetric(horizontal: 18), + child: const SearchBox(), + ), + const SizedBox(height: 10), + SizedBox( + height: MediaQuery.of(context).size.height / 1.2, + child: ProductStreamBuilder( + productStream: productStream, + ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/views/main/seller/home.dart b/lib/views/main/seller/home.dart index 9b3251e..9043e96 100644 --- a/lib/views/main/seller/home.dart +++ b/lib/views/main/seller/home.dart @@ -17,9 +17,13 @@ class HomeScreen extends StatefulWidget { class _HomeScreenState extends State { var currentTabIndex = 0; - - - var categories = ['Men', 'Women', 'Children', 'Sneakers', 'Others']; + var categories = [ + 'Men', + 'Women', + 'Children', + 'Sneakers', + 'Others', + ]; final categoriesList = const [ MenWears(), @@ -49,7 +53,6 @@ class _HomeScreenState extends State { ); } - @override Widget build(BuildContext context) { return Padding( diff --git a/cart_screen.png b/screenshots/New folder/cart_screen.png similarity index 100% rename from cart_screen.png rename to screenshots/New folder/cart_screen.png diff --git a/screenshots/New folder/favorites.png b/screenshots/New folder/favorites.png new file mode 100644 index 0000000..80b12ff Binary files /dev/null and b/screenshots/New folder/favorites.png differ diff --git a/prod_2.png b/screenshots/New folder/prod_2.png similarity index 100% rename from prod_2.png rename to screenshots/New folder/prod_2.png diff --git a/screenshots/New folder/product_adj.png b/screenshots/New folder/product_adj.png deleted file mode 100644 index 28eea1d..0000000 Binary files a/screenshots/New folder/product_adj.png and /dev/null differ diff --git a/screenshots/New folder/store_adj.png b/screenshots/New folder/store_adj.png deleted file mode 100644 index 467ff95..0000000 Binary files a/screenshots/New folder/store_adj.png and /dev/null differ