From 5ccd710994b8bf373c32ca729068968cdadf052d Mon Sep 17 00:00:00 2001 From: sidhdhi canopas <122426509+cp-sidhdhi-p@users.noreply.github.com> Date: Thu, 5 Sep 2024 15:58:59 +0530 Subject: [PATCH] Show sheet for active account (#90) * show sheet for active account * minor change * rebase --- khelo/ios/Runner.xcodeproj/project.pbxproj | 4 ++-- .../components/commentary_over_overview.dart | 8 +++---- .../match_detail_scorecard_view.dart | 23 +++++++++++-------- .../components/match_detail_squad_view.dart | 1 + khelo/macos/Runner.xcodeproj/project.pbxproj | 4 ++-- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/khelo/ios/Runner.xcodeproj/project.pbxproj b/khelo/ios/Runner.xcodeproj/project.pbxproj index 0dc95a5c..97145887 100644 --- a/khelo/ios/Runner.xcodeproj/project.pbxproj +++ b/khelo/ios/Runner.xcodeproj/project.pbxproj @@ -205,7 +205,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 2B44862DDC4A812BCE1A0BD0 /* [CP] Embed Pods Frameworks */, - F404805D228DFD33C4CD9CA3 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, + B701D8A68AF0CB72EE4EF76E /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, ); buildRules = ( ); @@ -370,7 +370,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; - F404805D228DFD33C4CD9CA3 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = { + B701D8A68AF0CB72EE4EF76E /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( diff --git a/khelo/lib/ui/flow/matches/match_detail/components/commentary_over_overview.dart b/khelo/lib/ui/flow/matches/match_detail/components/commentary_over_overview.dart index 67386b2d..d31b444a 100644 --- a/khelo/lib/ui/flow/matches/match_detail/components/commentary_over_overview.dart +++ b/khelo/lib/ui/flow/matches/match_detail/components/commentary_over_overview.dart @@ -126,6 +126,7 @@ class CommentaryOverOverview extends StatelessWidget { children: [ Flexible( child: OnTapScale( + enabled: batsmanSummary.player.isActive, onTap: () => AppRoute.userDetail(userId: batsmanSummary.player.id) .push(context), child: Text( @@ -170,10 +171,9 @@ class BowlerSummaryView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ OnTapScale( - onTap: isForBowlerIntro - ? null - : () => AppRoute.userDetail(userId: bowlerSummary.player.id) - .push(context), + enabled: bowlerSummary.player.isActive && !isForBowlerIntro, + onTap: () => AppRoute.userDetail(userId: bowlerSummary.player.id) + .push(context), child: Padding( padding: EdgeInsets.symmetric(horizontal: isForBowlerIntro ? 16 : 0), diff --git a/khelo/lib/ui/flow/matches/match_detail/components/match_detail_scorecard_view.dart b/khelo/lib/ui/flow/matches/match_detail/components/match_detail_scorecard_view.dart index a9a5fbaf..5852ef4d 100644 --- a/khelo/lib/ui/flow/matches/match_detail/components/match_detail_scorecard_view.dart +++ b/khelo/lib/ui/flow/matches/match_detail/components/match_detail_scorecard_view.dart @@ -269,7 +269,8 @@ class MatchDetailScorecardView extends ConsumerWidget { if (header != null) ...[ Expanded( flex: (data.length + 1) ~/ 1.5, - child: OnTapScale(onTap: onTap, child: header)), + child: OnTapScale( + enabled: onTap != null, onTap: onTap, child: header)), ], for (int i = 0; i < data.length; i++) ...[ Expanded( @@ -321,8 +322,9 @@ class MatchDetailScorecardView extends ConsumerWidget { player.sixes.toString(), player.strikeRate.toString(), ], - onTap: () => - AppRoute.userDetail(userId: player.player.id).push(context), + onTap: player.player.isActive + ? () => AppRoute.userDetail(userId: player.player.id).push(context) + : null, header: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, @@ -374,8 +376,9 @@ class MatchDetailScorecardView extends ConsumerWidget { bowler.wideBalls.toString(), bowler.economy.toString(), ], - onTap: () => - AppRoute.userDetail(userId: bowler.player.id).push(context), + onTap: bowler.player.isActive + ? () => AppRoute.userDetail(userId: bowler.player.id).push(context) + : null, header: Text( bowler.player.name ?? '', style: AppTextStyle.subtitle2 @@ -476,8 +479,9 @@ class MatchDetailScorecardView extends ConsumerWidget { if (!isLastName) name += ", "; return WidgetSpan( child: OnTapScale( - onTap: () => - AppRoute.userDetail(userId: player.player.id).push(context), + onTap: player.player.isActive + ? () => AppRoute.userDetail(userId: player.player.id).push(context) + : null, child: Text(name, style: AppTextStyle.caption .copyWith(color: context.colorScheme.textPrimary)), @@ -533,8 +537,9 @@ class MatchDetailScorecardView extends ConsumerWidget { children.add(TextSpan(text: "${batsmen.runs} (")); children.add(WidgetSpan( child: OnTapScale( - onTap: () => - AppRoute.userDetail(userId: batsmen.player.id).push(context), + onTap: batsmen.player.isActive + ? () => AppRoute.userDetail(userId: batsmen.player.id).push(context) + : null, child: Text(batsmen.player.name ?? '', style: AppTextStyle.caption .copyWith(color: context.colorScheme.secondary))))); diff --git a/khelo/lib/ui/flow/matches/match_detail/components/match_detail_squad_view.dart b/khelo/lib/ui/flow/matches/match_detail/components/match_detail_squad_view.dart index 59cb0359..acd50347 100644 --- a/khelo/lib/ui/flow/matches/match_detail/components/match_detail_squad_view.dart +++ b/khelo/lib/ui/flow/matches/match_detail/components/match_detail_squad_view.dart @@ -215,6 +215,7 @@ class MatchDetailSquadView extends ConsumerWidget { bool isCaptain = user.id == captainId; return Expanded( child: OnTapScale( + enabled: user.isActive, onTap: () => AppRoute.userDetail(userId: user.id).push(context), child: Padding( padding: const EdgeInsets.all(16), diff --git a/khelo/macos/Runner.xcodeproj/project.pbxproj b/khelo/macos/Runner.xcodeproj/project.pbxproj index 138f4aa2..58efa78c 100644 --- a/khelo/macos/Runner.xcodeproj/project.pbxproj +++ b/khelo/macos/Runner.xcodeproj/project.pbxproj @@ -212,7 +212,7 @@ 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - BDC9585A92128DC0816DD358 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, + A3748A825E9FD233B3FCA1ED /* FlutterFire: "flutterfire upload-crashlytics-symbols" */, ); buildRules = ( ); @@ -333,7 +333,7 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - BDC9585A92128DC0816DD358 /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = { + A3748A825E9FD233B3FCA1ED /* FlutterFire: "flutterfire upload-crashlytics-symbols" */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = (