From a1391eb4586ebef0759aed9bd70ea420c44f2b02 Mon Sep 17 00:00:00 2001 From: tahaalam Date: Tue, 30 Jun 2026 11:45:19 +0300 Subject: [PATCH] component sizes changed --- ...ent-profile-header-new-design-app-bar.dart | 10 +- lib/widgets/shared/app_drawer_widget.dart | 387 +++++++++--------- .../shared/bottom_navigation_item.dart | 54 +-- 3 files changed, 226 insertions(+), 225 deletions(-) diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index 6a308089..1061d8a3 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -46,11 +46,11 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget implements Pre decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 - ? isInpatient - ? 220 - : 200 - : height, + // height: height == 0 + // ? isInpatient + // ? 220 + // : 200 + // : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index c84e610b..c6e84d74 100755 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -30,224 +30,223 @@ class _AppDrawerState extends State { Widget build(BuildContext context) { AuthenticationViewModel authenticationViewModel = Provider.of(context); projectsProvider = Provider.of(context); - return Container( - color: Colors.white, - child: Drawer( - child: Column( - children: [ - Expanded( - flex: 7, - child: ListView(padding: EdgeInsets.zero, children: [ - Container( - margin: EdgeInsets.symmetric(horizontal: 15), - // height: SizeConfig.heightMultiplier! * 50, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - child: Image.asset( - 'assets/images/rsg_logo.png', - width: MediaQuery.of(context).size.width * 0.50, - height: MediaQuery.of(context).size.height * 0.16, + return Drawer( + backgroundColor: Colors.white, + width: MediaQuery.of(context).size.width *.68, + child: Column( + children: [ + Expanded( + flex: 7, + child: ListView(padding: EdgeInsets.zero, children: [ + Container( + margin: EdgeInsets.symmetric(horizontal: 15), + // height: SizeConfig.heightMultiplier! * 50, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + child: Image.asset( + 'assets/images/rsg_logo.png', + width: MediaQuery.of(context).size.width * 0.50, + height: MediaQuery.of(context).size.height * 0.16, + ), + margin: EdgeInsets.only(top: 10, bottom: 10), + ), + Container( + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Icon( + DoctorApp.close_1, + size: 20, + color: Color(0xff2B353E), ), - margin: EdgeInsets.only(top: 10, bottom: 10), ), - Container( - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Icon( - DoctorApp.close_1, - size: 20, - color: Color(0xff2B353E), + margin: EdgeInsets.only(top: 20, bottom: 10), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + ), + SizedBox(height: 5), + if (authenticationViewModel.doctorProfile != null) + InkWell( + onTap: () { + // TODO: return it back when its needed + // Navigator.of(context).pushNamed(PROFILE, arguments: { + // 'title': authProvider.doctorProfile.doctorName, + // "doctorProfileall": authProvider.doctorProfile + // }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 8.0), + child: AppText( + TranslationBase.of(context).dr + capitalizeOnlyFirstLater(authenticationViewModel.doctorProfile!.doctorName!.replaceAll("DR.", "").toLowerCase()), + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontSize: 25.0, + letterSpacing: -1.5, ), ), - margin: EdgeInsets.only(top: 20, bottom: 10), - ) - ], - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - ), - SizedBox(height: 5), - if (authenticationViewModel.doctorProfile != null) - InkWell( - onTap: () { - // TODO: return it back when its needed - // Navigator.of(context).pushNamed(PROFILE, arguments: { - // 'title': authProvider.doctorProfile.doctorName, - // "doctorProfileall": authProvider.doctorProfile - // }); - }, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only(top: 8.0), + Padding( + padding: EdgeInsets.only(top: 0), child: AppText( - TranslationBase.of(context).dr + capitalizeOnlyFirstLater(authenticationViewModel.doctorProfile!.doctorName!.replaceAll("DR.", "").toLowerCase()), - fontWeight: FontWeight.w700, + authenticationViewModel.doctorProfile!.clinicDescription!, + fontWeight: FontWeight.w500, color: Color(0xFF2E303A), + fontSize: 16, fontFamily: 'Poppins', - fontSize: 25.0, - letterSpacing: -1.5, - ), - ), - Padding( - padding: EdgeInsets.only(top: 0), - child: AppText( - authenticationViewModel.doctorProfile!.clinicDescription!, - fontWeight: FontWeight.w500, - color: Color(0xFF2E303A), - fontSize: 16, - fontFamily: 'Poppins', - letterSpacing: -0.96, - //textAlign: TextAlign.left, - )) - ], - ), + letterSpacing: -0.96, + //textAlign: TextAlign.left, + )) + ], ), - SizedBox(height: 40), - InkWell( - child: DrawerItem( - TranslationBase.of(context).applyOrRescheduleLeave, - icon: DoctorApp.reschedule__1, + ), + SizedBox(height: 40), + InkWell( + child: DrawerItem( + TranslationBase.of(context).applyOrRescheduleLeave, + icon: DoctorApp.reschedule__1, - // subTitle: , - ), - onTap: () { - Navigator.pop(context); - Navigator.push( - context, - MaterialPageRoute(builder: (context) => AddRescheduleLeaveScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') - // MyReferredPatient(), - )); - }, + // subTitle: , ), - SizedBox(height: 15), - InkWell( - child: DrawerItem( - TranslationBase.of(context).doctorRota, - icon: Icons.punch_clock, + onTap: () { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute(builder: (context) => AddRescheduleLeaveScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') + // MyReferredPatient(), + )); + }, + ), + SizedBox(height: 15), + InkWell( + child: DrawerItem( + TranslationBase.of(context).doctorRota, + icon: Icons.punch_clock, - // subTitle: , - ), - onTap: () { - Navigator.pop(context); - Navigator.push( - context, - MaterialPageRoute(builder: (context) => DoctorSchedulePage(), settings: RouteSettings(name: 'doctorSchedule') - // MyReferredPatient(), - )); - }, + // subTitle: , ), - SizedBox(height: 15), - InkWell( - child: DrawerItem( - TranslationBase.of(context).myQRCode, - icon: DoctorApp.qr_code_3, - // subTitle: , - ), + onTap: () { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute(builder: (context) => DoctorSchedulePage(), settings: RouteSettings(name: 'doctorSchedule') + // MyReferredPatient(), + )); + }, + ), + SizedBox(height: 15), + InkWell( + child: DrawerItem( + TranslationBase.of(context).myQRCode, + icon: DoctorApp.qr_code_3, + // subTitle: , ), - SizedBox(height: MediaQuery.of(context).size.height * 0.02), - InkWell( - child: Container( - height: MediaQuery.of(context).size.height * 0.16, - width: MediaQuery.of(context).size.width * 0.16, - child: Image.asset('assets/images/qr_code.png'), - ), - onTap: () {}, + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), + InkWell( + child: Container( + height: MediaQuery.of(context).size.height * 0.16, + width: MediaQuery.of(context).size.width * 0.16, + child: Image.asset('assets/images/qr_code.png'), ), - ], - ), - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.02, + onTap: () {}, + ), + ], ), - Container( - margin: EdgeInsets.symmetric(horizontal: 20), - child: Column( - children: [ - InkWell( - child: DrawerItem( - projectsProvider.isArabic ? TranslationBase.of(context).lanEnglish : TranslationBase.of(context).lanArabic, - // icon: DoctorApp.qr_code, - assetLink: projectsProvider.isArabic ? 'assets/images/usa-flag.png' : 'assets/images/saudi-arabia-flag.png', - ), - onTap: () { - if (projectsProvider.isArabic) - projectsProvider.changeLanguage('en'); - else - projectsProvider.changeLanguage('ar'); - }, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 20), + child: Column( + children: [ + InkWell( + child: DrawerItem( + projectsProvider.isArabic ? TranslationBase.of(context).lanEnglish : TranslationBase.of(context).lanArabic, + // icon: DoctorApp.qr_code, + assetLink: projectsProvider.isArabic ? 'assets/images/usa-flag.png' : 'assets/images/saudi-arabia-flag.png', ), - SizedBox(height: 10), - InkWell( - child: DrawerItem( - TranslationBase.of(context).logout, - icon: DoctorApp.logout_1, - ), - onTap: () async { - Navigator.pop(context); - await authenticationViewModel.logout(isFromLogin: false); - locator().pushNamedAndRemoveUntil(ROOT); - }, + onTap: () { + if (projectsProvider.isArabic) + projectsProvider.changeLanguage('en'); + else + projectsProvider.changeLanguage('ar'); + }, + ), + SizedBox(height: 10), + InkWell( + child: DrawerItem( + TranslationBase.of(context).logout, + icon: DoctorApp.logout_1, ), - ], - ), + onTap: () async { + Navigator.pop(context); + await authenticationViewModel.logout(isFromLogin: false); + locator().pushNamedAndRemoveUntil(ROOT); + }, + ), + ], ), - ]), - ), - Expanded( - flex: 1, - child: Column( - children: [ - Container( - // This align moves the children to the bottom - child: Align( - alignment: FractionalOffset.bottomCenter, - child: Container( - child: Padding( - padding: EdgeInsets.only(left: projectsProvider.isArabic ? 0 : 15.0, right: projectsProvider.isArabic ? 15.0 : 0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.5, - child: RichText( - text: TextSpan( - text: 'Powered by', - style: TextStyle( - color: Color(0xFF989898), - fontWeight: FontWeight.w600, - fontSize: 14, - fontFamily: 'Poppins', - letterSpacing: -0.56, - ), - children: [ - TextSpan( - text: ' Cloud Solutions', - style: TextStyle(color: Color(0xFF2E303A), fontSize: 14, fontFamily: 'Poppins', letterSpacing: -0.56, fontWeight: FontWeight.w700), - ) - ], + ), + ]), + ), + Expanded( + flex: 1, + child: Column( + children: [ + Container( + // This align moves the children to the bottom + child: Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + child: Padding( + padding: EdgeInsets.only(left: projectsProvider.isArabic ? 0 : 15.0, right: projectsProvider.isArabic ? 15.0 : 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + text: TextSpan( + text: 'Powered by', + style: TextStyle( + color: Color(0xFF989898), + fontWeight: FontWeight.w600, + fontSize: 14, + fontFamily: 'Poppins', + letterSpacing: -0.56, ), + children: [ + TextSpan( + text: ' Cloud Solutions', + style: TextStyle(color: Color(0xFF2E303A), fontSize: 14, fontFamily: 'Poppins', letterSpacing: -0.56, fontWeight: FontWeight.w700), + ) + ], ), ), - // Text("Powered by"), - Image.asset('assets/images/cs_logo_container.png', width: MediaQuery.of(context).size.width * 0.13) - ], - ), + ), + // Text("Powered by"), + Image.asset('assets/images/cs_logo_container.png', width: MediaQuery.of(context).size.width * 0.13) + ], ), ), ), - ) - ], - ), - ) - ], - ), + ), + ) + ], + ), + ) + ], ), ); } diff --git a/lib/widgets/shared/bottom_navigation_item.dart b/lib/widgets/shared/bottom_navigation_item.dart index 69a58f76..1d968ffa 100644 --- a/lib/widgets/shared/bottom_navigation_item.dart +++ b/lib/widgets/shared/bottom_navigation_item.dart @@ -32,7 +32,7 @@ class BottomNavigationItem extends StatelessWidget { Widget build(BuildContext context) { return Expanded( child: SizedBox( - height: 70.0, + height:MediaQuery.of(context).size.height *.1, child: Material( type: MaterialType.transparency, child: InkWell( @@ -57,8 +57,9 @@ class BottomNavigationItem extends StatelessWidget { SizedBox( height: 15, ), - Container( - child: SvgPicture.asset( + Stack( + children: [ + SvgPicture.asset( svgPath!, width: SizeConfig.widthMultiplier! * (10), height: SizeConfig.getHeightMultiplier( @@ -70,6 +71,29 @@ class BottomNavigationItem extends StatelessWidget { : 7)) * 40, ), + if (currentIndex == 3 && + dashboardViewModel!.notRepliedCount != 0) + Positioned( + top:1, right:1, + child: badge.Badge( + badgeAnimation: + badge.BadgeAnimation.fade(toAnimate: false), + position: BadgePosition.topEnd(), + badgeStyle: badge.BadgeStyle( + shape: BadgeShape.circle, + badgeColor: const Color(0xFF14384B), + borderRadius: BorderRadius.circular(8), + ), + badgeContent: Container( + // padding: EdgeInsets.all(2.0), + child: AppText( + dashboardViewModel!.notRepliedCount.toString(), + color: Colors.white, + fontSize: 12.0), + ), + ), + ), + ] ), SizedBox( height: 8, @@ -86,29 +110,7 @@ class BottomNavigationItem extends StatelessWidget { ), ], ), - if (currentIndex == 3 && - dashboardViewModel!.notRepliedCount != 0) - Positioned( - right: 18.0, - bottom: 40.0, - child: badge.Badge( - badgeAnimation: - badge.BadgeAnimation.fade(toAnimate: false), - position: BadgePosition.topEnd(), - badgeStyle: badge.BadgeStyle( - shape: BadgeShape.circle, - badgeColor: const Color(0xFF14384B), - borderRadius: BorderRadius.circular(8), - ), - badgeContent: Container( - // padding: EdgeInsets.all(2.0), - child: AppText( - dashboardViewModel!.notRepliedCount.toString(), - color: Colors.white, - fontSize: 12.0), - ), - ), - ), + ], ), ),