From dc944d9d3624b26d274633f86976033055e82813 Mon Sep 17 00:00:00 2001 From: Giorgio Azzinnaro Date: Wed, 1 Jan 2025 13:53:38 +0100 Subject: [PATCH] fix: duplicated hero --- ios/Podfile.lock | 30 +++++++- lib/presentation/screens/group_details.dart | 72 ++++++++++--------- lib/presentation/widgets/groups_list.dart | 2 +- .../widgets/image_form_field.dart | 4 +- 4 files changed, 69 insertions(+), 39 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a09c039f..a11730e4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -39,9 +39,21 @@ PODS: - Flutter - integration_test (0.0.1): - Flutter + - package_info_plus (0.4.5): + - Flutter - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS + - PostHog (3.18.0) + - posthog_flutter (0.0.1): + - Flutter + - FlutterMacOS + - PostHog (~> 3.0) + - Sentry/HybridSDK (8.42.0) + - sentry_flutter (8.12.0): + - Flutter + - FlutterMacOS + - Sentry/HybridSDK (= 8.42.0) - share_plus (0.0.1): - Flutter - shared_preferences_foundation (0.0.1): @@ -63,7 +75,10 @@ DEPENDENCIES: - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - in_app_review (from `.symlinks/plugins/in_app_review/ios`) - integration_test (from `.symlinks/plugins/integration_test/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - posthog_flutter (from `.symlinks/plugins/posthog_flutter/ios`) + - sentry_flutter (from `.symlinks/plugins/sentry_flutter/ios`) - share_plus (from `.symlinks/plugins/share_plus/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - sign_in_with_apple (from `.symlinks/plugins/sign_in_with_apple/ios`) @@ -75,6 +90,8 @@ SPEC REPOS: - GoogleSignIn - GTMAppAuth - GTMSessionFetcher + - PostHog + - Sentry - TOCropViewController EXTERNAL SOURCES: @@ -96,8 +113,14 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/in_app_review/ios" integration_test: :path: ".symlinks/plugins/integration_test/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" + posthog_flutter: + :path: ".symlinks/plugins/posthog_flutter/ios" + sentry_flutter: + :path: ".symlinks/plugins/sentry_flutter/ios" share_plus: :path: ".symlinks/plugins/share_plus/ios" shared_preferences_foundation: @@ -121,13 +144,18 @@ SPEC CHECKSUMS: image_picker_ios: 7fe1ff8e34c1790d6fff70a32484959f563a928a in_app_review: 5596fe56fab799e8edb3561c03d053363ab13457 integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e + package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564 + PostHog: 6ce18b57e7de83868707dec4a0c35ebbc866e88b + posthog_flutter: 37053225347313fb5385539b300a8237fae24e34 + Sentry: 38ed8bf38eab5812787274bf591e528074c19e02 + sentry_flutter: a72ca0eb6e78335db7c4ddcddd1b9f6c8ed5b764 share_plus: 50da8cb520a8f0f65671c6c6a99b3617ed10a58a shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7 sign_in_with_apple: c5dcc141574c8c54d5ac99dd2163c0c72ad22418 TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 url_launcher_ios: 694010445543906933d732453a59da0a173ae33d -PODFILE CHECKSUM: 7be2f5f74864d463a8ad433546ed1de7e0f29aef +PODFILE CHECKSUM: a57f30d18f102dd3ce366b1d62a55ecbef2158e5 COCOAPODS: 1.16.2 diff --git a/lib/presentation/screens/group_details.dart b/lib/presentation/screens/group_details.dart index 39199612..c0d988a3 100644 --- a/lib/presentation/screens/group_details.dart +++ b/lib/presentation/screens/group_details.dart @@ -35,45 +35,47 @@ class GroupDetailsScreen extends StatelessWidget { pinned: true, expandedHeight: groupImage != null ? 256 : 0, flexibleSpace: FlexibleSpaceBar( - background: groupImage != null - ? Hero( - tag: groupImage, - child: ClipRRect( - borderRadius: BorderRadius.vertical( - bottom: Radius.circular(24)), - child: AspectRatio( - aspectRatio: 1, - child: Stack( - fit: StackFit.expand, - children: [ - Image.network(groupImage, - fit: BoxFit.cover), - DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - colorScheme.surface - .withValues(alpha: 0.1), - colorScheme.secondaryContainer - .withValues(alpha: 0.8), - ], - ), + background: groupImage != null + ? Hero( + tag: groupImage, + child: ClipRRect( + borderRadius: BorderRadius.vertical( + bottom: Radius.circular(24)), + child: AspectRatio( + aspectRatio: 1, + child: Stack( + fit: StackFit.expand, + children: [ + Image.network(groupImage, + fit: BoxFit.cover), + DecoratedBox( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + colorScheme.surface + .withValues(alpha: 0.1), + colorScheme.secondaryContainer + .withValues(alpha: 0.8), + ], ), ), - ], - ), + ), + ], ), ), - ) - : null, - collapseMode: CollapseMode.pin, - title: Hero( - tag: groupName, - child: - Text(groupName, style: textTheme.headlineMedium), - )), + ), + ) + : null, + collapseMode: CollapseMode.pin, + title: group != null + ? Hero( + tag: group!, + child: Text(groupName, + style: textTheme.headlineMedium)) + : null, + ), ), SliverToBoxAdapter( child: Column( diff --git a/lib/presentation/widgets/groups_list.dart b/lib/presentation/widgets/groups_list.dart index b38e2557..0aa68909 100644 --- a/lib/presentation/widgets/groups_list.dart +++ b/lib/presentation/widgets/groups_list.dart @@ -33,7 +33,7 @@ class GroupsList extends StatelessWidget { ), ), title: Hero( - tag: displayName, + tag: group, child: Text(displayName, style: theme.textTheme.headlineMedium)), subtitle: description != null ? Text(description, diff --git a/lib/presentation/widgets/image_form_field.dart b/lib/presentation/widgets/image_form_field.dart index d57c29e8..23d44cc1 100644 --- a/lib/presentation/widgets/image_form_field.dart +++ b/lib/presentation/widgets/image_form_field.dart @@ -89,11 +89,11 @@ class _ImageFormFieldState extends FormFieldState { final radius = widget.radius ?? 20.0; final cameraIconDistance = radius / 5; - final ImageProvider image = value != null + final ImageProvider? image = value != null ? kIsWeb ? NetworkImage(value!.path) as ImageProvider : FileImage(File(value!.path)) as ImageProvider - : widget.initialImage as ImageProvider; + : widget.initialImage; return Stack( children: [