diff --git a/lib/data/services/api/your_tenders_api.dart b/lib/data/services/api/your_tenders_api.dart index 389b286..3059d29 100644 --- a/lib/data/services/api/your_tenders_api.dart +++ b/lib/data/services/api/your_tenders_api.dart @@ -8,7 +8,7 @@ class YourTendersApi { required String createdTo, required String status, }) { - String url = '$tenderApproval?limit=$limit&offset=$offset'; + String url = '$tenderApproval?limit=$limit&offset=$offset&status=submitted'; if (createdFrom.isNotEmpty && createdTo.isNotEmpty) { url += '&created_from=$createdFrom&created_to=$createdTo'; diff --git a/lib/views/forget_password_create/pages/d_forget_password_create_page.dart b/lib/views/forget_password_create/pages/d_forget_password_create_page.dart index 89cec71..0bf25c1 100644 --- a/lib/views/forget_password_create/pages/d_forget_password_create_page.dart +++ b/lib/views/forget_password_create/pages/d_forget_password_create_page.dart @@ -56,143 +56,139 @@ class _DesktopForgotPasswordCreatePageState mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Center( - child: Consumer( - builder: (context, viewModel, _) { - return Center( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 110), - child: SizedBox( - width: 364, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 22.0.w()), - child: SvgPicture.asset( - AssetsManager.logoBig, - width: double.infinity, - height: 50.0.h(), - ), + Consumer( + builder: (context, viewModel, _) { + return Expanded( + child: Center( + child: SizedBox( + width: 364, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 22.0.w()), + child: SvgPicture.asset( + AssetsManager.logoBig, + width: double.infinity, + height: 50.0.h(), ), - SizedBox(height: 72.0.h()), - Text( - ForgotPasswordCreateStrings.forgotPasswordTitle, - style: TextStyle( - fontSize: 28.0.sp(), - fontWeight: FontWeight.bold, - color: AppColors.grey80, - ), + ), + SizedBox(height: 72.0.h()), + Text( + ForgotPasswordCreateStrings.forgotPasswordTitle, + style: TextStyle( + fontSize: 28.0.sp(), + fontWeight: FontWeight.bold, + color: AppColors.grey80, ), - SizedBox(height: 16.0.h()), - Text( - ForgotPasswordCreateStrings.forgotPasswordSubtitle, - textAlign: TextAlign.center, + ), + SizedBox(height: 16.0.h()), + Text( + ForgotPasswordCreateStrings.forgotPasswordSubtitle, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w400, + color: AppColors.grey60, + ), + ), + SizedBox(height: 40.0.h()), + LoginTextField( + controller: viewModel.newPasswordController, + focusNode: viewModel.newPasswordFocus, + label: ForgotPasswordCreateStrings.createNewPassword, + iconPath: AssetsManager.passwordIcon, + isPassword: true, + obscureText: viewModel.obscureForgotPassword, + onToggleVisibility: + viewModel.toggleForgotPasswordVisibility, + ), + SizedBox(height: 16.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLast5Character, style: TextStyle( fontSize: 14.0.sp(), - fontWeight: FontWeight.w400, color: AppColors.grey60, ), ), - SizedBox(height: 40.0.h()), - LoginTextField( - controller: viewModel.newPasswordController, - focusNode: viewModel.newPasswordFocus, - label: - ForgotPasswordCreateStrings.createNewPassword, - iconPath: AssetsManager.passwordIcon, - isPassword: true, - obscureText: viewModel.obscureForgotPassword, - onToggleVisibility: - viewModel.toggleForgotPasswordVisibility, - ), - SizedBox(height: 16.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLast5Character, - style: TextStyle( - fontSize: 14.0.sp(), - color: AppColors.grey60, - ), + ), + SizedBox(height: 6.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLeast1uppercase, + style: TextStyle( + fontSize: 14.0.sp(), + color: AppColors.grey60, ), ), - SizedBox(height: 6.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLeast1uppercase, - style: TextStyle( - fontSize: 14.0.sp(), - color: AppColors.grey60, - ), + ), + SizedBox(height: 6.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLeast1lowercase, + style: TextStyle( + fontSize: 14.0.sp(), + color: AppColors.grey60, ), ), - SizedBox(height: 6.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLeast1lowercase, - style: TextStyle( - fontSize: 14.0.sp(), - color: AppColors.grey60, - ), + ), + SizedBox(height: 6.0.h()), + Container( + alignment: Alignment.centerLeft, + padding: EdgeInsets.only(left: 16.0.w()), + child: Text( + ForgotPasswordCreateStrings.atLeastSpecial, + style: TextStyle( + fontSize: 14.0.sp(), + color: AppColors.grey60, ), ), - SizedBox(height: 6.0.h()), - Container( - alignment: Alignment.centerLeft, - padding: EdgeInsets.only(left: 16.0.w()), - child: Text( - ForgotPasswordCreateStrings.atLeastSpecial, - style: TextStyle( - fontSize: 14.0.sp(), - color: AppColors.grey60, - ), + ), + SizedBox(height: 80.0.h()), + viewModel.isResetPasswordLoading + ? BaseButton( + isEnabled: viewModel.isNewPasswordValid, + text: ForgotPasswordCreateStrings.resetLink, + onPressed: null, + isLoading: true, + ) + : BaseButton( + isEnabled: viewModel.isNewPasswordValid, + text: ForgotPasswordCreateStrings.resetLink, + onPressed: + viewModel.isNewPasswordValid + ? () async { + viewModel.resetPassword(); + } + : null, ), - ), - SizedBox(height: 80.0.h()), - viewModel.isResetPasswordLoading - ? BaseButton( - isEnabled: viewModel.isNewPasswordValid, - text: ForgotPasswordCreateStrings.resetLink, - onPressed: null, - isLoading: true, - ) - : BaseButton( - isEnabled: viewModel.isNewPasswordValid, - text: ForgotPasswordCreateStrings.resetLink, - onPressed: - viewModel.isNewPasswordValid - ? () async { - viewModel.resetPassword(); - } - : null, - ), - TextButton( - onPressed: () { - context.pop(); - }, - child: Text( - ForgotPasswordCreateStrings.backToSignInButton, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w500, - color: AppColors.mainBlue, - ), + TextButton( + onPressed: () { + context.pop(); + }, + child: Text( + ForgotPasswordCreateStrings.backToSignInButton, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.mainBlue, ), ), - ], - ), + ), + ], ), ), - ); - }, - ), + ), + ); + }, ), Padding( padding: EdgeInsets.symmetric( diff --git a/lib/views/forget_password_otp.dart/pages/d_forget_password_otp_page.dart b/lib/views/forget_password_otp.dart/pages/d_forget_password_otp_page.dart index 735b3e7..e3b469c 100644 --- a/lib/views/forget_password_otp.dart/pages/d_forget_password_otp_page.dart +++ b/lib/views/forget_password_otp.dart/pages/d_forget_password_otp_page.dart @@ -61,8 +61,7 @@ class _DesktopForgotPasswordOtpPageState return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 100), + Expanded( child: Center( child: SizedBox( width: 364, diff --git a/lib/views/forgot_password/pages/d_forgot_apssword_page.dart b/lib/views/forgot_password/pages/d_forgot_apssword_page.dart index 1d4a6e5..805ced0 100644 --- a/lib/views/forgot_password/pages/d_forgot_apssword_page.dart +++ b/lib/views/forgot_password/pages/d_forgot_apssword_page.dart @@ -62,80 +62,83 @@ class _DesktopForgotPasswordPageState extends State { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 110), - child: SizedBox( - width: 364, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 22.0.w()), - child: SvgPicture.asset( - AssetsManager.logoBig, - width: double.infinity, - height: 50.0.h(), - ), - ), - SizedBox(height: 72.0.h()), - Text( - ForgotPasswordStrings.forgotPasswordTitle, - style: TextStyle( - fontSize: 28.0.sp(), - fontWeight: FontWeight.bold, - color: AppColors.grey80, - ), - ), - SizedBox(height: 16.0.h()), - Text( - ForgotPasswordStrings.forgotPasswordSubtitle, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w400, - color: AppColors.grey60, - ), - ), - SizedBox(height: 40.0.h()), - LoginTextField( - controller: viewModel.emailController, - focusNode: viewModel.emailFocus, - label: ForgotPasswordStrings.emailHint, - isPassword: false, - ), - SizedBox(height: 70.0.h()), - viewModel.isLoadingForgot - ? const BaseButton( - isEnabled: false, - text: ForgotPasswordStrings.resetLink, - onPressed: null, - isLoading: true, - ) - : BaseButton( - isEnabled: viewModel.isEmailValid, - text: ForgotPasswordStrings.resetLink, - onPressed: - viewModel.isEmailValid - ? () async { - await viewModel.forgotPassword(context); - } - : null, + Expanded( + child: Center( + child: SizedBox( + width: 364, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 22.0.w()), + child: SvgPicture.asset( + AssetsManager.logoBig, + width: double.infinity, + height: 50.0.h(), ), - const SizedBox(height: 12), - TextButton( - onPressed: () { - Navigator.pop(context); - }, - child: Text( - ForgotPasswordStrings.backToSignInButton, + ), + SizedBox(height: 72.0.h()), + Text( + ForgotPasswordStrings.forgotPasswordTitle, + style: TextStyle( + fontSize: 28.0.sp(), + fontWeight: FontWeight.bold, + color: AppColors.grey80, + ), + ), + SizedBox(height: 16.0.h()), + Text( + ForgotPasswordStrings.forgotPasswordSubtitle, + textAlign: TextAlign.center, style: TextStyle( fontSize: 14.0.sp(), - fontWeight: FontWeight.w500, - color: AppColors.mainBlue, + fontWeight: FontWeight.w400, + color: AppColors.grey60, ), ), - ), - ], + SizedBox(height: 40.0.h()), + LoginTextField( + controller: viewModel.emailController, + focusNode: viewModel.emailFocus, + label: ForgotPasswordStrings.emailHint, + isPassword: false, + ), + SizedBox(height: 70.0.h()), + viewModel.isLoadingForgot + ? const BaseButton( + isEnabled: false, + text: ForgotPasswordStrings.resetLink, + onPressed: null, + isLoading: true, + ) + : BaseButton( + isEnabled: viewModel.isEmailValid, + text: ForgotPasswordStrings.resetLink, + onPressed: + viewModel.isEmailValid + ? () async { + await viewModel.forgotPassword( + context, + ); + } + : null, + ), + const SizedBox(height: 12), + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: Text( + ForgotPasswordStrings.backToSignInButton, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.mainBlue, + ), + ), + ), + ], + ), ), ), ), diff --git a/lib/views/home/pages/d_home_page.dart b/lib/views/home/pages/d_home_page.dart index 68f37f9..09c2a33 100644 --- a/lib/views/home/pages/d_home_page.dart +++ b/lib/views/home/pages/d_home_page.dart @@ -230,7 +230,14 @@ class DesktopHomePage extends StatelessWidget { scrollDirection: Axis.horizontal, itemBuilder: (context, index) { if (index < homeViewModel.tenders.length) { - return TendersListItem(tender: homeViewModel.tenders[index]); + return TendersListItem( + tender: homeViewModel.tenders[index], + onTap: () { + TenderDetailRouteData( + tenderId: homeViewModel.tenders[index].id!, + ).push(context); + }, + ); } else { return const Center( child: Padding( diff --git a/lib/views/home/pages/m_home_page.dart b/lib/views/home/pages/m_home_page.dart index 2d9f150..face213 100644 --- a/lib/views/home/pages/m_home_page.dart +++ b/lib/views/home/pages/m_home_page.dart @@ -211,7 +211,14 @@ class MobileHomePage extends StatelessWidget { scrollDirection: Axis.horizontal, itemBuilder: (context, index) { if (index < homeViewModel.tenders.length) { - return TendersListItem(tender: homeViewModel.tenders[index]); + return TendersListItem( + tender: homeViewModel.tenders[index], + onTap: () { + TenderDetailRouteData( + tenderId: homeViewModel.tenders[index].id!, + ).push(context); + }, + ); } else { return const Center( child: Padding( diff --git a/lib/views/home/pages/t_home_page.dart b/lib/views/home/pages/t_home_page.dart index b5a0c2e..7428020 100644 --- a/lib/views/home/pages/t_home_page.dart +++ b/lib/views/home/pages/t_home_page.dart @@ -232,7 +232,14 @@ class TabletHomePage extends StatelessWidget { scrollDirection: Axis.horizontal, itemBuilder: (context, index) { if (index < homeViewModel.tenders.length) { - return TendersListItem(tender: homeViewModel.tenders[index]); + return TendersListItem( + tender: homeViewModel.tenders[index], + onTap: () { + TenderDetailRouteData( + tenderId: homeViewModel.tenders[index].id!, + ).push(context); + }, + ); } else { return const Center( child: Padding( diff --git a/lib/views/home/strings/home_strings.dart b/lib/views/home/strings/home_strings.dart index 08ad8f5..ee946e6 100644 --- a/lib/views/home/strings/home_strings.dart +++ b/lib/views/home/strings/home_strings.dart @@ -16,4 +16,5 @@ class HomeStrings { static const String tenderDeadline = 'Deadline'; static const String recommendedTenders = 'Recommended Tenders'; static const String tenderMatchProfile = 'Match with your profile'; + static const String seeMoreButton = 'See More'; } diff --git a/lib/views/home/tenders_list_item.dart b/lib/views/home/tenders_list_item.dart index 510048c..1db12c0 100644 --- a/lib/views/home/tenders_list_item.dart +++ b/lib/views/home/tenders_list_item.dart @@ -8,11 +8,13 @@ import 'package:tm_app/views/home/widgets/tender_card_progress_bar.dart'; import '../../core/constants/assets.dart'; import '../../core/theme/colors.dart'; import '../../core/utils/size_config.dart'; +import '../shared/base_button.dart'; import '../shared/flag.dart'; class TendersListItem extends StatelessWidget { - const TendersListItem({required this.tender, super.key}); + const TendersListItem({required this.tender, required this.onTap, super.key}); final TenderData tender; + final VoidCallback onTap; @override Widget build(BuildContext context) { @@ -102,24 +104,36 @@ class TendersListItem extends StatelessWidget { const TenderCardProgressBar(), SizedBox(height: 15.0.h()), - Row( - children: [ - SvgPicture.asset(AssetsManager.location), - SizedBox(width: 1.0.w()), - Text( - tender.countryCode!, - style: TextStyle( - fontSize: 12.0.sp(), - fontWeight: FontWeight.w400, - color: AppColors.grey80, + Expanded( + child: Row( + children: [ + SvgPicture.asset(AssetsManager.location), + SizedBox(width: 1.0.w()), + Text( + tender.countryCode!, + style: TextStyle( + fontSize: 12.0.sp(), + fontWeight: FontWeight.w400, + color: AppColors.grey80, + ), ), - ), - SizedBox(width: 8.0.w()), - tender.countryCode != null - ? Flag(countryCode: tender.countryCode!) - : const Flag(countryCode: ''), - const Spacer(), - ], + SizedBox(width: 8.0.w()), + tender.countryCode != null + ? Flag(countryCode: tender.countryCode!) + : const Flag(countryCode: ''), + const Spacer(), + BaseButton( + text: HomeStrings.seeMoreButton, + backgroundColor: AppColors.primary2, + isEnabled: true, + width: 100.0.w(), + height: 40.0.h(), + textColor: AppColors.mainBlue, + fontSize: 12.0.sp(), + onPressed: onTap, + ), + ], + ), ), ], ), diff --git a/lib/views/login/pages/login_desktop_page.dart b/lib/views/login/pages/login_desktop_page.dart index b4fc9b4..df008d6 100644 --- a/lib/views/login/pages/login_desktop_page.dart +++ b/lib/views/login/pages/login_desktop_page.dart @@ -52,93 +52,100 @@ class _LoginDesktopPageState extends State { mainAxisAlignment: kIsWeb ? MainAxisAlignment.spaceAround : MainAxisAlignment.center, children: [ - SizedBox( - width: 536, - child: Consumer( - builder: (context, viewModel, _) { - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - SvgPicture.asset( - AssetsManager.logoBig, - width: 320, - height: 50, - fit: BoxFit.cover, - ), - SizedBox(height: 72.0.h()), - const LoginTitle(), - SizedBox(height: 32.0.h()), - LoginTextField( - controller: viewModel.usernameController, - focusNode: viewModel.usernameFocus, - label: LoginStrings.usernameLabel, - iconPath: AssetsManager.userIcon, - fieldHeight: 60.0.h(), - borderRedus: 12, - prefixIconPadding: 7.0.w(), - ), - SizedBox(height: 16.0.h()), - LoginTextField( - controller: viewModel.passwordController, - focusNode: viewModel.passwordFocus, - label: LoginStrings.passwordLabel, - iconPath: AssetsManager.passwordIcon, - prefixIconPadding: 7.0.w(), - isPassword: true, - obscureText: viewModel.obscurePassword, - fieldHeight: 60.0.h(), - onToggleVisibility: viewModel.togglePasswordVisibility, - borderRedus: 12, - ), - SizedBox(height: 32.0.h()), - if (viewModel.isLoading) - const BaseButton( - isEnabled: false, - onPressed: null, - isLoading: true, - ) - else - BaseButton( - isEnabled: viewModel.isLoginEnabled, - onPressed: () async { - if (viewModel.isLoginEnabled) { - await viewModel.login(); - } - }, - ), - const SizedBox(height: 32.0), - TextButton( - onPressed: () { - const ForgotPasswordRouteData().push(context); - }, - child: Text( - LoginStrings.forgotPassword, - style: TextStyle( - fontSize: 14.0.sp(), - fontWeight: FontWeight.w500, - color: AppColors.mainBlue, + Expanded( + child: Center( + child: SizedBox( + width: 364, + child: Consumer( + builder: (context, viewModel, _) { + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset( + AssetsManager.logoBig, + width: 320, + height: 50, + fit: BoxFit.cover, ), - ), - ), - ], - ); - }, + SizedBox(height: 72.0.h()), + const LoginTitle(), + SizedBox(height: 32.0.h()), + LoginTextField( + controller: viewModel.usernameController, + focusNode: viewModel.usernameFocus, + label: LoginStrings.usernameLabel, + iconPath: AssetsManager.userIcon, + fieldHeight: 60.0.h(), + borderRedus: 12, + prefixIconPadding: 7.0.w(), + ), + SizedBox(height: 16.0.h()), + LoginTextField( + controller: viewModel.passwordController, + focusNode: viewModel.passwordFocus, + label: LoginStrings.passwordLabel, + iconPath: AssetsManager.passwordIcon, + prefixIconPadding: 7.0.w(), + isPassword: true, + obscureText: viewModel.obscurePassword, + fieldHeight: 60.0.h(), + onToggleVisibility: + viewModel.togglePasswordVisibility, + borderRedus: 12, + ), + SizedBox(height: 32.0.h()), + if (viewModel.isLoading) + const BaseButton( + isEnabled: false, + onPressed: null, + isLoading: true, + ) + else + BaseButton( + isEnabled: viewModel.isLoginEnabled, + onPressed: () async { + if (viewModel.isLoginEnabled) { + await viewModel.login(); + } + }, + ), + const SizedBox(height: 32.0), + TextButton( + onPressed: () { + const ForgotPasswordRouteData().push(context); + }, + child: Text( + LoginStrings.forgotPassword, + style: TextStyle( + fontSize: 14.0.sp(), + fontWeight: FontWeight.w500, + color: AppColors.mainBlue, + ), + ), + ), + ], + ); + }, + ), + ), + ), + ), + + Padding( + padding: EdgeInsets.symmetric( + vertical: 20.0.h(), + horizontal: 25.0.w(), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(32), + child: Image.asset( + AssetsManager.webLoginImage, + width: 796.0, + height: 944.0, + fit: BoxFit.fitWidth, + ), ), ), - kIsWeb - ? Padding( - padding: EdgeInsets.symmetric(vertical: 20.0.h()), - child: ClipRRect( - borderRadius: BorderRadius.circular(32), - child: Image.asset( - AssetsManager.webLoginImage, - width: 796.0, - height: 944.0, - fit: BoxFit.fitWidth, - ), - ), - ) - : Container(), ], ), ), diff --git a/lib/views/login/pages/login_tablet_page.dart b/lib/views/login/pages/login_tablet_page.dart index 5886430..5b6d700 100644 --- a/lib/views/login/pages/login_tablet_page.dart +++ b/lib/views/login/pages/login_tablet_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:provider/provider.dart'; import 'package:tm_app/core/theme/colors.dart'; @@ -56,7 +57,14 @@ class _LoginTabletPageState extends State { return Column( mainAxisSize: MainAxisSize.min, children: [ - LoginLogo(width: 190.0.w(), height: 88.0.h()), + Padding( + padding: EdgeInsets.symmetric(horizontal: 22.0.w()), + child: SvgPicture.asset( + AssetsManager.logoBig, + width: double.infinity, + height: 50.0.h(), + ), + ), SizedBox(height: 32.0.h()), const LoginTitle(), SizedBox(height: 32.0.h()), diff --git a/lib/views/login/widgets/login_textfield.dart b/lib/views/login/widgets/login_textfield.dart index 7b25f46..28eb00a 100644 --- a/lib/views/login/widgets/login_textfield.dart +++ b/lib/views/login/widgets/login_textfield.dart @@ -45,6 +45,8 @@ class LoginTextField extends StatelessWidget { horizontal: 12.0.w(), ), labelText: label, + filled: true, + fillColor: AppColors.grey0, prefixIcon: iconPath != null ? Padding( diff --git a/lib/views/shared/base_button.dart b/lib/views/shared/base_button.dart index 09c471d..31ad29e 100644 --- a/lib/views/shared/base_button.dart +++ b/lib/views/shared/base_button.dart @@ -16,9 +16,11 @@ class BaseButton extends StatelessWidget { final double? borderRadius; final double? elevation; final double? width; + final double? height; final bool isLoading; final String? icon; final Color? iconColor; + final double? fontSize; const BaseButton({ required this.isEnabled, @@ -31,9 +33,11 @@ class BaseButton extends StatelessWidget { this.borderRadius, this.elevation, this.width, + this.height, this.isLoading = false, this.icon, this.iconColor, + this.fontSize, super.key, }); @@ -42,7 +46,7 @@ class BaseButton extends StatelessWidget { return isLoading ? Container( width: double.infinity, - height: 55.0.h(), + height: height ?? 55.0.h(), decoration: BoxDecoration( color: AppColors.mainBlue, borderRadius: BorderRadius.circular(28.0.w()), @@ -60,7 +64,7 @@ class BaseButton extends StatelessWidget { ) : SizedBox( width: width ?? double.infinity, - height: 55.0.h(), + height: height ?? 55.0.h(), child: ElevatedButton( onPressed: isEnabled ? onPressed : null, style: ElevatedButton.styleFrom( @@ -94,7 +98,7 @@ class BaseButton extends StatelessWidget { Text( text ?? LoginStrings.loginButton, style: TextStyle( - fontSize: 16.0.sp(), + fontSize: fontSize ?? 16.0.sp(), fontWeight: FontWeight.bold, color: textColor ?? AppColors.white, ), @@ -104,7 +108,7 @@ class BaseButton extends StatelessWidget { : Text( text ?? LoginStrings.loginButton, style: TextStyle( - fontSize: 16.0.sp(), + fontSize: fontSize ?? 16.0.sp(), fontWeight: FontWeight.bold, color: textColor ?? AppColors.white, ), diff --git a/lib/views/shared/desktop_navigation_widget.dart b/lib/views/shared/desktop_navigation_widget.dart index 75f20f5..3bb459b 100644 --- a/lib/views/shared/desktop_navigation_widget.dart +++ b/lib/views/shared/desktop_navigation_widget.dart @@ -36,7 +36,20 @@ class DesktopNavigationWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ const SizedBox(width: 40), - SvgPicture.asset(AssetsManager.logoSmall), + InkWell( + onTap: () { + if (currentIndex == 0) { + return; + } else { + Router.neglect( + context, + () => const HomeRouteData().go(context), + ); + context.read().init(); + } + }, + child: SvgPicture.asset(AssetsManager.logoSmall), + ), const Spacer(), _navigationItem( context: context,