Merge pull request 'Fixed App CustomChip' (#90) from faiz_dev into master

Reviewed-on: http://34.17.52.180/Haroon6138/HMG_Patient_App_New/pulls/90
pull/95/head
Haroon6138 4 months ago
commit 5aef8d67de

@ -637,7 +637,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 3A359E86ZF; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;

@ -294,161 +294,154 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
color: Colors.white, color: Colors.white,
borderRadius: 20.r, borderRadius: 20.r,
), ),
child: Padding( padding: EdgeInsets.all(16.w),
padding: EdgeInsets.all(16.w), child: Column(
child: Column( children: [
children: [ ListView.separated(
ListView.separated( itemCount: prescriptionVM.prescriptionDetailsList.length,
itemCount: prescriptionVM.prescriptionDetailsList.length, shrinkWrap: true,
shrinkWrap: true, padding: EdgeInsets.only(right: 8.w),
padding: const EdgeInsets.only(left: 0, right: 8), physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), itemBuilder: (context, index) {
itemBuilder: (context, index) { return AnimationConfiguration.staggeredList(
return AnimationConfiguration.staggeredList( position: index,
position: index, duration: const Duration(milliseconds: 500),
duration: const Duration(milliseconds: 500), child: SlideAnimation(
child: SlideAnimation( verticalOffset: 100.0,
verticalOffset: 100.0, child: FadeInAnimation(
child: FadeInAnimation( child: Row(
child: Row( children: [
children: [ Utils.buildSvgWithAssets(
Utils.buildSvgWithAssets( icon: AppAssets.prescription_item_icon,
icon: AppAssets.prescription_item_icon, width: 40.h,
width: 40.h, height: 40.h,
height: 40.h, ),
), SizedBox(width: 8.h),
SizedBox(width: 8.h), Row(
Row( mainAxisSize: MainAxisSize.max,
mainAxisSize: MainAxisSize.max, children: [
children: [ Column(
Column( children: [
children: [ prescriptionVM.prescriptionDetailsList[index].itemDescription!
SizedBox( .toText12(isBold: true, maxLine: 1),
width: 150.w, "Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}"
child: prescriptionVM.prescriptionDetailsList[index].itemDescription! .needTranslation
.toText12(isBold: true, maxLine: 1)), .toText10(
SizedBox( weight: FontWeight.w500,
width: 150.h, color: AppColors.greyTextColor,
child: letterSpacing: -0.4),
"Prescribed By: ${widget.patientAppointmentHistoryResponseModel.doctorTitle} ${widget.patientAppointmentHistoryResponseModel.doctorNameObj}" ],
.needTranslation ),
.toText10( SizedBox(width: 68.w),
weight: FontWeight.w500, Transform.flip(
color: AppColors.greyTextColor, flipX: appState.isArabic(),
letterSpacing: -0.4), child: Utils.buildSvgWithAssets(
), icon: AppAssets.forward_arrow_icon,
], iconColor: AppColors.blackColor,
), width: 18.w,
SizedBox(width: 68.w), height: 13.h,
Transform.flip( fit: BoxFit.contain,
flipX: appState.isArabic(),
child: Utils.buildSvgWithAssets(
icon: AppAssets.forward_arrow_icon,
iconColor: AppColors.blackColor,
width: 18.w,
height: 13.h,
fit: BoxFit.contain,
),
), ),
], ),
), ],
], ),
), ],
), ),
), ),
);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
).onPress(() {
prescriptionVM.setPrescriptionsDetailsLoading();
Navigator.of(context).push(
CustomPageRoute(
page: PrescriptionDetailPage(prescriptionsResponseModel: getPrescriptionRequestModel()),
), ),
); );
}), },
SizedBox(height: 16.h), separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
const Divider(color: AppColors.dividerColor), ).onPress(() {
SizedBox(height: 16.h), prescriptionVM.setPrescriptionsDetailsLoading();
Row( Navigator.of(context).push(
children: [ CustomPageRoute(
// Expanded( page: PrescriptionDetailPage(prescriptionsResponseModel: getPrescriptionRequestModel()),
// child: CustomButton( ),
// text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? LocaleKeys.resendOrder.tr(context: context) : LocaleKeys.prescriptionDeliveryError.tr(context: context), );
// onPressed: () {}, }),
// backgroundColor: AppColors.secondaryLightRedColor, SizedBox(height: 16.h),
// borderColor: AppColors.secondaryLightRedColor, const Divider(color: AppColors.dividerColor),
// textColor: AppColors.primaryRedColor, SizedBox(height: 16.h),
// fontSize: 14, Wrap(
// fontWeight: FontWeight.w500, runSpacing: 6.w,
// borderRadius: 12.h, children: [
// height: 40.h, // Expanded(
// icon: AppAssets.appointment_calendar_icon, // child: CustomButton(
// iconColor: AppColors.primaryRedColor, // text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? LocaleKeys.resendOrder.tr(context: context) : LocaleKeys.prescriptionDeliveryError.tr(context: context),
// iconSize: 16.h, // onPressed: () {},
// ), // backgroundColor: AppColors.secondaryLightRedColor,
// ), // borderColor: AppColors.secondaryLightRedColor,
// SizedBox(width: 16.h), // textColor: AppColors.primaryRedColor,
Expanded( // fontSize: 14,
child: CustomButton( // fontWeight: FontWeight.w500,
text: "Refill & Delivery".needTranslation, // borderRadius: 12.h,
onPressed: () { // height: 40.h,
Navigator.of(context) // icon: AppAssets.appointment_calendar_icon,
.push( // iconColor: AppColors.primaryRedColor,
CustomPageRoute( // iconSize: 16.h,
page: PrescriptionsListPage(), // ),
), // ),
) // SizedBox(width: 16.h),
.then((val) { Expanded(
prescriptionsViewModel.setPrescriptionsDetailsLoading(); child: CustomButton(
prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); text: "Refill & Delivery".needTranslation,
}); onPressed: () {
}, Navigator.of(context)
backgroundColor: AppColors.secondaryLightRedColor, .push(
borderColor: AppColors.secondaryLightRedColor, CustomPageRoute(
textColor: AppColors.primaryRedColor, page: PrescriptionsListPage(),
fontSize: 14.f, ),
fontWeight: FontWeight.w500, )
borderRadius: 12.r, .then((val) {
height: 40.h, prescriptionsViewModel.setPrescriptionsDetailsLoading();
icon: AppAssets.requests, prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
iconColor: AppColors.primaryRedColor, });
iconSize: 16.h, },
), backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14.f,
fontWeight: FontWeight.w500,
borderRadius: 12.r,
height: 40.h,
icon: AppAssets.requests,
iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
), ),
),
SizedBox(width: 16.w), SizedBox(width: 16.w),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
text: "All Prescriptions".needTranslation, text: "All Prescriptions".needTranslation,
onPressed: () { onPressed: () {
Navigator.of(context) Navigator.of(context)
.push( .push(
CustomPageRoute( CustomPageRoute(
page: PrescriptionsListPage(), page: PrescriptionsListPage(),
), ),
) )
.then((val) { .then((val) {
prescriptionsViewModel.setPrescriptionsDetailsLoading(); prescriptionsViewModel.setPrescriptionsDetailsLoading();
prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel()); prescriptionsViewModel.getPrescriptionDetails(getPrescriptionRequestModel());
}); });
}, },
backgroundColor: AppColors.secondaryLightRedColor, backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor, textColor: AppColors.primaryRedColor,
fontSize: 14.f, fontSize: 14.f,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
borderRadius: 12.r, borderRadius: 12.r,
height: 40.h, height: 40.h,
icon: AppAssets.requests, icon: AppAssets.requests,
iconColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor,
iconSize: 16.h, iconSize: 16.h,
),
), ),
], ),
), ],
], ),
), ],
), ),
); );
}), }),

@ -70,7 +70,6 @@ class AppointmentCard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: _buildChips(context, appState)), Expanded(child: _buildChips(context, appState)),
// Placeholder for future toggle / switch
], ],
); );
} }
@ -81,7 +80,7 @@ class AppointmentCard extends StatelessWidget {
return Wrap( return Wrap(
alignment: WrapAlignment.start, alignment: WrapAlignment.start,
direction: Axis.horizontal, direction: Axis.horizontal,
spacing: 6.h, spacing: 6.w,
runSpacing: 6.h, runSpacing: 6.h,
children: [ children: [
AppCustomChipWidget( AppCustomChipWidget(

@ -35,7 +35,6 @@ class _LandingNavigationState extends State<LandingNavigation> {
], ],
), ),
bottomNavigationBar: BottomNavigation( bottomNavigationBar: BottomNavigation(
context: context,
currentIndex: _currentIndex, currentIndex: _currentIndex,
onTap: (index) { onTap: (index) {
setState(() => _currentIndex = index); setState(() => _currentIndex = index);

@ -346,7 +346,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) { Consumer<MyAppointmentsViewModel>(builder: (context, myAppointmentsVM, child) {
// Provide an explicit height so the horizontal ListView has a bounded height // Provide an explicit height so the horizontal ListView has a bounded height
return SizedBox( return SizedBox(
height: 140.h, height: 190.h,
child: myAppointmentsVM.isMyAppointmentsLoading child: myAppointmentsVM.isMyAppointmentsLoading
? MedicalFileAppointmentCard( ? MedicalFileAppointmentCard(
patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel(), patientAppointmentHistoryResponseModel: PatientAppointmentHistoryResponseModel(),
@ -731,7 +731,7 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
}, },
separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 8.h), separatorBuilder: (BuildContext cxt, int index) => SizedBox(width: 8.h),
), ),
); ).paddingSymmetrical(24.w, 0);
}), }),
SizedBox(height: 24.h), SizedBox(height: 24.h),
"Others".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0.h), "Others".needTranslation.toText18(isBold: true).paddingSymmetrical(24.w, 0.h),

@ -54,7 +54,10 @@ class _FamilyCardsState extends State<FamilyCards> {
children: [ children: [
Utils.buildSvgWithAssets(icon: AppAssets.alertSquare), Utils.buildSvgWithAssets(icon: AppAssets.alertSquare),
SizedBox(width: 8.h), SizedBox(width: 8.h),
"Who can view my medical file ?".needTranslation.toText14(color: AppColors.textColor, isUnderLine: true, weight: FontWeight.w500).onPress(() { "Who can view my medical file ?"
.needTranslation
.toText14(color: AppColors.textColor, isUnderLine: true, weight: FontWeight.w500)
.onPress(() {
dialogService.showFamilyBottomSheetWithoutHWithChild( dialogService.showFamilyBottomSheetWithoutHWithChild(
label: "Manage Family".needTranslation, label: "Manage Family".needTranslation,
message: "", message: "",
@ -110,11 +113,18 @@ class _FamilyCardsState extends State<FamilyCards> {
? AppColors.textGreenColor ? AppColors.textGreenColor
: AppColors.alertColor), : AppColors.alertColor),
SizedBox(height: 8.h), SizedBox(height: 8.h),
Wrap(alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, runAlignment: WrapAlignment.start, spacing: 0.h, children: [ Wrap(
(profile.patientName ?? "").toText14(isBold: false, isCenter: false, maxlines: 1, weight: FontWeight.w600), alignment: WrapAlignment.start,
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false)) crossAxisAlignment: WrapCrossAlignment.start,
.toText12(isBold: false, isCenter: false, maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor), runAlignment: WrapAlignment.start,
]), spacing: 0.h,
children: [
(profile.patientName ?? "").toText14(isBold: false, isCenter: false, maxlines: 1, weight: FontWeight.w600),
(getStatusTextByRequest(
FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
.toText12(
isBold: false, isCenter: false, maxLine: 1, fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
]),
SizedBox(height: 8.h), SizedBox(height: 8.h),
CustomChipWidget( CustomChipWidget(
height: 30.h, height: 30.h,
@ -141,7 +151,7 @@ class _FamilyCardsState extends State<FamilyCards> {
itemCount: widget.profiles.length, itemCount: widget.profiles.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 10.h, crossAxisSpacing: 10.w,
mainAxisSpacing: 10.h, mainAxisSpacing: 10.h,
childAspectRatio: widget.isShowDetails ? 0.56.h : 0.65.h, childAspectRatio: widget.isShowDetails ? 0.56.h : 0.65.h,
), ),
@ -162,13 +172,14 @@ class _FamilyCardsState extends State<FamilyCards> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Utils.buildImgWithAssets( Utils.buildImgWithAssets(
icon: profile.gender == null icon: profile.gender == null
? AppAssets.dummy_user ? AppAssets.dummy_user
: profile.gender == 1 : profile.gender == 1
? ((profile.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.male_img) ? ((profile.age ?? 0) < 7 ? AppAssets.babyBoyImg : AppAssets.male_img)
: (profile.age! < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg), : (profile.age! < 7 ? AppAssets.babyGirlImg : AppAssets.femaleImg),
width: 80.h, width: 80.h,
height: 78.h), height: 78.h,
),
SizedBox(height: 8.h), SizedBox(height: 8.h),
(profile.patientName ?? "Unknown").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600), (profile.patientName ?? "Unknown").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
SizedBox(height: 8.h), SizedBox(height: 8.h),
@ -282,7 +293,9 @@ class _FamilyCardsState extends State<FamilyCards> {
alignment: WrapAlignment.start, alignment: WrapAlignment.start,
children: [ children: [
(profile.patientName ?? "").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600), (profile.patientName ?? "").toText14(isBold: false, isCenter: true, maxlines: 1, weight: FontWeight.w600),
(getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false)).toText14( (getStatusTextByRequest(
FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
.toText14(
isBold: false, isBold: false,
isCenter: true, isCenter: true,
maxlines: 1, maxlines: 1,

@ -12,9 +12,8 @@ import 'package:hmg_patient_app_new/theme/colors.dart';
class BottomNavigation extends StatelessWidget { class BottomNavigation extends StatelessWidget {
final int currentIndex; final int currentIndex;
final ValueChanged<int> onTap; final ValueChanged<int> onTap;
BuildContext? context;
BottomNavigation({super.key, required this.currentIndex, required this.onTap, this.context}); const BottomNavigation({super.key, required this.currentIndex, required this.onTap});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -30,7 +29,9 @@ class BottomNavigation extends StatelessWidget {
iconSize: 27, iconSize: 27,
isSpecial: true, isSpecial: true,
), ),
appState.isAuthenticated ? BottomNavItem(icon: AppAssets.toDoBottom, label: LocaleKeys.todoList.tr(context: context)) : BottomNavItem(icon: AppAssets.news, label: LocaleKeys.news.tr()), appState.isAuthenticated
? BottomNavItem(icon: AppAssets.toDoBottom, label: LocaleKeys.todoList.tr(context: context))
: BottomNavItem(icon: AppAssets.news, label: LocaleKeys.news.tr()),
BottomNavItem(icon: AppAssets.servicesBottom, label: LocaleKeys.services2.tr(context: context)), BottomNavItem(icon: AppAssets.servicesBottom, label: LocaleKeys.services2.tr(context: context)),
]; ];
@ -65,11 +66,7 @@ class BottomNavigation extends StatelessWidget {
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
item.label.toText12( item.label.toText12(fontWeight: FontWeight.w500),
fontWeight: FontWeight.w500,
// color: Colors.black87,
// textAlign: TextAlign.center,
),
SizedBox(height: item.isSpecial ? 5 : 0) SizedBox(height: item.isSpecial ? 5 : 0)
], ],
), ),
@ -82,12 +79,14 @@ class BottomNavItem {
final String label; final String label;
final double iconSize; final double iconSize;
final bool isSpecial; final bool isSpecial;
final Color? color;
const BottomNavItem({ const BottomNavItem({
required this.icon, required this.icon,
required this.label, required this.label,
this.iconSize = 21, this.iconSize = 21,
this.isSpecial = false, this.isSpecial = false,
this.color,
}); });
} }

@ -63,13 +63,22 @@ class AppCustomChipWidget extends StatelessWidget {
child: icon.isNotEmpty child: icon.isNotEmpty
? Chip( ? Chip(
avatar: icon.isNotEmpty avatar: icon.isNotEmpty
? Utils.buildSvgWithAssets( ? Padding(
icon: icon, width: iconS, height: iconS, iconColor: iconHasColor ? iconColor : null, fit: BoxFit.contain) padding: EdgeInsets.only(left: 8.w, right: 6.w),
child: Utils.buildSvgWithAssets(
icon: icon,
width: iconS,
height: iconS,
iconColor: iconHasColor ? iconColor : null,
fit: BoxFit.contain,
),
)
: SizedBox.shrink(), : SizedBox.shrink(),
avatarBoxConstraints: BoxConstraints(),
label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor), label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor),
padding: padding, padding: EdgeInsets.zero,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: labelPadding ?? EdgeInsetsDirectional.only(start: 2.w, end: deleteIcon?.isNotEmpty == true ? 2.w : 8.w), labelPadding: EdgeInsetsDirectional.only(end: 8.w),
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
shape: shape ?? shape: shape ??
SmoothRectangleBorder( SmoothRectangleBorder(
@ -98,7 +107,7 @@ class AppCustomChipWidget extends StatelessWidget {
smoothness: 10, smoothness: 10,
side: BorderSide(color: AppColors.transparent, width: 1.5), side: BorderSide(color: AppColors.transparent, width: 1.5),
), ),
labelPadding: labelPadding ?? EdgeInsetsDirectional.only(start: 2.w, end: deleteIcon?.isNotEmpty == true ? 2.w : 8.w), labelPadding: EdgeInsetsDirectional.only(start: 8.w, end: 8.w),
deleteIcon: deleteIcon?.isNotEmpty == true deleteIcon: deleteIcon?.isNotEmpty == true
? Utils.buildSvgWithAssets(icon: deleteIcon!, width: iconS, height: iconS, iconColor: deleteIconHasColor ? deleteIconColor : null) ? Utils.buildSvgWithAssets(icon: deleteIcon!, width: iconS, height: iconS, iconColor: deleteIconHasColor ? deleteIconColor : null)
: null, : null,

@ -62,7 +62,7 @@ class CustomTabBarState extends State<CustomTabBar> {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),
itemBuilder: (cxt, index) => myTab(widget.tabs[index], index).expanded, itemBuilder: (cxt, index) => myTab(widget.tabs[index], index),
separatorBuilder: (cxt, index) => 4.width, separatorBuilder: (cxt, index) => 4.width,
itemCount: widget.tabs.length, itemCount: widget.tabs.length,
); );
@ -80,6 +80,7 @@ class CustomTabBarState extends State<CustomTabBar> {
color: AppColors.whiteColor, color: AppColors.whiteColor,
borderRadius: 12.r, borderRadius: 12.r,
), ),
height: 62.h,
child: Center(child: parentWidget)); child: Center(child: parentWidget));
} }

Loading…
Cancel
Save