Skip to content

Commit

Permalink
fix: duplicated hero
Browse files Browse the repository at this point in the history
  • Loading branch information
borgoat committed Jan 1, 2025
1 parent 5007aca commit dc944d9
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 39 deletions.
30 changes: 29 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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`)
Expand All @@ -75,6 +90,8 @@ SPEC REPOS:
- GoogleSignIn
- GTMAppAuth
- GTMSessionFetcher
- PostHog
- Sentry
- TOCropViewController

EXTERNAL SOURCES:
Expand All @@ -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:
Expand All @@ -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
72 changes: 37 additions & 35 deletions lib/presentation/screens/group_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/widgets/groups_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/widgets/image_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ class _ImageFormFieldState extends FormFieldState<XFile> {
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: [
Expand Down

0 comments on commit dc944d9

Please sign in to comment.