fix(mobile): inherit toolbar opacity (#25694)

Some widgets, like Icon widgets, automatically inherit opacity from the
icon theme in the context. Many other widgets however, do not. The
Immich logo, profile picture, and backup badge are examples of widgets
of this.

All unsupported toolbar widgets have been updated to support inheriting
the opacity from the icon theme.

IconButtons internally animate properties like opacity, which is kind of
nice, but means we have to do more work to replicate that behaviour for
other widgets. In most cases, we can simply use an IconButton widget and
forward the correct opacity. The Immich logo however is not a button,
and therefore we need to use a custom TweenAnimationBuilder.

All widgets are using efficient, native opacity rather than the heavy
Opacity widget.
This commit is contained in:
Thomas
2026-02-16 04:24:57 +00:00
committed by GitHub
parent c9dd8e0a79
commit d2682f160e
13 changed files with 125 additions and 123 deletions

View File

@@ -63,7 +63,7 @@ class ActivityTextField extends HookConsumerWidget {
prefixIcon: user != null
? Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: UserCircleAvatar(user: user, size: 30, radius: 15),
child: UserCircleAvatar(user: user, size: 30),
)
: null,
suffixIcon: Padding(

View File

@@ -40,7 +40,7 @@ class ActivityTile extends HookConsumerWidget {
child: Icon(Icons.thumb_up, color: context.primaryColor),
)
: isBottomSheet
? UserCircleAvatar(user: activity.user, size: 30, radius: 15)
? UserCircleAvatar(user: activity.user, size: 30)
: UserCircleAvatar(user: activity.user),
title: _ActivityTitle(
userName: activity.user.name,

View File

@@ -41,7 +41,7 @@ class CommentBubble extends ConsumerWidget {
// avatar (hidden for own messages)
Widget avatar = const SizedBox.shrink();
if (!isOwn) {
avatar = UserCircleAvatar(user: activity.user, size: 28, radius: 14);
avatar = UserCircleAvatar(user: activity.user, size: 28);
}
// Thumbnail with tappable behavior and optional heart overlay