user profile welcome widget improvement.

pull/46/head
Sikander Saleem 7 months ago
parent 8f0e910e4f
commit c83754fc4a

@ -132,7 +132,16 @@ extension EmailValidator on String {
decoration: isUnderLine ? TextDecoration.underline : null), decoration: isUnderLine ? TextDecoration.underline : null),
); );
Widget toText14({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, FontWeight? weight, int? maxlines, double? letterSpacing = -1, TextOverflow? textOverflow}) => Widget toText14(
{Color? color,
bool isUnderLine = false,
bool isBold = false,
bool isCenter = false,
FontWeight? weight,
int? maxlines,
double? letterSpacing = -1,
double? height,
TextOverflow? textOverflow}) =>
Text( Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
@ -142,6 +151,7 @@ extension EmailValidator on String {
color: color ?? AppColors.blackColor, color: color ?? AppColors.blackColor,
fontSize: 14.fSize, fontSize: 14.fSize,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
height: height,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
decoration: isUnderLine ? TextDecoration.underline : null), decoration: isUnderLine ? TextDecoration.underline : null),
); );
@ -167,6 +177,7 @@ extension EmailValidator on String {
double? height, double? height,
TextAlign? textAlign, TextAlign? textAlign,
FontWeight? weight, FontWeight? weight,
TextOverflow? textOverflow,
double? letterSpacing = -0.4, double? letterSpacing = -0.4,
}) => }) =>
Text( Text(
@ -178,6 +189,7 @@ extension EmailValidator on String {
fontSize: 16.fSize, fontSize: 16.fSize,
letterSpacing: letterSpacing, letterSpacing: letterSpacing,
height: height, height: height,
overflow: textOverflow,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal), fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
decoration: isUnderLine ? TextDecoration.underline : null, decoration: isUnderLine ? TextDecoration.underline : null,
), ),

@ -103,10 +103,8 @@ class _LandingPageState extends State<LandingPage> {
); );
}, },
name: ('${appState.getAuthenticatedUser()!.firstName!} ${appState.getAuthenticatedUser()!.lastName!}'), name: ('${appState.getAuthenticatedUser()!.firstName!} ${appState.getAuthenticatedUser()!.lastName!}'),
imageUrl: appState imageUrl: appState.getAuthenticatedUser()?.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg,
.getAuthenticatedUser() ).expanded
?.gender == 1 ? AppAssets.male_img : AppAssets.femaleImg,
)
: CustomButton( : CustomButton(
text: LocaleKeys.loginOrRegister.tr(context: context), text: LocaleKeys.loginOrRegister.tr(context: context),
onPressed: () async { onPressed: () async {
@ -122,6 +120,7 @@ class _LandingPageState extends State<LandingPage> {
height: 50, height: 50,
), ),
Row( Row(
mainAxisSize: MainAxisSize.min,
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 20, width: 20).onPress(() { Utils.buildSvgWithAssets(icon: AppAssets.bell, height: 20, width: 20).onPress(() {
Navigator.of(context).push( Navigator.of(context).push(
@ -173,8 +172,7 @@ class _LandingPageState extends State<LandingPage> {
CustomButton( CustomButton(
text: LocaleKeys.bookAppo.tr(context: context), text: LocaleKeys.bookAppo.tr(context: context),
onPressed: () { onPressed: () {
Navigator.of(context) Navigator.of(context).push(
.push(
FadePage( FadePage(
page: BookAppointmentPage(), page: BookAppointmentPage(),
), ),
@ -374,7 +372,7 @@ class _LandingPageState extends State<LandingPage> {
// sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, true); // sharedPref.setBool(HAS_ENABLED_QUICK_LOGIN, true);
authVM.loginWithFingerPrintFace(() { authVM.loginWithFingerPrintFace(() {
isDone = true; isDone = true;
cacheService.saveBool(key: CacheConst.quickLoginEnabled,value: true); cacheService.saveBool(key: CacheConst.quickLoginEnabled, value: true);
setState(() {}); setState(() {});
}); });
}, },

@ -1,7 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
class WelcomeWidget extends StatelessWidget { class WelcomeWidget extends StatelessWidget {
@ -23,32 +25,25 @@ class WelcomeWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
spacing: 8.h,
children: [ children: [
// Profile image
Image.asset(imageUrl, width: 40, height: 40), Image.asset(imageUrl, width: 40, height: 40),
const SizedBox(width: 10),
// Text column
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4.h,
mainAxisSize: MainAxisSize.min,
children: [ children: [
"Welcome".needTranslation.toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500),
"Welcome".toText14(color: AppColors.greyTextColor),
Row( Row(
spacing: 4.h,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
name.toText16(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1, height: 1).expanded,
name.toText16(isBold: true),
const SizedBox(width: 4),
const Icon(Icons.keyboard_arrow_down, size: 20, color: Colors.black), const Icon(Icons.keyboard_arrow_down, size: 20, color: Colors.black),
], ],
), ),
], ],
), ).expanded,
], ],
), ),
); );

@ -7,10 +7,13 @@ import 'package:hmg_patient_app_new/extensions/int_extensions.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart'; import 'package:hmg_patient_app_new/features/profile_settings/profile_settings_view_model.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page.dart';
import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart';
import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart'; import 'package:hmg_patient_app_new/widgets/chip/app_custom_chip_widget.dart';
import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ProfileSettings extends StatefulWidget { class ProfileSettings extends StatefulWidget {
@ -123,10 +126,14 @@ class _ProfileSettingsState extends State<ProfileSettings> {
backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08), backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08),
padding: EdgeInsets.all(8.h), padding: EdgeInsets.all(8.h),
fontSize: 14, fontSize: 14,
onPressed: () {}, onPressed: () {
Navigator.of(context).push(FadePage(page: RechargeWalletPage()));
},
), ),
], ],
), ).onPress(() {
Navigator.of(context).push(FadePage(page: HabibWalletPage()));
}),
) )
], ],
), ),

Loading…
Cancel
Save