Grow the tapped chat row into the chat page on phones

Replace the identity-avatar Hero with a container transform: the row's
surface, tint and edge marker morph into the full page while the content
cross-fades, and Back, the Cupertino edge swipe or Android predictive back
shrink the page into the open chat's row. Reduced motion or a row off
screen fades instead; wide layouts are unchanged.
This commit is contained in:
2026-11-10 03:11:05 +00:00
parent 60b4c495f1
commit eea1361980
16 changed files with 1392 additions and 124 deletions
@@ -34,7 +34,6 @@ class ChatThreadHeader extends StatelessWidget {
this.moreActions = const [],
this.chatColor,
this.identity,
this.identityHeroTag,
});
final String title;
@@ -55,9 +54,8 @@ class ChatThreadHeader extends StatelessWidget {
/// The chat's colour name, or null for none.
final String? chatColor;
/// The chat identity carried from the mobile session row into this header.
/// The chat's identity avatar, shown in the title on a phone.
final Widget? identity;
final String? identityHeroTag;
@override
Widget build(BuildContext context) {
@@ -68,12 +66,6 @@ class ChatThreadHeader extends StatelessWidget {
builder: (context, constraints) {
final textScale = MediaQuery.textScalerOf(context).scale(14) / 14;
final compact = constraints.maxWidth / textScale < 800;
final heroIdentity =
identity == null ||
identityHeroTag == null ||
(MediaQuery.maybeDisableAnimationsOf(context) ?? false)
? identity
: Hero(tag: identityHeroTag!, child: identity!);
final Widget bar = SegmentedBar(
cupertino: cupertino,
pillColor: tint?.fill,
@@ -89,7 +81,7 @@ class ChatThreadHeader extends StatelessWidget {
)
: null,
title: title.isEmpty ? 'Chat' : title,
titleLeading: heroIdentity,
titleLeading: identity,
subtitle: ServerContext.metadata(context, folder),
subtitleIcon: cupertino
? CupertinoIcons.folder