Skip to content

Commit

Permalink
task: category and product sub category
Browse files Browse the repository at this point in the history
  • Loading branch information
Atuoha committed Oct 10, 2022
1 parent 1f557b0 commit 43daacf
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/components/home_carousel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Widget kSlideContainer(String imgUrl) {
CarouselSlider buildCarouselSlider() {
return CarouselSlider.builder(
options: CarouselOptions(
viewportFraction: 0.6,
viewportFraction: 0.5,
aspectRatio: 2.0,
height: 250,
enlargeStrategy: CenterPageEnlargeStrategy.scale,
Expand Down
4 changes: 2 additions & 2 deletions lib/utilities/category_gridview.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import '../constants/colors.dart';
import '../views/main/sub_category/sub_category.dart';
import '../views/main/product/sub_category_products.dart';

class CategoryGridView extends StatelessWidget {
const CategoryGridView({
Expand Down Expand Up @@ -69,4 +69,4 @@ class CategoryGridView extends StatelessWidget {
),
);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

import '../../../constants/colors.dart';
import '../../../utilities/products_stream_builder.dart';

class SubCategoryScreen extends StatelessWidget {
const SubCategoryScreen({
Expand All @@ -14,6 +16,12 @@ class SubCategoryScreen extends StatelessWidget {

@override
Widget build(BuildContext context) {
Stream<QuerySnapshot> productStream = FirebaseFirestore.instance
.collection('products')
.where('category', isEqualTo: category)
.where('sub_category', isEqualTo: subCategory)
.snapshots();

SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
Expand All @@ -34,9 +42,17 @@ class SubCategoryScreen extends StatelessWidget {
),
),
),
body: const Padding(
padding: EdgeInsets.symmetric(horizontal: 18),
child: Text(''),
body: SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: MediaQuery.of(context).size.height / 1.2,
child: ProductStreamBuilder(
productStream: productStream,
),
),
],
),
),
);
}
Expand Down
Binary file added screenshots/New folder/categories.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/New folder/men.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/New folder/shirt_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/New folder/sneakers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/New folder/sneakers_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/New folder/sub_categories.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 43daacf

Please sign in to comment.