From 0198b60c241709267e8ac6a67ab8e1d03c745378 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 25 Oct 2026 17:35:56 +0200 Subject: [PATCH] After refonte for the options of Profile2 --- .../widgets/referral_network_tree.dart | 214 +++++++++--------- 1 file changed, 110 insertions(+), 104 deletions(-) diff --git a/prediqo_mobile/lib/features/referral/presentation/widgets/referral_network_tree.dart b/prediqo_mobile/lib/features/referral/presentation/widgets/referral_network_tree.dart index 7506661a..03e32a1f 100644 --- a/prediqo_mobile/lib/features/referral/presentation/widgets/referral_network_tree.dart +++ b/prediqo_mobile/lib/features/referral/presentation/widgets/referral_network_tree.dart @@ -159,6 +159,8 @@ class ReferralNetworkTreeState extends State showModalBottomSheet( context: context, + useRootNavigator: true, + isScrollControlled: true, showDragHandle: true, backgroundColor: Theme.of(context).colorScheme.surface, builder: (ctx) { @@ -178,119 +180,123 @@ class ReferralNetworkTreeState extends State }(); return SafeArea( child: Padding( - padding: const EdgeInsets.fromLTRB(20, 8, 20, 24), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text( - s.memberDetails, - style: Theme.of(ctx).textTheme.titleMedium?.copyWith( - fontWeight: FontWeight.w800, - ), - ), - const SizedBox(height: 16), - Row( - children: [ - CircleAvatar( - radius: 28, - backgroundColor: AppColors.primary.withValues(alpha: 0.18), - child: Text( - initials.characters.first.toUpperCase(), - style: const TextStyle( - fontWeight: FontWeight.w900, - fontSize: 22, - color: AppColors.primary, + padding: const EdgeInsets.fromLTRB(20, 8, 20, 16), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + s.memberDetails, + style: Theme.of(ctx).textTheme.titleMedium?.copyWith( + fontWeight: FontWeight.w800, ), - ), - ), - const SizedBox(width: 14), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - name, - style: const TextStyle( - fontWeight: FontWeight.w900, - fontSize: 18, - ), + ), + const SizedBox(height: 16), + Row( + children: [ + CircleAvatar( + radius: 28, + backgroundColor: + AppColors.primary.withValues(alpha: 0.18), + child: Text( + initials.characters.first.toUpperCase(), + style: const TextStyle( + fontWeight: FontWeight.w900, + fontSize: 22, + color: AppColors.primary, ), - if (!isRoot && member != null) ...[ - const SizedBox(height: 4), - Text( - [ - s.referralLevelLabel(member.levelNumber), - referralStatusLabel(member.status, s), - ].join(' · '), - style: TextStyle(color: muted, fontSize: 13), - ), - ], - ], - ), - ), - ], - ), - const SizedBox(height: 16), - if (!isRoot && member != null) ...[ - _SheetRow( - label: s.sponsorLabel, - value: parentName ?? '—', - ), - _SheetRow( - label: s.email, - value: (member.email?.trim().isNotEmpty ?? false) - ? member.email!.trim() - : '—', - ), - _SheetRow( - label: s.memberCountry, - value: countryLabel, - ), - _SheetRow( - label: s.memberReferralCode, - value: (member.referralCode?.trim().isNotEmpty ?? false) - ? member.referralCode!.trim() - : '—', - ), - _SheetRow( - label: s.directReferrals, - value: '${member.directReferralsCount}', - ), - _SheetRow( - label: s.memberSince, - value: formatReferralDate(member.registeredAt), - ), - if (member.generatesCommissions) - Padding( - padding: const EdgeInsets.symmetric(vertical: 6), - child: Text( - s.generatesCommissions, - style: const TextStyle( - fontWeight: FontWeight.w700, - color: AppColors.accentGold, ), ), + const SizedBox(width: 14), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name, + style: const TextStyle( + fontWeight: FontWeight.w900, + fontSize: 18, + ), + ), + if (!isRoot && member != null) ...[ + const SizedBox(height: 4), + Text( + [ + s.referralLevelLabel(member.levelNumber), + referralStatusLabel(member.status, s), + ].join(' · '), + style: TextStyle(color: muted, fontSize: 13), + ), + ], + ], + ), + ), + ], + ), + const SizedBox(height: 16), + if (!isRoot && member != null) ...[ + _SheetRow( + label: s.sponsorLabel, + value: parentName ?? '—', ), - if (_hasPartialChildren(member.userId)) ...[ - const SizedBox(height: 8), - Text( - s.networkPartialData, - style: TextStyle(color: muted, fontSize: 12), + _SheetRow( + label: s.email, + value: (member.email?.trim().isNotEmpty ?? false) + ? member.email!.trim() + : '—', + ), + _SheetRow( + label: s.memberCountry, + value: countryLabel, + ), + _SheetRow( + label: s.memberReferralCode, + value: (member.referralCode?.trim().isNotEmpty ?? false) + ? member.referralCode!.trim() + : '—', + ), + _SheetRow( + label: s.directReferrals, + value: '${member.directReferralsCount}', + ), + _SheetRow( + label: s.memberSince, + value: formatReferralDate(member.registeredAt), + ), + if (member.generatesCommissions) + Padding( + padding: const EdgeInsets.symmetric(vertical: 6), + child: Text( + s.generatesCommissions, + style: const TextStyle( + fontWeight: FontWeight.w700, + color: AppColors.accentGold, + ), + ), + ), + if (_hasPartialChildren(member.userId)) ...[ + const SizedBox(height: 8), + Text( + s.networkPartialData, + style: TextStyle(color: muted, fontSize: 12), + ), + ], + ] else ...[ + _SheetRow( + label: s.directReferrals, + value: + '${(_childMap[widget.rootUserId] ?? const []).length}', ), ], - ] else ...[ - _SheetRow( - label: s.directReferrals, - value: '${(_childMap[widget.rootUserId] ?? const []).length}', + const SizedBox(height: 16), + FilledButton( + onPressed: () => Navigator.of(ctx, rootNavigator: true).pop(), + child: Text(s.closeSheet), ), ], - const SizedBox(height: 16), - FilledButton( - onPressed: () => Navigator.of(ctx).pop(), - child: Text(s.closeSheet), - ), - ], + ), ), ), );