family file view #225

Merged
Haroon6138 merged 2 commits from dev_aamir into master 3 days ago

@ -67,6 +67,29 @@ class _FamilyCardsState extends State<FamilyCards> {
super.initState(); super.initState();
} }
double _calculateAspectRatio(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
final itemWidth = (screenWidth - 32.w - 10.w) / 2;
double itemHeight = 0;
itemHeight += 30.h; // 15.h top + 15.h bottom
itemHeight += 70.h;
itemHeight += 8.h;
itemHeight += 20.h;
if (widget.isShowDetails) {
itemHeight += 4.h;
itemHeight += 30.h;
itemHeight += 8.h;
} else {
itemHeight += 4.h;
}
itemHeight += 70.h;
final aspectRatio = itemWidth / itemHeight;
return aspectRatio;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
widget.profileViewList = []; widget.profileViewList = [];
@ -139,10 +162,8 @@ class _FamilyCardsState extends State<FamilyCards> {
SizedBox(height: 8.h), SizedBox(height: 8.h),
Wrap(alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, runAlignment: WrapAlignment.start, spacing: 0.h, children: [ Wrap(alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, runAlignment: WrapAlignment.start, spacing: 0.h, children: [
(profile.patientName ?? "").toText14(isBold: true, isCenter: false, maxlines: 1), (profile.patientName ?? "").toText14(isBold: true, isCenter: false, maxlines: 1),
(getStatusTextByRequest( (getStatusTextByRequest(FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false))
FamilyFileEnum.values.firstWhere((e) => e.toInt == profile.status), profile.isRequestFromMySide ?? false)) .toText12(isCenter: false, maxLine: 1, isBold: true, color: AppColors.greyTextColor),
.toText12(
isCenter: false, maxLine: 1, isBold: true, color: AppColors.greyTextColor),
]), ]),
SizedBox(height: 8.h), SizedBox(height: 8.h),
CustomChipWidget( CustomChipWidget(
@ -189,8 +210,8 @@ class _FamilyCardsState extends State<FamilyCards> {
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}" child:
.toText18(isBold: true, textOverflow: TextOverflow.ellipsis, maxlines: 2), "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true, textOverflow: TextOverflow.ellipsis, maxlines: 2),
), ),
SizedBox(height: 4.h), SizedBox(height: 4.h),
Wrap( Wrap(
@ -312,8 +333,7 @@ class _FamilyCardsState extends State<FamilyCards> {
crossAxisCount: 2, crossAxisCount: 2,
crossAxisSpacing: 10.w, crossAxisSpacing: 10.w,
mainAxisSpacing: 10.h, mainAxisSpacing: 10.h,
childAspectRatio: widget.isShowDetails ? 0.80.h : 0.80.h, childAspectRatio: _calculateAspectRatio(context),
// childAspectRatio: 0.7.h,
), ),
padding: EdgeInsets.only(bottom: 20.h), padding: EdgeInsets.only(bottom: 20.h),
itemBuilder: (context, index) { itemBuilder: (context, index) {

Loading…
Cancel
Save