Skip to content

Commit

Permalink
Merge pull request #37 from mahmoodhamdi:feature/add-safe-area-to-views
Browse files Browse the repository at this point in the history
Add SafeArea to All Views for Enhanced UI Compatibility
  • Loading branch information
mahmoodhamdi authored Nov 13, 2024
2 parents 58c64e4 + e884e61 commit 5f204d1
Show file tree
Hide file tree
Showing 24 changed files with 608 additions and 563 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ class HorizontalSmallListViewItemModel {
});
}

//horizontal small list view item model>> horizontal_small_list_view_item_model.dart
9 changes: 5 additions & 4 deletions lib/core/common/widgets/navigation_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
),
],
),
Expand Down
70 changes: 36 additions & 34 deletions lib/core/common/widgets/success_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
),
],
),
),
),
),
Expand Down
12 changes: 10 additions & 2 deletions lib/core/utils/constants/text_strings.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// This class contains all the App Text in String formats.
class TTexts {
// -- GLOBAL Texts
static const String and = "and";
Expand All @@ -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";
Expand Down Expand Up @@ -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
Expand Down
38 changes: 20 additions & 18 deletions lib/features/auth/presentation/views/login/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
],
),
)),
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
)
],
),
),
),
),
Expand Down
82 changes: 42 additions & 40 deletions lib/features/auth/presentation/views/signup/sign_up_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
],
),
)),
),
);
}
}
Loading

0 comments on commit 5f204d1

Please sign in to comment.