diff --git a/lib/app/features/auth/views/pages/auth_page/auth_page.dart b/lib/app/features/auth/views/pages/auth_page/auth_page.dart index e1342928f..f530fd17a 100644 --- a/lib/app/features/auth/views/pages/auth_page/auth_page.dart +++ b/lib/app/features/auth/views/pages/auth_page/auth_page.dart @@ -8,6 +8,7 @@ import 'package:ice/app/features/auth/providers/auth_provider.dart'; import 'package:ice/app/features/auth/views/pages/check_email/check_email.dart'; import 'package:ice/app/features/auth/views/pages/fill_profile/fill_profile.dart'; import 'package:ice/app/features/auth/views/pages/select_country/select_country.dart'; +import 'package:ice/app/shared/widgets/auth_header/auth_header.dart'; import 'package:ice/app/shared/widgets/button/button.dart'; import 'package:ice/app/shared/widgets/email_input.dart'; import 'package:ice/app/shared/widgets/modal_wrapper.dart'; @@ -62,27 +63,9 @@ class AuthPage extends HookConsumerWidget { margin: const EdgeInsets.symmetric(horizontal: kDefaultPadding), child: Column( children: [ - const SizedBox( - height: 65, - ), - Image.asset( - Assets.images.iceRound.path, - ), - const SizedBox( - height: 19, - ), - Text( - 'Get started', - style: context.theme.appTextThemes.headline1, - ), - Text( - 'Choose your login method', - style: context.theme.appTextThemes.body2.copyWith( - color: context.theme.appColors.tertararyText, - ), - ), - const SizedBox( - height: 35, + AuthHeaderWidget( + title: 'Get started', + description: 'Choose your login method', ), EmailInput(formKey: emailFormKey), const SizedBox( diff --git a/lib/app/shared/widgets/auth_header/auth_header.dart b/lib/app/shared/widgets/auth_header/auth_header.dart new file mode 100644 index 000000000..bd9c30fcb --- /dev/null +++ b/lib/app/shared/widgets/auth_header/auth_header.dart @@ -0,0 +1,55 @@ +import 'package:flutter/material.dart'; +import 'package:ice/app/extensions/build_context.dart'; +import 'package:ice/app/extensions/theme_data.dart'; +import 'package:ice/generated/assets.gen.dart'; + +class AuthHeaderWidget extends StatelessWidget { + AuthHeaderWidget({ + this.topPadding = 65.0, + this.bottomPadding = 30.0, + this.title = '', + String? description, + String? imagePath, + }) : description = description ?? '', // Ensure description is not null + imagePath = imagePath ?? Assets.images.iceRound.path; + + final double topPadding; + final double bottomPadding; + final String title; + final String description; + final String imagePath; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Padding( + padding: EdgeInsets.only(top: topPadding), + child: Image.asset( + imagePath, + ), + ), + Padding( + padding: const EdgeInsets.only(top: 19, bottom: 3), + child: Text( + title, + style: context.theme.appTextThemes.headline1, + ), + ), + Visibility( + visible: description + .isNotEmpty, // Show the Text widget only if description is not empty + child: Text( + description, + style: context.theme.appTextThemes.body2.copyWith( + color: context.theme.appColors.tertararyText, + ), + ), + ), + SizedBox( + height: bottomPadding, + ), + ], + ); + } +}