diff --git a/lib/core/common/view_models/horizontal_small_list_view_item_view_model.dart b/lib/core/common/view_models/horizontal_small_list_view_item_view_model.dart index da6a52f..a527eeb 100644 --- a/lib/core/common/view_models/horizontal_small_list_view_item_view_model.dart +++ b/lib/core/common/view_models/horizontal_small_list_view_item_view_model.dart @@ -17,4 +17,3 @@ class HorizontalSmallListViewItemModel { }); } -//horizontal small list view item model>> horizontal_small_list_view_item_model.dart diff --git a/lib/core/common/widgets/navigation_menu.dart b/lib/core/common/widgets/navigation_menu.dart index 389b3ed..7359f3a 100644 --- a/lib/core/common/widgets/navigation_menu.dart +++ b/lib/core/common/widgets/navigation_menu.dart @@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:iconsax/iconsax.dart'; import 'package:t_store/core/cubits/navigation_menu_cubit/navigation_menu_cubit.dart'; import 'package:t_store/core/utils/constants/colors.dart'; +import 'package:t_store/core/utils/constants/text_strings.dart'; import 'package:t_store/core/utils/helpers/helper_functions.dart'; // lib/features/home/presentation/views/navigation_menu.dart @@ -31,19 +32,19 @@ class NavigationMenu extends StatelessWidget { //home store wishlist profile NavigationDestination( icon: Icon(Iconsax.home), - label: 'Home', + label: TTexts.homeView, ), NavigationDestination( icon: Icon(Iconsax.shop), - label: 'Store', + label: TTexts.storeView, ), NavigationDestination( icon: Icon(Iconsax.heart), - label: 'Wishlist', + label: TTexts.wishlistView, ), NavigationDestination( icon: Icon(Iconsax.user), - label: 'Profile', + label: TTexts.profileView, ), ], ), diff --git a/lib/core/common/widgets/success_view.dart b/lib/core/common/widgets/success_view.dart index 963bcf8..c9adc33 100644 --- a/lib/core/common/widgets/success_view.dart +++ b/lib/core/common/widgets/success_view.dart @@ -12,40 +12,42 @@ class SuccessView extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - body: SingleChildScrollView( - child: Padding( - padding: TSizes.paddingWithAppBarHeight * 2, - child: Column( - children: [ - Image( - width: TDeviceUtils.getScreenWidth(context) * .75, - image: AssetImage(successModel.image)), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - Text( - successModel.title, - style: Theme.of(context).textTheme.headlineMedium, - textAlign: TextAlign.center, - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - Text( - successModel.subTitle, - style: Theme.of(context).textTheme.labelMedium, - textAlign: TextAlign.center, - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - SizedBox( - width: double.infinity, - child: ElevatedButton( - onPressed: successModel.onPressed, - child: Text(successModel.buttonText)), - ), - ], + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: TSizes.paddingWithAppBarHeight * 2, + child: Column( + children: [ + Image( + width: TDeviceUtils.getScreenWidth(context) * .75, + image: AssetImage(successModel.image)), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + Text( + successModel.title, + style: Theme.of(context).textTheme.headlineMedium, + textAlign: TextAlign.center, + ), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + Text( + successModel.subTitle, + style: Theme.of(context).textTheme.labelMedium, + textAlign: TextAlign.center, + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: successModel.onPressed, + child: Text(successModel.buttonText)), + ), + ], + ), ), ), ), diff --git a/lib/core/utils/constants/text_strings.dart b/lib/core/utils/constants/text_strings.dart index c74ffaa..9fb2f6a 100644 --- a/lib/core/utils/constants/text_strings.dart +++ b/lib/core/utils/constants/text_strings.dart @@ -1,4 +1,3 @@ -/// This class contains all the App Text in String formats. class TTexts { // -- GLOBAL Texts static const String and = "and"; @@ -10,6 +9,15 @@ class TTexts { static const String viewAll = "View All"; static const String account = "Account"; + // views + static const String homeView = "Home"; + static const String cartView = "Cart"; + static const String profileView = "Profile"; + static const String wishlistView = "Wishlist"; + static const String ordersView = "Orders"; + static const String settingsView = "Settings"; + static const String storeView = "Store"; + // -- OnBoarding Texts static const String onBoardingTitle1 = "Choose your product"; static const String onBoardingTitle2 = "Select Payment Method"; @@ -70,7 +78,7 @@ class TTexts { // -- Home static const String homeAppbarTitle = "Good day for shopping"; - static const String homeAppbarSubTitle = "Taimoor Sikander"; + static const String homeAppbarSubTitle = "Mahmoud Hamdy"; static const String searchContainer = "Search in Store"; static const String popularCategories = "Popular Categories"; // -- Categories diff --git a/lib/features/auth/presentation/views/login/login_view.dart b/lib/features/auth/presentation/views/login/login_view.dart index c28a121..fae2371 100644 --- a/lib/features/auth/presentation/views/login/login_view.dart +++ b/lib/features/auth/presentation/views/login/login_view.dart @@ -12,24 +12,26 @@ class LoginView extends StatelessWidget { @override Widget build(BuildContext context) { return const Scaffold( - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Padding( - padding: TSizes.paddingWithAppBarHeight, - child: Column( - children: [ - LoginHeaderSection(), - LoginFormSection(), - DividerWidget( - text: TTexts.orSignInWith, - ), - SizedBox( - height: TSizes.spaceBtwSections, - ), - SignInMethodsSection(), - ], - ), - )), + body: SafeArea( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Padding( + padding: TSizes.paddingWithAppBarHeight, + child: Column( + children: [ + LoginHeaderSection(), + LoginFormSection(), + DividerWidget( + text: TTexts.orSignInWith, + ), + SizedBox( + height: TSizes.spaceBtwSections, + ), + SignInMethodsSection(), + ], + ), + )), + ), ); } } diff --git a/lib/features/auth/presentation/views/password_configuration/reset_password_view.dart b/lib/features/auth/presentation/views/password_configuration/reset_password_view.dart index 549061e..87be9bd 100644 --- a/lib/features/auth/presentation/views/password_configuration/reset_password_view.dart +++ b/lib/features/auth/presentation/views/password_configuration/reset_password_view.dart @@ -25,48 +25,50 @@ class ResetPasswordView extends StatelessWidget { ], automaticallyImplyLeading: false, ), - body: SingleChildScrollView( - physics: const BouncingScrollPhysics(), - child: Padding( - padding: TSizes.paddingWithAppBarHeight, - child: Column( - children: [ - Image( - width: TDeviceUtils.getScreenWidth(context) * .6, - image: const AssetImage(TImages.deliveredEmailIllustration)), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - Text( - TTexts.changeYourPasswordTitle, - style: Theme.of(context).textTheme.headlineMedium, - textAlign: TextAlign.center, - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - Text( - TTexts.changeYourPasswordSubTitle, - style: Theme.of(context).textTheme.labelMedium, - textAlign: TextAlign.center, - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - SizedBox( - width: double.infinity, - child: ElevatedButton( - onPressed: () {}, child: const Text(TTexts.done)), - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - SizedBox( - width: double.infinity, - child: TextButton( - onPressed: () {}, child: const Text(TTexts.resendEmail)), - ) - ], + body: SafeArea( + child: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + child: Padding( + padding: TSizes.paddingWithAppBarHeight, + child: Column( + children: [ + Image( + width: TDeviceUtils.getScreenWidth(context) * .6, + image: const AssetImage(TImages.deliveredEmailIllustration)), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + Text( + TTexts.changeYourPasswordTitle, + style: Theme.of(context).textTheme.headlineMedium, + textAlign: TextAlign.center, + ), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + Text( + TTexts.changeYourPasswordSubTitle, + style: Theme.of(context).textTheme.labelMedium, + textAlign: TextAlign.center, + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () {}, child: const Text(TTexts.done)), + ), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + SizedBox( + width: double.infinity, + child: TextButton( + onPressed: () {}, child: const Text(TTexts.resendEmail)), + ) + ], + ), ), ), ), diff --git a/lib/features/auth/presentation/views/signup/sign_up_view.dart b/lib/features/auth/presentation/views/signup/sign_up_view.dart index 63d2c67..5feafba 100644 --- a/lib/features/auth/presentation/views/signup/sign_up_view.dart +++ b/lib/features/auth/presentation/views/signup/sign_up_view.dart @@ -14,46 +14,48 @@ class SignUpView extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), - body: SingleChildScrollView( - physics: const BouncingScrollPhysics(), - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TTexts.signUpTitle, - style: Theme.of(context).textTheme.headlineMedium, - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - const SignUpFormSection(), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - SizedBox( - width: double.infinity, - child: ElevatedButton( - onPressed: () { - THelperFunctions.navigateToScreen( - context, const VerifyEmailView()); - }, - child: const Text(TTexts.createAccount)), - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - const DividerWidget( - text: TTexts.orSignUpWith, - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - const SignInMethodsSection(), - ], - ), - )), + body: SafeArea( + child: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TTexts.signUpTitle, + style: Theme.of(context).textTheme.headlineMedium, + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + const SignUpFormSection(), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () { + THelperFunctions.navigateToScreen( + context, const VerifyEmailView()); + }, + child: const Text(TTexts.createAccount)), + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + const DividerWidget( + text: TTexts.orSignUpWith, + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + const SignInMethodsSection(), + ], + ), + )), + ), ); } } diff --git a/lib/features/auth/presentation/views/signup/verify_email_view.dart b/lib/features/auth/presentation/views/signup/verify_email_view.dart index 99841b7..f27a32f 100644 --- a/lib/features/auth/presentation/views/signup/verify_email_view.dart +++ b/lib/features/auth/presentation/views/signup/verify_email_view.dart @@ -26,60 +26,62 @@ class VerifyEmailView extends StatelessWidget { ) ], ), - body: SingleChildScrollView( - physics: const BouncingScrollPhysics(), - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - Image( - width: TDeviceUtils.getScreenWidth(context) * .6, - image: const AssetImage(TImages.deliveredEmailIllustration)), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - Text( - TTexts.confirmEmailTitle, - style: Theme.of(context).textTheme.headlineMedium, - textAlign: TextAlign.center, - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - Text( - TTexts.confirmEmail, - style: Theme.of(context).textTheme.labelLarge, - textAlign: TextAlign.center, - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - Text( - TTexts.confirmEmailSubTitle, - style: Theme.of(context).textTheme.labelMedium, - textAlign: TextAlign.center, - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - SizedBox( - width: double.infinity, - child: ElevatedButton( - onPressed: () { - THelperFunctions.navigateReplacementToScreen( - context, const EmailVerifiedSuccessfully()); - }, - child: const Text(TTexts.tContinue)), - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - SizedBox( - width: double.infinity, - child: TextButton( - onPressed: () {}, child: const Text(TTexts.resendEmail)), - ), - ], + body: SafeArea( + child: SingleChildScrollView( + physics: const BouncingScrollPhysics(), + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + Image( + width: TDeviceUtils.getScreenWidth(context) * .6, + image: const AssetImage(TImages.deliveredEmailIllustration)), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + Text( + TTexts.confirmEmailTitle, + style: Theme.of(context).textTheme.headlineMedium, + textAlign: TextAlign.center, + ), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + Text( + TTexts.confirmEmail, + style: Theme.of(context).textTheme.labelLarge, + textAlign: TextAlign.center, + ), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + Text( + TTexts.confirmEmailSubTitle, + style: Theme.of(context).textTheme.labelMedium, + textAlign: TextAlign.center, + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + SizedBox( + width: double.infinity, + child: ElevatedButton( + onPressed: () { + THelperFunctions.navigateReplacementToScreen( + context, const EmailVerifiedSuccessfully()); + }, + child: const Text(TTexts.tContinue)), + ), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + SizedBox( + width: double.infinity, + child: TextButton( + onPressed: () {}, child: const Text(TTexts.resendEmail)), + ), + ], + ), ), ), ), diff --git a/lib/features/personalization/presentation/views/add_new_addresses_view.dart b/lib/features/personalization/presentation/views/add_new_addresses_view.dart index 674980e..513eb63 100644 --- a/lib/features/personalization/presentation/views/add_new_addresses_view.dart +++ b/lib/features/personalization/presentation/views/add_new_addresses_view.dart @@ -14,10 +14,12 @@ class AddNewAddressesView extends StatelessWidget { appBarModel: AppBarModel( title: const Text("Add New Address"), hasArrowBack: true), ), - body: const SingleChildScrollView( - child: Padding( - padding: EdgeInsets.all(TSizes.defaultSpace), - child: NewAddressForm(), + body: const SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(TSizes.defaultSpace), + child: NewAddressForm(), + ), ), ), ); diff --git a/lib/features/personalization/presentation/views/profile_view.dart b/lib/features/personalization/presentation/views/profile_view.dart index a68a066..de4bf54 100644 --- a/lib/features/personalization/presentation/views/profile_view.dart +++ b/lib/features/personalization/presentation/views/profile_view.dart @@ -53,28 +53,30 @@ class ProfileView extends StatelessWidget { appBarModel: AppBarModel(title: const Text("Profile"), hasArrowBack: true), ), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - ProfileInformationSection(profileInformation: profileInformation), - const SpaceBetweenSectionsWithDivider(), - PersonalInformationSection( - personalInformation: personalInformation), - const SpaceBetweenSectionsWithDivider(), - TextButton( - onPressed: () {}, - child: const Text( - "Delete Account", - style: TextStyle(color: TColors.error), - )), - const SizedBox( - height: TSizes.spaceBtwItems / 1.5, - ), - ], - ), - )), + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + ProfileInformationSection(profileInformation: profileInformation), + const SpaceBetweenSectionsWithDivider(), + PersonalInformationSection( + personalInformation: personalInformation), + const SpaceBetweenSectionsWithDivider(), + TextButton( + onPressed: () {}, + child: const Text( + "Delete Account", + style: TextStyle(color: TColors.error), + )), + const SizedBox( + height: TSizes.spaceBtwItems / 1.5, + ), + ], + ), + )), + ), ); } } diff --git a/lib/features/personalization/presentation/views/settings_view.dart b/lib/features/personalization/presentation/views/settings_view.dart index a2fc470..2498c36 100644 --- a/lib/features/personalization/presentation/views/settings_view.dart +++ b/lib/features/personalization/presentation/views/settings_view.dart @@ -103,27 +103,29 @@ class SettingsView extends StatelessWidget { leading: Iconsax.security_card, ), ]; - return SingleChildScrollView( - child: Column( - children: [ - const PrimaryHeaderContainer(child: SettingsViewHeaderSection()), - Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - AccountSettingsSection( - accountSettingsTiles: accountSettingsTiles), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - AppSettingsSection(appSettingsTiles: appSettingsTiles), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - ], + return SafeArea( + child: SingleChildScrollView( + child: Column( + children: [ + const PrimaryHeaderContainer(child: SettingsViewHeaderSection()), + Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + AccountSettingsSection( + accountSettingsTiles: accountSettingsTiles), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + AppSettingsSection(appSettingsTiles: appSettingsTiles), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + ], + ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/features/personalization/presentation/views/user_addresses_view.dart b/lib/features/personalization/presentation/views/user_addresses_view.dart index d05e9dd..d4826d4 100644 --- a/lib/features/personalization/presentation/views/user_addresses_view.dart +++ b/lib/features/personalization/presentation/views/user_addresses_view.dart @@ -30,26 +30,28 @@ class UserAddressesView extends StatelessWidget { "Addresses", style: Theme.of(context).textTheme.headlineSmall, ))), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - SingleAddress( - singleAddressModel: SingleAddressModel( - name: "Mahmoud Hamdy", - phoneNumber: "0123456789", - address: "8th of October,Cairo,Egypt", - isSelected: true), - ), - SingleAddress( - singleAddressModel: SingleAddressModel( - name: "Mahmoud Hamdy", - phoneNumber: "0123456789", - address: "8th of October,Cairo,Egypt", - isSelected: false), - ), - ], + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + SingleAddress( + singleAddressModel: SingleAddressModel( + name: "Mahmoud Hamdy", + phoneNumber: "0123456789", + address: "8th of October,Cairo,Egypt", + isSelected: true), + ), + SingleAddress( + singleAddressModel: SingleAddressModel( + name: "Mahmoud Hamdy", + phoneNumber: "0123456789", + address: "8th of October,Cairo,Egypt", + isSelected: false), + ), + ], + ), ), ), ), diff --git a/lib/features/shop/presentation/views/all_brands_view.dart b/lib/features/shop/presentation/views/all_brands_view.dart index d6bd0ad..182a064 100644 --- a/lib/features/shop/presentation/views/all_brands_view.dart +++ b/lib/features/shop/presentation/views/all_brands_view.dart @@ -23,44 +23,46 @@ class AllBrandsView extends StatelessWidget { appBarModel: AppBarModel(title: const Text("All Brands"), hasArrowBack: true), ), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - SectionHeading( - sectionHeadingModel: SectionHeadingModel( - title: "All Brands", - showActionButton: false, + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + SectionHeading( + sectionHeadingModel: SectionHeadingModel( + title: "All Brands", + showActionButton: false, + ), ), - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - GridLayout( - gridLayoutModel: GridLayoutModel( - itemCount: 10, - mainAxisExtent: 80, - itemBuilder: (context, index) { - return BrandCard( - brandCardModel: BrandCardModel( - onTap: () { - THelperFunctions.navigateToScreen( - context, - const BrandProductsView(), - ); - }, - showBorder: true, - productCount: TTexts.brandTitles.length, - brandName: TTexts.brandTitles[index], - image: TImages.brandIcons[index], - ), - ); - }, - )), - ], - ), - )), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + GridLayout( + gridLayoutModel: GridLayoutModel( + itemCount: 10, + mainAxisExtent: 80, + itemBuilder: (context, index) { + return BrandCard( + brandCardModel: BrandCardModel( + onTap: () { + THelperFunctions.navigateToScreen( + context, + const BrandProductsView(), + ); + }, + showBorder: true, + productCount: TTexts.brandTitles.length, + brandName: TTexts.brandTitles[index], + image: TImages.brandIcons[index], + ), + ); + }, + )), + ], + ), + )), + ), ); } } diff --git a/lib/features/shop/presentation/views/all_products_view.dart b/lib/features/shop/presentation/views/all_products_view.dart index 8a15444..de413eb 100644 --- a/lib/features/shop/presentation/views/all_products_view.dart +++ b/lib/features/shop/presentation/views/all_products_view.dart @@ -14,11 +14,13 @@ class AllProductsView extends StatelessWidget { appBarModel: AppBarModel(title: const Text("All Products"), hasArrowBack: true), ), - body: const SingleChildScrollView( - child: Padding( - padding: EdgeInsets.all(TSizes.defaultSpace), - child: SortableProducts(), - )), + body: const SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(TSizes.defaultSpace), + child: SortableProducts(), + )), + ), ); } } diff --git a/lib/features/shop/presentation/views/brand_products_view.dart b/lib/features/shop/presentation/views/brand_products_view.dart index 33c60d7..1712658 100644 --- a/lib/features/shop/presentation/views/brand_products_view.dart +++ b/lib/features/shop/presentation/views/brand_products_view.dart @@ -16,24 +16,26 @@ class BrandProductsView extends StatelessWidget { appBar: CustomAppBar( appBarModel: AppBarModel(title: const Text("Nike"), hasArrowBack: true), ), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - BrandCard( - brandCardModel: BrandCardModel( - productCount: 5, - showBorder: true, - brandName: "Nike", - image: TImages.nikeLogo)), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - const SortableProducts(), - ], - ), - )), + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + BrandCard( + brandCardModel: BrandCardModel( + productCount: 5, + showBorder: true, + brandName: "Nike", + image: TImages.nikeLogo)), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + const SortableProducts(), + ], + ), + )), + ), ); } } diff --git a/lib/features/shop/presentation/views/checkout_view.dart b/lib/features/shop/presentation/views/checkout_view.dart index 251a6ec..951bf87 100644 --- a/lib/features/shop/presentation/views/checkout_view.dart +++ b/lib/features/shop/presentation/views/checkout_view.dart @@ -52,48 +52,50 @@ class CheckoutView extends StatelessWidget { "Order Review", style: Theme.of(context).textTheme.headlineSmall, ))), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - const CartItemsList( - showAddRemoveButtons: false, - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - const CouponCode(), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - CircularContainer( - circularContainerModel: CircularContainerModel( - showBorder: true, - padding: const EdgeInsets.all(TSizes.md), - color: dark ? TColors.black : TColors.white, - child: const Column( - children: [ - BillingAmountSection(), - SizedBox( - height: TSizes.spaceBtwItems, - ), - Divider(), - SizedBox( - height: TSizes.spaceBtwItems, - ), - BillingPaymentSection(), - SizedBox( - height: TSizes.spaceBtwItems, - ), - Divider(), - SizedBox( - height: TSizes.spaceBtwItems, - ), - BillingAddressSection() - ], - ))), - ], + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + const CartItemsList( + showAddRemoveButtons: false, + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + const CouponCode(), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + CircularContainer( + circularContainerModel: CircularContainerModel( + showBorder: true, + padding: const EdgeInsets.all(TSizes.md), + color: dark ? TColors.black : TColors.white, + child: const Column( + children: [ + BillingAmountSection(), + SizedBox( + height: TSizes.spaceBtwItems, + ), + Divider(), + SizedBox( + height: TSizes.spaceBtwItems, + ), + BillingPaymentSection(), + SizedBox( + height: TSizes.spaceBtwItems, + ), + Divider(), + SizedBox( + height: TSizes.spaceBtwItems, + ), + BillingAddressSection() + ], + ))), + ], + ), ), ), ), diff --git a/lib/features/shop/presentation/views/home_view.dart b/lib/features/shop/presentation/views/home_view.dart index 0b1478e..9941f4e 100644 --- a/lib/features/shop/presentation/views/home_view.dart +++ b/lib/features/shop/presentation/views/home_view.dart @@ -21,53 +21,55 @@ class HomeView extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - body: SingleChildScrollView( - child: Column( - children: [ - const HomeHeaderSection(), - const SizedBox(height: TSizes.spaceBtwSections), - BlocProvider( - create: (context) => BannerCarouselSliderCubit(), - child: const PromoBannerCarouselSlider(), - ), - const SizedBox(height: TSizes.spaceBtwSections), - SectionHeading( - sectionHeadingModel: SectionHeadingModel( - title: "Top Rated Products", - showActionButton: true, - textColor: TColors.primary, - actionButtonOnPressed: () { - THelperFunctions.navigateToScreen( - context, - BlocProvider( - create: (context) => getIt()..getSortedProducts(sortBy: 'rating', sortType: "desc"), - child: const AllProductsView()), - ); + body: SafeArea( + child: SingleChildScrollView( + child: Column( + children: [ + const HomeHeaderSection(), + const SizedBox(height: TSizes.spaceBtwSections), + BlocProvider( + create: (context) => BannerCarouselSliderCubit(), + child: const PromoBannerCarouselSlider(), + ), + const SizedBox(height: TSizes.spaceBtwSections), + SectionHeading( + sectionHeadingModel: SectionHeadingModel( + title: "Top Rated Products", + showActionButton: true, + textColor: TColors.primary, + actionButtonOnPressed: () { + THelperFunctions.navigateToScreen( + context, + BlocProvider( + create: (context) => getIt()..getSortedProducts(sortBy: 'rating', sortType: "desc"), + child: const AllProductsView()), + ); + }, + actionButtonTitle: "View All", + ), + ), + const SizedBox(height: TSizes.spaceBtwItems), + BlocBuilder( + builder: (context, state) { + if (state is ShopError) { + return Text(state.error.message); + } + if (state is ShopSortedProductsLoaded) { + return GridLayout( + gridLayoutModel: GridLayoutModel( + itemCount: state.productsList.length, + itemBuilder: (context, index) { + return VerticalProductCard( + product: state.productsList[index]); + }, + mainAxisExtent: 288, + )); + } + return const CircularProgressIndicator(); }, - actionButtonTitle: "View All", ), - ), - const SizedBox(height: TSizes.spaceBtwItems), - BlocBuilder( - builder: (context, state) { - if (state is ShopError) { - return Text(state.error.message); - } - if (state is ShopSortedProductsLoaded) { - return GridLayout( - gridLayoutModel: GridLayoutModel( - itemCount: state.productsList.length, - itemBuilder: (context, index) { - return VerticalProductCard( - product: state.productsList[index]); - }, - mainAxisExtent: 288, - )); - } - return const CircularProgressIndicator(); - }, - ), - ], + ], + ), ), ), ); diff --git a/lib/features/shop/presentation/views/product_details_view.dart b/lib/features/shop/presentation/views/product_details_view.dart index 553eed6..b49660f 100644 --- a/lib/features/shop/presentation/views/product_details_view.dart +++ b/lib/features/shop/presentation/views/product_details_view.dart @@ -15,31 +15,33 @@ class ProductDetailsView extends StatelessWidget { Widget build(BuildContext context) { return const Scaffold( bottomNavigationBar: BottomAddToCart(), - body: SingleChildScrollView( - child: Column( - children: [ - ProductImageSlider(), - Padding( - padding: EdgeInsets.fromLTRB(TSizes.defaultSpace, 0, - TSizes.defaultSpace, TSizes.defaultSpace), + body: SafeArea( + child: SingleChildScrollView( child: Column( - children: [ - RatingAndShare(), - ProductMetadata(), - ProductAttributes(), - SizedBox( - height: TSizes.spaceBtwSections, - ), - CheckoutButton(), - SizedBox( - height: TSizes.spaceBtwSections, - ), - ProductDescriptionAndReviewsSection(), - SizedBox(height: TSizes.spaceBtwSections), - ], - ), - ) - ], - ))); + children: [ + ProductImageSlider(), + Padding( + padding: EdgeInsets.fromLTRB(TSizes.defaultSpace, 0, + TSizes.defaultSpace, TSizes.defaultSpace), + child: Column( + children: [ + RatingAndShare(), + ProductMetadata(), + ProductAttributes(), + SizedBox( + height: TSizes.spaceBtwSections, + ), + CheckoutButton(), + SizedBox( + height: TSizes.spaceBtwSections, + ), + ProductDescriptionAndReviewsSection(), + SizedBox(height: TSizes.spaceBtwSections), + ], + ), + ) + ], + )), + )); } } diff --git a/lib/features/shop/presentation/views/product_reviews_view.dart b/lib/features/shop/presentation/views/product_reviews_view.dart index a12302d..a4d3893 100644 --- a/lib/features/shop/presentation/views/product_reviews_view.dart +++ b/lib/features/shop/presentation/views/product_reviews_view.dart @@ -19,30 +19,32 @@ class ProductReviewsView extends StatelessWidget { "Reviews & Ratings", ), )), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Text( - "Ratings and Reviews are verified and from people who have purchased this product.", - ), - const SizedBox( - height: TSizes.spaceBtwItems, - ), - const ProductOverallRating(), - const CustomRatingBarIndicator( - rating: 4.5, - ), - Text("12,611", style: Theme.of(context).textTheme.bodySmall), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - const UserReviewCard(), - const UserReviewCard(), - const UserReviewCard(), - ], + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Ratings and Reviews are verified and from people who have purchased this product.", + ), + const SizedBox( + height: TSizes.spaceBtwItems, + ), + const ProductOverallRating(), + const CustomRatingBarIndicator( + rating: 4.5, + ), + Text("12,611", style: Theme.of(context).textTheme.bodySmall), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + const UserReviewCard(), + const UserReviewCard(), + const UserReviewCard(), + ], + ), ), ), ), diff --git a/lib/features/shop/presentation/views/store_view.dart b/lib/features/shop/presentation/views/store_view.dart index acc3db4..7364778 100644 --- a/lib/features/shop/presentation/views/store_view.dart +++ b/lib/features/shop/presentation/views/store_view.dart @@ -62,6 +62,7 @@ class StoreView extends StatelessWidget { headerSliverBuilder: (context, innerBoxIsScrolled) { return [ SliverAppBar( + elevation: 0, pinned: true, floating: true, expandedHeight: 440, diff --git a/lib/features/shop/presentation/views/sub_category_view.dart b/lib/features/shop/presentation/views/sub_category_view.dart index 13babd1..35bc08b 100644 --- a/lib/features/shop/presentation/views/sub_category_view.dart +++ b/lib/features/shop/presentation/views/sub_category_view.dart @@ -19,45 +19,47 @@ class SubCategoryView extends StatelessWidget { appBarModel: AppBarModel(hasArrowBack: true, title: const Text("Sports Shirts")), ), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - RoundedImage( - roundedImageModel: RoundedImageModel( - image: TImages.promoBanner2, - applyImageRadius: true, - width: double.infinity, - ), - ), - const SizedBox( - height: TSizes.spaceBtwSections, - ), - Column( - children: [ - SectionHeading( - sectionHeadingModel: SectionHeadingModel( - title: "Sports Shirts", - )), - const SizedBox( - height: TSizes.spaceBtwItems / 2, + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + RoundedImage( + roundedImageModel: RoundedImageModel( + image: TImages.promoBanner2, + applyImageRadius: true, + width: double.infinity, ), - SizedBox( - height: 128, - child: ListView.separated( - itemCount: 5, - shrinkWrap: true, - scrollDirection: Axis.horizontal, - itemBuilder: (context, index) => - const HorizontalProductCard(), - separatorBuilder: (context, index) => const SizedBox( - width: TSizes.spaceBtwItems, - )), - ) - ], - ) - ], + ), + const SizedBox( + height: TSizes.spaceBtwSections, + ), + Column( + children: [ + SectionHeading( + sectionHeadingModel: SectionHeadingModel( + title: "Sports Shirts", + )), + const SizedBox( + height: TSizes.spaceBtwItems / 2, + ), + SizedBox( + height: 128, + child: ListView.separated( + itemCount: 5, + shrinkWrap: true, + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) => + const HorizontalProductCard(), + separatorBuilder: (context, index) => const SizedBox( + width: TSizes.spaceBtwItems, + )), + ) + ], + ) + ], + ), ), ), ), diff --git a/lib/features/shop/presentation/views/wishlist_view.dart b/lib/features/shop/presentation/views/wishlist_view.dart index 537b467..405192d 100644 --- a/lib/features/shop/presentation/views/wishlist_view.dart +++ b/lib/features/shop/presentation/views/wishlist_view.dart @@ -1,16 +1,17 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:iconsax/iconsax.dart'; -import 'package:t_store/core/cubits/navigation_menu_cubit/navigation_menu_cubit.dart'; import 'package:t_store/core/common/view_models/app_bar_view_model.dart'; import 'package:t_store/core/common/view_models/circular_icon_view_model.dart'; import 'package:t_store/core/common/view_models/grid_layout_view_model.dart'; -import 'package:t_store/core/utils/constants/colors.dart'; -import 'package:t_store/core/utils/constants/sizes.dart'; -import 'package:t_store/core/utils/helpers/helper_functions.dart'; import 'package:t_store/core/common/widgets/app_bar.dart'; import 'package:t_store/core/common/widgets/circular_icon.dart'; import 'package:t_store/core/common/widgets/vertical_product_card.dart'; +import 'package:t_store/core/cubits/navigation_menu_cubit/navigation_menu_cubit.dart'; +import 'package:t_store/core/utils/constants/colors.dart'; +import 'package:t_store/core/utils/constants/sizes.dart'; +import 'package:t_store/core/utils/constants/text_strings.dart'; +import 'package:t_store/core/utils/helpers/helper_functions.dart'; import 'package:t_store/features/auth/presentation/widgets/grid_layout.dart'; import 'package:t_store/features/shop/domain/entities/product_entity.dart'; @@ -32,45 +33,46 @@ class WishlistView extends StatelessWidget { context.read().changeIndex(0)), ) ], - title: Text("Wishlist", + title: Text(TTexts.wishlistView, style: Theme.of(context).textTheme.headlineMedium), ), ), - body: SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(TSizes.defaultSpace), - child: Column( - children: [ - GridLayout( - gridLayoutModel: GridLayoutModel( - itemCount: 10, - itemBuilder: (context, index) { - return VerticalProductCard( - product: ProductEntity( - id: index, - title: "Product $index", - price: 100, - images: const ["https://picsum.photos/200"], - category: "Category $index", - description: "Description $index", - rating: 4.5, - availabilityStatus: "", - brand: " Brand $index", - createdAt: DateTime.now(), - discountPercentage: 0, - returnPolicy: "Return Policy $index", - reviews: const [], - shippingInformation: "", - stock: 5, - tags: const [], - thumbnail: "", - warrantyInformation: ""), - - ); - }, - ), - ), - ], + body: SafeArea( + child: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(TSizes.defaultSpace), + child: Column( + children: [ + GridLayout( + gridLayoutModel: GridLayoutModel( + itemCount: 10, + itemBuilder: (context, index) { + return VerticalProductCard( + product: ProductEntity( + id: index, + title: "Product $index", + price: 100, + images: const ["https://picsum.photos/200"], + category: "Category $index", + description: "Description $index", + rating: 4.5, + availabilityStatus: "", + brand: " Brand $index", + createdAt: DateTime.now(), + discountPercentage: 0, + returnPolicy: "Return Policy $index", + reviews: const [], + shippingInformation: "", + stock: 5, + tags: const [], + thumbnail: "", + warrantyInformation: ""), + ); + }, + ), + ), + ], + ), ), ), )); diff --git a/pubspec.lock b/pubspec.lock index e9748d8..26da299 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1017,10 +1017,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.4" + version: "14.2.5" web: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index ead8099..215831d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,37 +12,37 @@ dependencies: flutter: sdk: flutter - cupertino_icons: ^1.0.8 - flutter_bloc: ^8.1.6 - iconsax: ^0.0.8 - cached_network_image: ^3.4.0 - capped_progress_indicator: ^0.0.2 - carousel_slider: ^5.0.0 - dartz: ^0.10.1 - dio: ^5.5.0+1 - equatable: ^2.0.5 - firebase_auth: ^4.16.0 - firebase_core: ^2.24.2 - flutter_native_splash: ^2.4.1 - flutter_rating_bar: ^4.0.1 - get_it: ^7.7.0 - google_sign_in: ^6.2.1 - http: ^1.2.2 - image_picker: ^1.1.2 - intl: ^0.19.0 - logger: ^2.4.0 - lottie: ^3.1.2 - readmore: ^3.0.0 - shared_preferences: ^2.3.1 - smooth_page_indicator: ^1.2.0+3 - url_launcher: ^6.3.0 - flutter_launcher_icons: ^0.13.1 + cupertino_icons: + flutter_bloc: + iconsax: + cached_network_image: + capped_progress_indicator: + carousel_slider: + dartz: + dio: + equatable: + firebase_auth: + firebase_core: + flutter_native_splash: + flutter_rating_bar: + get_it: + google_sign_in: + http: + image_picker: + intl: + logger: + lottie: + readmore: + shared_preferences: + smooth_page_indicator: + url_launcher: + flutter_launcher_icons: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^4.0.0 + flutter_lints: flutter: