Skip to content

Commit

Permalink
Red-Tires-E-commerce-Flutter-app
Browse files Browse the repository at this point in the history
  • Loading branch information
ElshiatyTube committed Oct 15, 2021
1 parent 4438c34 commit 2b4b561
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 92 deletions.
Binary file added assets/images/appbarlogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/logoo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 22 additions & 22 deletions lib/cubit/home_layout/home_layout_state.dart
Expand Up @@ -4,23 +4,23 @@ abstract class HomeLayoutStates{}

class HomeLayoutInitState extends HomeLayoutStates {}

class UpdateMainUserTokenStateSuccess extends HomeLayoutInitState{}
class UpdateMainUserTokenStateSuccess extends HomeLayoutStates{}

class UpdateMainUserTokenStateFailed extends HomeLayoutInitState{}
class UpdateMainUserTokenStateFailed extends HomeLayoutStates{}

class UpdateMainUserTokenStateNotLogin extends HomeLayoutInitState{}
class UpdateMainUserTokenStateNotLogin extends HomeLayoutStates{}


//notification
class GetNotifyDataBackgroundSuccess extends HomeLayoutInitState{
class GetNotifyDataBackgroundSuccess extends HomeLayoutStates{
final String backgroundData;
GetNotifyDataBackgroundSuccess(this.backgroundData);
}
class InitFirebaseBackgroundFCMSucess extends HomeLayoutInitState{}
class InitFirebaseBackgroundFCMSucess extends HomeLayoutStates{}

//Get User Data States
class GetUserDataSuccessState extends HomeLayoutInitState{}
class GetUserDataFailedState extends HomeLayoutInitState{
class GetUserDataSuccessState extends HomeLayoutStates{}
class GetUserDataFailedState extends HomeLayoutStates{
final String error;

GetUserDataFailedState(this.error);
Expand All @@ -29,43 +29,43 @@ class GetUserDataFailedState extends HomeLayoutInitState{


//Home States
class SliderIndicatorChange extends HomeLayoutInitState{}
class SliderIndicatorChange extends HomeLayoutStates{}

//Category States
class LoadingCategoriesState extends HomeLayoutInitState{}
class SuccessCategoriesState extends HomeLayoutInitState{
class LoadingCategoriesState extends HomeLayoutStates{}
class SuccessCategoriesState extends HomeLayoutStates{

}
class FailedCategoriesState extends HomeLayoutInitState{
class FailedCategoriesState extends HomeLayoutStates{
final String error;

FailedCategoriesState(this.error);
}
//Products States
class LoadingProductsState extends HomeLayoutInitState{}
class SuccessProductsState extends HomeLayoutInitState{
class LoadingProductsState extends HomeLayoutStates{}
class SuccessProductsState extends HomeLayoutStates{

}
class FailedProductsState extends HomeLayoutInitState{
class FailedProductsState extends HomeLayoutStates{
final String error;

FailedProductsState(this.error);
}

//Navigation States
class ChangeBottomNavState extends HomeLayoutInitState{}
class NavigateToProductListByCategoryState extends HomeLayoutInitState{
class ChangeBottomNavState extends HomeLayoutStates{}
class NavigateToProductListByCategoryState extends HomeLayoutStates{
final CategoriesModel categoryItem;

NavigateToProductListByCategoryState(this.categoryItem);
}
class NavigateToToCategoryListState extends HomeLayoutInitState{}
class NavigateToToCategoryListState extends HomeLayoutStates{}


//Setting Screen
class WelcomeState extends HomeLayoutInitState{}
class WelcomeState extends HomeLayoutStates{}

class GetStoreInfoStateSuccess extends HomeLayoutInitState{
class GetStoreInfoStateSuccess extends HomeLayoutStates{
final bool openState;
final int androidVersion,iosVersion;
final String appleId;
Expand All @@ -76,9 +76,9 @@ class GetStoreInfoStateSuccess extends HomeLayoutInitState{


//Contact Screen
class UserSubmitContactMessageLoadingState extends HomeLayoutInitState{}
class UserSubmitContactMessageSuccessState extends HomeLayoutInitState{}
class UserSubmitContactMessageErrorState extends HomeLayoutInitState{
class UserSubmitContactMessageLoadingState extends HomeLayoutStates{}
class UserSubmitContactMessageSuccessState extends HomeLayoutStates{}
class UserSubmitContactMessageErrorState extends HomeLayoutStates{
final String error;

UserSubmitContactMessageErrorState(this.error);
Expand Down
2 changes: 1 addition & 1 deletion lib/presentaion/layouts/home_layout.dart
Expand Up @@ -85,7 +85,7 @@ class HomeLayout extends StatelessWidget {
onPressed: () {
cubit.changeBottom(1);
},
) : Image.asset('assets/images/logo.png'),
) : Image.asset('assets/images/appbarlogo.png',),
title: DefaultFormField(
bgColor: MyColors.wightBG,
isDense: true,
Expand Down
4 changes: 2 additions & 2 deletions lib/presentaion/modules/categories/categories_screen.dart
Expand Up @@ -37,7 +37,7 @@ class CategoriesScreen extends StatelessWidget {
width: MediaQuery.of(context).size.width,
height: 110,
imageUrl:
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/istockphoto-907575112-170667a.jpg?alt=media&token=f4b86e6d-ebb7-461f-9785-c28b4c52dbdf',
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2Fslide2.jpg?alt=media&token=705ed643-e95a-44f0-bf3d-3fa3823dff07',
fit: BoxFit.cover,
placeholder: (context, url) => Container(),
errorWidget: (context, url, error) => const Icon(Icons.error),
Expand All @@ -47,7 +47,7 @@ class CategoriesScreen extends StatelessWidget {
Container(
padding: const EdgeInsets.all(12),
child: const Text(
'Choose your BRAND',
'',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.white,
Expand Down
75 changes: 38 additions & 37 deletions lib/presentaion/modules/home/home_screen.dart
@@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:conditional_builder_null_safety/conditional_builder_null_safety.dart';
import 'package:easy_localization/src/public_ext.dart';
Expand Down Expand Up @@ -33,16 +34,16 @@ class _HomeScreenState extends State<HomeScreen> {
//Static UI, You Can make it dynamic with the same fetch data approach I use in this project.
offers.add(OfferMode(
'123',
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/modern-cars-are-studio-room-3d-illustration-3d-render_37416-450.jpg?alt=media&token=7c2e03ad-daa9-4295-b618-3c6b3cfd36d6',
'ALL CAR TIRES YOU NEED1'));
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2Fslide1.jpg?alt=media&token=88dffeed-5ec9-4807-a7c2-6c7c68c2fa8f',
'ALL YOU NEED1'));
offers.add(OfferMode(
'123',
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/carsslider.jpg?alt=media&token=363bf932-90e8-41cb-af3c-50cf0a6ca795',
'ALL CAR TIRES YOU NEED3'));
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2Fslide2.jpg?alt=media&token=705ed643-e95a-44f0-bf3d-3fa3823dff07',
'ALL YOU NEED2'));
offers.add(OfferMode(
'123',
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/istockphoto-907575112-170667a.jpg?alt=media&token=f4b86e6d-ebb7-461f-9785-c28b4c52dbdf',
'ALL CAR TIRES YOU NEED3'));
'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2Fslide3.jpg?alt=media&token=39a18686-2ed0-43ca-83f2-e889bdfff3b8',
'All YOU NEED3'));
}
@override
Widget build(BuildContext context) {
Expand All @@ -57,7 +58,7 @@ class _HomeScreenState extends State<HomeScreen> {
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text('Brands',
const Text('Categories',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 15.0)),
const Spacer(),
Expand Down Expand Up @@ -91,7 +92,7 @@ class _HomeScreenState extends State<HomeScreen> {
condition: cubit.categoryList.isNotEmpty,
builder: (BuildContext context) {
return SizedBox(
height: 115.0,
height: 120.0,
child: ListView.separated(
physics: const BouncingScrollPhysics(),
scrollDirection: Axis.horizontal,
Expand Down Expand Up @@ -148,7 +149,7 @@ class _HomeScreenState extends State<HomeScreen> {
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Text('Special Offers',
const Text('Offers',
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 15.0)),
const Spacer(),
Expand Down Expand Up @@ -186,8 +187,8 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Image.asset(
'assets/images/caaar.jpg',
child: CachedNetworkImage(
imageUrl: 'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2F61tqeocT3ML._AC_SX679_.jpg?alt=media&token=d9265aeb-54b1-436a-bbc7-305fec602be6',
height: 100.0,
width: 100.0,
),
Expand All @@ -197,7 +198,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
const Expanded(
child: Text(
'225/90D16ST (750-16) SUPERGUIDER 10PR QH504 TUBELES',
'ALFA Furnishing Ergonomic Desk Chair ALFA Furnishing Ergonomic Desk Chair',
maxLines: 3,
style: TextStyle(fontSize: 12.0),
overflow: TextOverflow.ellipsis,
Expand All @@ -220,7 +221,21 @@ class _HomeScreenState extends State<HomeScreen> {
Text("80.00 EGP",style: TextStyle(color: defaultColor),),
],
),
const AddToCartBTN(),
Container(
decoration: BoxDecoration(
border: Border.all(
color: defaultColor,
width: 1.5,
),
borderRadius: const BorderRadius.all(
Radius.circular(10.0)
),
),
child: const Padding(
padding: EdgeInsets.only(right: 35.0,left: 35.0,top: 7.0,bottom: 7.0),
child: Text('Add To Cart',style: TextStyle(color: defaultColor),),
),
),
],
),

Expand Down Expand Up @@ -263,8 +278,8 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Image.asset(
'assets/images/caaar.jpg',
child: CachedNetworkImage(
imageUrl: 'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2F6154tUlFvPL._AC_SL1500_.jpg?alt=media&token=6c7ae296-111d-49dd-8736-f57d312ac786',
height: 100.0,
width: 100.0,
),
Expand All @@ -274,7 +289,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
const Expanded(
child: Text(
'225/90D16ST (750-16) SUPERGUIDER 10PR QH504 TUBELES',
'ALFA Furnishing Ergonomic Desk Chair ALFA Furnishing Ergonomic Desk Chair',
maxLines: 3,
style: TextStyle(fontSize: 12.0),
overflow: TextOverflow.ellipsis,
Expand All @@ -297,21 +312,7 @@ class _HomeScreenState extends State<HomeScreen> {
Text("80.00 EGP",style: TextStyle(color: defaultColor),),
],
),
Container(
decoration: BoxDecoration(
border: Border.all(
color: defaultColor,
width: 1.5,
),
borderRadius: const BorderRadius.all(
Radius.circular(10.0)
),
),
child: const Padding(
padding: EdgeInsets.only(right: 35.0,left: 35.0,top: 7.0,bottom: 7.0),
child: Text('Add To Cart',style: TextStyle(color: defaultColor),),
),
),
const AddToCartBTN(),
],
),

Expand Down Expand Up @@ -354,8 +355,8 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Image.asset(
'assets/images/caaar.jpg',
child: CachedNetworkImage(
imageUrl: 'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2F61ia%2BclFWeL._AC_SL1500_.jpg?alt=media&token=708295e3-8284-4306-a8b6-103f43d2e912',
height: 100.0,
width: 100.0,
),
Expand All @@ -365,7 +366,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
const Expanded(
child: Text(
'225/90D16ST (750-16) SUPERGUIDER 10PR QH504 TUBELES',
'ALFA Furnishing Ergonomic Desk Chair ALFA Furnishing Ergonomic Desk Chair',
maxLines: 3,
style: TextStyle(fontSize: 12.0),
overflow: TextOverflow.ellipsis,
Expand Down Expand Up @@ -445,8 +446,8 @@ class _HomeScreenState extends State<HomeScreen> {
children: [
ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: Image.asset(
'assets/images/caaar.jpg',
child: CachedNetworkImage(
imageUrl: 'https://firebasestorage.googleapis.com/v0/b/flutterecom-b7f81.appspot.com/o/newDesign%2F61ia%2BclFWeL._AC_SL1500_.jpg?alt=media&token=708295e3-8284-4306-a8b6-103f43d2e912',
height: 100.0,
width: 100.0,
),
Expand All @@ -456,7 +457,7 @@ class _HomeScreenState extends State<HomeScreen> {
),
const Expanded(
child: Text(
'225/90D16ST (750-16) SUPERGUIDER 10PR QH504 TUBELES',
'ALFA Furnishing Ergonomic Desk Chair ALFA Furnishing Ergonomic Desk Chair',
maxLines: 3,
style: TextStyle(fontSize: 12.0),
overflow: TextOverflow.ellipsis,
Expand Down
3 changes: 2 additions & 1 deletion lib/presentaion/modules/login/login_screen.dart
Expand Up @@ -87,7 +87,8 @@ class LoginScreen extends StatelessWidget {
Container(
color: MyColors.scaffoldBackgroundColorMain,
child: Image.asset(
'assets/images/logo.png',
'assets/images/logoo.png',
height: 200.0,
fit: BoxFit.cover,
)),
const SizedBox(height: 25.0,),
Expand Down
Expand Up @@ -87,7 +87,7 @@ class _ProductDetailsScreenState extends State<ProductDetailsScreen> {
},
),
actions: [
/* Platform.isAndroid ? BlocBuilder<ProductDetailsCubit,ProductDetailsStates>(
Platform.isAndroid ? BlocBuilder<ProductDetailsCubit,ProductDetailsStates>(
builder: (context,state){
return IconButton(
onPressed: () {
Expand All @@ -99,7 +99,7 @@ class _ProductDetailsScreenState extends State<ProductDetailsScreen> {
icon: const Icon(Iconly_Broken.Send,color: MyColors.iconsColor,),
);
},
) : Container(),*/
) : Container(),
IconButton(
onPressed: () {
scaffoldKey.currentState!.showBottomSheet((context) => SubmitReviewSheet(rateTextController:rateTextController,productItem: widget.productItem,));
Expand Down Expand Up @@ -147,7 +147,7 @@ class _ProductDetailsScreenState extends State<ProductDetailsScreen> {
imageUrl: widget.productItem.image,
height: MediaQuery.of(context).size.height / 2,
width: double.infinity,
fit: BoxFit.cover,
fit: BoxFit.contain,
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/presentaion/modules/splash/splash_screen.dart
Expand Up @@ -11,7 +11,7 @@ class SplashScreen extends StatelessWidget {
return AnimatedSplashScreen(
duration: 1000,
splashIconSize: 320.0,
splash: Image.asset('assets/images/sent.png'),
splash: Image.asset('assets/images/logoo.png'),
nextScreen: startScreen,
splashTransition: SplashTransition.slideTransition,
backgroundColor: Colors.white,
Expand Down
7 changes: 4 additions & 3 deletions lib/presentaion/views/categoryies_grid_item.dart
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutterecom/cubit/home_layout/home_layout_cubit.dart';
import 'package:flutterecom/data/models/category_model.dart';
import 'package:flutterecom/shared/style/colors.dart';
import 'package:shimmer/shimmer.dart';

class CategoryGridItem extends StatelessWidget {
Expand Down Expand Up @@ -31,8 +32,8 @@ class CategoryGridItem extends StatelessWidget {
CachedNetworkImage(
imageUrl: categoriesItem.image,
fit: BoxFit.cover,
height: 50.0,
width: 50.0,
height: 52.0,
width: 52.0,
placeholder: (context, url) => Container(),
errorWidget: (context, url, error) => const Icon(Icons.error),
), //Image
Expand All @@ -47,7 +48,7 @@ class CategoryGridItem extends StatelessWidget {
const Text(
'+89',
style: TextStyle(
color: Colors.red,
color: defaultColor,
fontWeight: FontWeight.normal,
fontSize: 13.0),
),
Expand Down
6 changes: 3 additions & 3 deletions lib/presentaion/views/categoryies_list_item.dart
Expand Up @@ -30,9 +30,9 @@ class CategoryListItem extends StatelessWidget {
ClipRRect(
borderRadius: BorderRadius.circular(12.0),
child: CachedNetworkImage(
width: 62.0,
height: 62.0,
fit: BoxFit.cover,
width: 65.0,
height: 65.0,
fit: BoxFit.contain,
imageUrl: categoryItem.image,
placeholder: (context, url) => Container(),
errorWidget: (context, url, error) => const Icon(Icons.error),
Expand Down

0 comments on commit 2b4b561

Please sign in to comment.