Chat stack: the default, also on a wide phone or tablet; a close button where the pile was
Chat stack is now the default phone chat navigation (a stored choice is kept), and on Android or iOS it stays on a wide layout (an unfolded foldable) above the active pane, where floating is ignored too. When expanded, the pile turns into a close button at its own spot and the column rises above it; while a chat is dragged that button is the remove target, replacing the separate x at the bottom. Chat widget tests start on Quick switch (they run as Android); the stack's tests choose it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,9 +20,10 @@ const Curve chatStackRise = Cubic(.22, 1.18, .36, 1);
|
||||
const Curve chatStackFold = Curves.easeInCubic;
|
||||
|
||||
/// Every animation the open column reads, derived once from one controller
|
||||
/// when the items change (never per frame). Item 0 is nearest the thumb; the
|
||||
/// column rises from there, each item starting a little after the one below
|
||||
/// it, and folds back top first.
|
||||
/// when the items change (never per frame). Item 0 is nearest the thumb, a
|
||||
/// pitch above the stack's slot (where the close button is); the column
|
||||
/// rises from there, each item starting a little after the one below it,
|
||||
/// and folds back top first.
|
||||
class ChatStackMotion {
|
||||
ChatStackMotion({
|
||||
required Animation<double> parent,
|
||||
@@ -31,13 +32,16 @@ class ChatStackMotion {
|
||||
required bool rtl,
|
||||
}) : count = depths.length {
|
||||
scrim = _curve(parent, const Interval(0, .7, curve: Curves.easeOut));
|
||||
close = reduced ? parent : _curve(parent, const Interval(0, .6));
|
||||
final span = count <= 1 ? 1.0 : .62;
|
||||
final step = count <= 1 ? 0.0 : (1 - span) / (count - 1);
|
||||
for (var i = 0; i < count; i++) {
|
||||
final start = i * step;
|
||||
final end = math.min(1.0, start + span);
|
||||
final depth = depths[i];
|
||||
final to = chatStackColumnPose(i, kChatStackPitch);
|
||||
// The stack's own slot holds the close button; the column starts a
|
||||
// pitch above it.
|
||||
final to = chatStackColumnPose(i + 1, kChatStackPitch);
|
||||
final layer = chatStackLayers[depth ?? chatStackLayers.length - 1];
|
||||
target.add(to);
|
||||
if (reduced) {
|
||||
@@ -75,6 +79,9 @@ class ChatStackMotion {
|
||||
final int count;
|
||||
final bool reduced;
|
||||
late final Animation<double> scrim;
|
||||
|
||||
/// The close button taking the pile's place.
|
||||
late final Animation<double> close;
|
||||
final List<ChatStackPose> from = [];
|
||||
final List<ChatStackPose> target = [];
|
||||
final List<Animation<double>> move = [];
|
||||
|
||||
Reference in New Issue
Block a user