user profile welcome widget improvement.

pull/46/head
Sikander Saleem 1 month ago
parent 8f0e910e4f
commit c83754fc4a

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

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

@ -1,7 +1,9 @@
import 'package:flutter/material.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/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
class WelcomeWidget extends StatelessWidget {
@ -23,32 +25,25 @@ class WelcomeWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(30),
child: Row(
mainAxisSize: MainAxisSize.min,
spacing: 8.h,
children: [
// Profile image
Image.asset(imageUrl, width: 40, height: 40),
const SizedBox(width: 10),
// Text column
Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4.h,
mainAxisSize: MainAxisSize.min,
children: [
"Welcome".toText14(color: AppColors.greyTextColor),
"Welcome".needTranslation.toText14(color: AppColors.greyTextColor, height: 1, weight: FontWeight.w500),
Row(
spacing: 4.h,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
name.toText16(isBold: true),
const SizedBox(width: 4),
name.toText16(weight: FontWeight.w500, textOverflow: TextOverflow.ellipsis, maxlines: 1, height: 1).expanded,
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/widget_extensions.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/theme/colors.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/transitions/fade_page.dart';
import 'package:provider/provider.dart';
class ProfileSettings extends StatefulWidget {
@ -123,10 +126,14 @@ class _ProfileSettingsState extends State<ProfileSettings> {
backgroundColor: Color(0xff45A2F8).withValues(alpha: 0.08),
padding: EdgeInsets.all(8.h),
fontSize: 14,
onPressed: () {},
onPressed: () {
Navigator.of(context).push(FadePage(page: RechargeWalletPage()));
},
),
],
),
).onPress(() {
Navigator.of(context).push(FadePage(page: HabibWalletPage()));
}),
)
],
),

Loading…
Cancel
Save