From 80eb6c773c7636ec6f0c1b8720c536181da230f4 Mon Sep 17 00:00:00 2001 From: jayesh Date: Thu, 13 Jun 2024 18:52:24 +0530 Subject: [PATCH] ui fix --- lib/core/styles/app_text.dart | 28 ++++++++------- .../widgets/key_investment_section.dart | 9 ++++- .../domain/model/portfolio_model.dart | 20 +++++++++++ .../presentation/pages/portfolio_layout.dart | 2 +- .../presentation/widgets/details_section.dart | 3 +- .../presentation/pages/register_layout.dart | 16 +++++---- .../pages/register_step_layout.dart | 16 +++++---- .../pages/register_user_details_layout.dart | 2 ++ .../widgets/register_bottom_section.dart | 20 +++++------ .../widgets/register_step_bottom_section.dart | 22 ++++++------ .../pages/confirm_pin_layout.dart | 12 ++++--- .../presentation/pages/pin_layout.dart | 36 ++++++++++--------- .../widgets/confirm_pin_keypad_section.dart | 4 +-- .../widgets/pin_keypad_section.dart | 6 ++-- lib/shared/components/button_widget.dart | 35 ++++++++++++++++++ 15 files changed, 153 insertions(+), 78 deletions(-) diff --git a/lib/core/styles/app_text.dart b/lib/core/styles/app_text.dart index 0becaf3..bbb4493 100644 --- a/lib/core/styles/app_text.dart +++ b/lib/core/styles/app_text.dart @@ -23,13 +23,13 @@ class AppText { "To get your account please set your info"; static const String countryOfResidence = "Country of residence"; static const String chooseCountry = "Choose country"; - static const String phoneNumber = "Phone Number"; + static const String phoneNumber = "Phone number"; static const String password = "Password"; static const String enterPassword = "Enter password"; - static const String invalidPhoneNo = "Invalid Phone Number"; + static const String invalidPhoneNo = "Invalid phone number"; static const String enterPhoneNo = "Enter phone number"; - static const String invalidPassword = "Invalid Password"; - static const String forgorPassword = "Forgot Password"; + static const String invalidPassword = "Invalid password"; + static const String forgorPassword = "Forgot password"; //Register static const String getStartedToday = "Get started today"; @@ -52,17 +52,17 @@ class AppText { "Select your country of residence and enter your mobile number"; static const String nextText = "Next"; static const String backText = "Back"; - static const String firstNameText = "First Name"; - static const String lastNameText = "Last Name"; + static const String firstNameText = "First name"; + static const String lastNameText = "Last name"; static const String emailText = "Email"; static const String repeatPasswordText = "Repeat Password"; static const String min8CharactersSpecialCharctersText = "Min 8 characters, special characters required"; - static const String enterFirstName = "Enter First Name"; - static const String enterLastName = "Enter Last Name"; - static const String enterEmail = "Enter Email"; - static const String cantBeEmptyText = "Can't Be Empty"; - static const String passwordMismatch = "Password Mismatch"; + static const String enterFirstName = "Enter first name"; + static const String enterLastName = "Enter last name"; + static const String enterEmail = "Enter email"; + static const String cantBeEmptyText = "Can't be empty"; + static const String passwordMismatch = "Password mismatch"; static const String iAgreeToThe = "I agree to the "; static const String termsAndCondition = "Terms & Conditions"; static const String andThe = " and the"; @@ -78,6 +78,7 @@ class AppText { static const String confirmSelectionText = "Confirm selection"; //Portfolio + static const String portfolioText = "Portfolio Value"; static const String portfolio = "Portfolio Value: "; static const String investmentamount = "Investment Amount"; static const String currentval = "Current valuation"; @@ -98,7 +99,7 @@ class AppText { //OTP static const String checkYourMessages = "Check your messages"; static const String referToSameOtpMessage = - "Please refer to the same OTP message shown below"; + "Enter the 6-digit code sent to your mobile"; static const String resendSms = "Resend SMS"; static const String otpVerifiedSucessfully = "OTP Verified Successfully!"; static const String otpVerifiedFailed = "OTP Verification Failed:"; @@ -155,7 +156,8 @@ class AppText { static const String previewTitle = "Withdrawal confirmation"; static const String info1 = 'Please confirm the withdrawal amount and verify the accuracy of your bank details.'; - static const String workingDays = 'Processing times vary from 3-7 working days'; + static const String workingDays = + 'Processing times vary from 3-7 working days'; static const String balance = 'Wallet balance: '; static const String withdrawTitle = 'Withdrawal'; static const String depositTitle = 'Deposit'; diff --git a/lib/features/MainScreens/Invest/presentation/widgets/key_investment_section.dart b/lib/features/MainScreens/Invest/presentation/widgets/key_investment_section.dart index 1aed2e2..5708807 100644 --- a/lib/features/MainScreens/Invest/presentation/widgets/key_investment_section.dart +++ b/lib/features/MainScreens/Invest/presentation/widgets/key_investment_section.dart @@ -49,7 +49,7 @@ class KeyInvestmentSection extends StatelessWidget { bottom: 12, ), child: investmentSectionCardText( - AppImages.timeSquareIcon, + imageList[index], "Nunc vulputate libero et velit interdum", "ac aliquet odio mattis.", ), @@ -62,6 +62,13 @@ class KeyInvestmentSection extends StatelessWidget { } } +List imageList = [ + AppImages.timeSquareIcon, + AppImages.walletIcon, + AppImages.ticketIcon, + AppImages.scannerIcon +]; + Widget investmentSectionCardText( String icon, String title, diff --git a/lib/features/MainScreens/Portfolio/domain/model/portfolio_model.dart b/lib/features/MainScreens/Portfolio/domain/model/portfolio_model.dart index 899f46b..31e227e 100644 --- a/lib/features/MainScreens/Portfolio/domain/model/portfolio_model.dart +++ b/lib/features/MainScreens/Portfolio/domain/model/portfolio_model.dart @@ -51,6 +51,26 @@ List portfolioModelList = [ currentValuationUSD: "14,685", totalReturnPercentage: "10.0%", ), + PortfolioModel( + date: "Jul 10 2025", + title: "Real estate III", + status: "Exited", + investmentAmountSAR: "SAR 10,000", + investmentAmountUSD: "2,670", + currentValuationSAR: "SAR 8,000", + currentValuationUSD: "2,136", + totalReturnPercentage: "20.0%", + ), + PortfolioModel( + date: "Jul 10 2025", + title: "Real estate III", + status: "Exited", + investmentAmountSAR: "SAR 10,000", + investmentAmountUSD: "2,670", + currentValuationSAR: "SAR 8,000", + currentValuationUSD: "2,136", + totalReturnPercentage: "20.0%", + ), PortfolioModel( date: "Jul 10 2025", title: "Real estate III", diff --git a/lib/features/MainScreens/Portfolio/presentation/pages/portfolio_layout.dart b/lib/features/MainScreens/Portfolio/presentation/pages/portfolio_layout.dart index 454c470..124a860 100644 --- a/lib/features/MainScreens/Portfolio/presentation/pages/portfolio_layout.dart +++ b/lib/features/MainScreens/Portfolio/presentation/pages/portfolio_layout.dart @@ -68,7 +68,7 @@ class PortfolioLayout extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ TextWidget().text14W700( - AppText.portfolio, + AppText.portfolioText, clr: const Color(0xFFC9D9CB), ), Gap( diff --git a/lib/features/MainScreens/Portfolio/presentation/widgets/details_section.dart b/lib/features/MainScreens/Portfolio/presentation/widgets/details_section.dart index b6dfbd4..0b3bafa 100644 --- a/lib/features/MainScreens/Portfolio/presentation/widgets/details_section.dart +++ b/lib/features/MainScreens/Portfolio/presentation/widgets/details_section.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:gap/gap.dart'; import 'package:tanami_app/core/styles/app_color.dart'; + import '../../../../../core/styles/app_text.dart'; import '../../../../../shared/components/text_widget.dart'; @@ -130,7 +131,7 @@ class DetailsSection extends StatelessWidget { ], ), SizedBox( - height: 8.h, + height: 22.h, ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/lib/features/register/presentation/pages/register_layout.dart b/lib/features/register/presentation/pages/register_layout.dart index c059f6c..ed226ff 100644 --- a/lib/features/register/presentation/pages/register_layout.dart +++ b/lib/features/register/presentation/pages/register_layout.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:tanami_app/core/styles/app_color.dart'; import 'package:tanami_app/features/register/presentation/widgets/register_bottom_section.dart'; import 'package:tanami_app/features/register/presentation/widgets/register_form.dart'; import 'package:tanami_app/features/register/presentation/widgets/register_top_section.dart'; @@ -9,13 +10,14 @@ class RegisterLayout extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: AppColor.plainWhite, body: ListView( - // - children: const [ - RegisterTopSection(), - RegisterForm(), - RegisterBottomSection(), - ], - )); + // + children: const [ + RegisterTopSection(), + RegisterForm(), + RegisterBottomSection(), + ], + )); } } diff --git a/lib/features/register/presentation/pages/register_step_layout.dart b/lib/features/register/presentation/pages/register_step_layout.dart index 0c656ea..3cfcf76 100644 --- a/lib/features/register/presentation/pages/register_step_layout.dart +++ b/lib/features/register/presentation/pages/register_step_layout.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:gap/gap.dart'; +import 'package:tanami_app/core/styles/app_color.dart'; import 'package:tanami_app/features/register/presentation/widgets/register_step_count.dart'; import '../widgets/register_step_bottom_section.dart'; @@ -11,13 +12,14 @@ class RegisterStepLayout extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: AppColor.plainWhite, body: ListView( - children: const [ - RegisterStepTopSection(), - Gap(20), - RegisterStepCount(), - RegisterStepBottomSection(), - ], - )); + children: const [ + RegisterStepTopSection(), + Gap(20), + RegisterStepCount(), + RegisterStepBottomSection(), + ], + )); } } diff --git a/lib/features/register/presentation/pages/register_user_details_layout.dart b/lib/features/register/presentation/pages/register_user_details_layout.dart index 2a49b8f..1a13a28 100644 --- a/lib/features/register/presentation/pages/register_user_details_layout.dart +++ b/lib/features/register/presentation/pages/register_user_details_layout.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:tanami_app/features/register/presentation/widgets/register_user_bottom_section.dart'; +import '../../../../core/styles/app_color.dart'; import '../../../../shared/components/appbar_widget.dart'; import '../widgets/register_user_form.dart'; import '../widgets/register_user_top_section.dart'; @@ -11,6 +12,7 @@ class RegisterUserDetailsLayout extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: AppColor.plainWhite, appBar: const AppBarWidget( height: 75, titleTxt: "", diff --git a/lib/features/register/presentation/widgets/register_bottom_section.dart b/lib/features/register/presentation/widgets/register_bottom_section.dart index 1ec667f..4584c6c 100644 --- a/lib/features/register/presentation/widgets/register_bottom_section.dart +++ b/lib/features/register/presentation/widgets/register_bottom_section.dart @@ -12,7 +12,6 @@ import '../../../../core/routes/routes.dart'; import '../../../../core/styles/app_color.dart'; import '../../../../core/styles/app_text.dart'; import '../../../../shared/components/button_widget.dart'; -import '../../../../shared/components/text_widget.dart'; import '../../../countrySelection/presentation/bloc/choose_country_bloc.dart'; import '../bloc/register_bloc.dart'; import '../bloc/register_event.dart'; @@ -88,15 +87,16 @@ class RegisterBottomSection extends StatelessWidget { ); }, ), - const Gap(5), - ButtonWidget().textBtn( - function: () { - radioBloc.resetSelection(); - goRouter.pop(); - }, - text: TextWidget().text14W700(AppText.backText, - clr: AppColor.textLabelColor, - textDecoration: TextDecoration.underline)), + const Gap(10), + ButtonWidget().textBorderBtn( + clr: AppColor.plainWhite, + borderClr: AppColor.txtBorderColor, + function: () { + radioBloc.resetSelection(); + goRouter.pop(); + }, + text: AppText.backText, + ) ], ); } diff --git a/lib/features/register/presentation/widgets/register_step_bottom_section.dart b/lib/features/register/presentation/widgets/register_step_bottom_section.dart index d76b878..77d20ee 100644 --- a/lib/features/register/presentation/widgets/register_step_bottom_section.dart +++ b/lib/features/register/presentation/widgets/register_step_bottom_section.dart @@ -7,7 +7,6 @@ import 'package:tanami_app/core/styles/app_color.dart'; import 'package:tanami_app/shared/components/button_widget.dart'; import '../../../../core/styles/app_text.dart'; -import '../../../../shared/components/text_widget.dart'; class RegisterStepBottomSection extends StatelessWidget { const RegisterStepBottomSection({super.key}); @@ -36,17 +35,16 @@ class RegisterStepBottomSection extends StatelessWidget { ), ), const Gap(16), - ButtonWidget().textBtn( - function: () { - goRouter.goNamed(RouteName.loginScreen, pathParameters: { - "fromScreen": "registerStep", - }); - }, - text: TextWidget().text14W700( - AppText.loginText, - clr: AppColor.darkGreyColor, - textDecoration: TextDecoration.underline, - )) + ButtonWidget().textBorderBtn( + clr: AppColor.plainWhite, + borderClr: AppColor.txtBorderColor, + function: () { + goRouter.goNamed(RouteName.loginScreen, pathParameters: { + "fromScreen": "registerStep", + }); + }, + text: AppText.loginText, + ) ], ), ); diff --git a/lib/features/securePin/presentation/pages/confirm_pin_layout.dart b/lib/features/securePin/presentation/pages/confirm_pin_layout.dart index feda010..949c063 100644 --- a/lib/features/securePin/presentation/pages/confirm_pin_layout.dart +++ b/lib/features/securePin/presentation/pages/confirm_pin_layout.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import '../../../../core/styles/app_color.dart'; import '../widgets/confirm_pin_keypad_section.dart'; import '../widgets/confirm_pin_top_section.dart'; @@ -9,11 +10,12 @@ class ConfirmPinLayout extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: AppColor.plainWhite, body: ListView( - children: const [ - ConfirmPinTopSection(), - ConfirmPinKey(), - ], - )); + children: const [ + ConfirmPinTopSection(), + ConfirmPinKey(), + ], + )); } } diff --git a/lib/features/securePin/presentation/pages/pin_layout.dart b/lib/features/securePin/presentation/pages/pin_layout.dart index 3448cd1..91da8a2 100644 --- a/lib/features/securePin/presentation/pages/pin_layout.dart +++ b/lib/features/securePin/presentation/pages/pin_layout.dart @@ -2,28 +2,32 @@ import 'package:flutter/material.dart'; import 'package:tanami_app/features/securePin/presentation/widgets/pin_keypad_section.dart'; import 'package:tanami_app/features/securePin/presentation/widgets/pin_top_section.dart'; +import '../../../../core/styles/app_color.dart'; + class PinLayout extends StatelessWidget { final String fromScreen; const PinLayout({super.key, required this.fromScreen}); @override Widget build(BuildContext context) { - return Scaffold(body: LayoutBuilder(builder: (context, constraints) { - return SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minHeight: constraints.maxHeight, - ), - child: Column( - children: [ - PinTopSection(fromScreen: fromScreen), - PinKey( - fromScreen: fromScreen, + return Scaffold( + backgroundColor: AppColor.plainWhite, + body: LayoutBuilder(builder: (context, constraints) { + return SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minHeight: constraints.maxHeight, ), - ], - ), - ), - ); - })); + child: Column( + children: [ + PinTopSection(fromScreen: fromScreen), + PinKey( + fromScreen: fromScreen, + ), + ], + ), + ), + ); + })); } } diff --git a/lib/features/securePin/presentation/widgets/confirm_pin_keypad_section.dart b/lib/features/securePin/presentation/widgets/confirm_pin_keypad_section.dart index b1d7c45..13316a8 100644 --- a/lib/features/securePin/presentation/widgets/confirm_pin_keypad_section.dart +++ b/lib/features/securePin/presentation/widgets/confirm_pin_keypad_section.dart @@ -77,7 +77,7 @@ class ConfirmPinKey extends StatelessWidget { context.read().add(BackspacePressed()); }, child: Container( - margin: const EdgeInsets.all(10), + margin: const EdgeInsets.all(12), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all(color: Colors.black12), @@ -94,7 +94,7 @@ class ConfirmPinKey extends StatelessWidget { context.read().add(NumberPressed(number)); }, child: Container( - margin: const EdgeInsets.all(10), + margin: const EdgeInsets.all(12), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all(color: Colors.black12), diff --git a/lib/features/securePin/presentation/widgets/pin_keypad_section.dart b/lib/features/securePin/presentation/widgets/pin_keypad_section.dart index 0c8e02f..3fb8179 100644 --- a/lib/features/securePin/presentation/widgets/pin_keypad_section.dart +++ b/lib/features/securePin/presentation/widgets/pin_keypad_section.dart @@ -88,7 +88,7 @@ class PinKey extends StatelessWidget { ), ) : const SizedBox(), - const Gap(30), + const Gap(20), GridView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), @@ -106,7 +106,7 @@ class PinKey extends StatelessWidget { context.read().add(BackspacePressed()); }, child: Container( - margin: const EdgeInsets.all(10), + margin: const EdgeInsets.all(12), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all(color: Colors.black12), @@ -123,7 +123,7 @@ class PinKey extends StatelessWidget { context.read().add(NumberPressed(number)); }, child: Container( - margin: const EdgeInsets.all(10), + margin: const EdgeInsets.all(12), decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all(color: Colors.black12), diff --git a/lib/shared/components/button_widget.dart b/lib/shared/components/button_widget.dart index 29ee744..b9c34bd 100644 --- a/lib/shared/components/button_widget.dart +++ b/lib/shared/components/button_widget.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:tanami_app/core/styles/app_color.dart'; import 'package:tanami_app/shared/components/text_widget.dart'; @@ -15,6 +16,40 @@ class ButtonWidget { } //Elevated Button + Widget textBorderBtn({ + required String text, + required Color clr, + Color? txtClr, + Color? borderClr, + required VoidCallback function, + }) { + return InkWell( + onTap: function, + child: Container( + margin: const EdgeInsets.symmetric( + horizontal: 16, + ), + width: 1.sw, + height: 56.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30), + color: clr, + border: Border.all( + width: 1, + color: borderClr!, + )), + child: Center( + child: TextWidget().text14W700( + text, + clr: txtClr ?? AppColor.plainBlack, + textDecoration: TextDecoration.underline, + ), + ), + ), + ); + } + +//Elevated Button Widget elevatedBtn({ required String text, required Color clr,