Chat perf: path-free running border, keystroke- and delta-quiet composer, spinners that do not relayout their list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'composer_running_arc.dart';
|
||||
import 'composer_running_outline.dart';
|
||||
|
||||
/// The composer's "agent is working" edge: one short highlight in [primary]
|
||||
/// and [tertiary] that travels around the pill's rounded border at constant
|
||||
@@ -117,14 +118,33 @@ class _RunningBorderPainter extends CustomPainter {
|
||||
final progress = lap?.value;
|
||||
// Reduced motion: no highlight; the normal static border shows alone.
|
||||
if (progress == null || size.isEmpty) return;
|
||||
final outline = shape.getOuterPath((Offset.zero & size).deflate(width / 2));
|
||||
final bounds = (Offset.zero & size).deflate(width / 2);
|
||||
final line = Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = width;
|
||||
// The highlight is laid along the outline by arc length, so its speed is
|
||||
// even around corners and straight edges alike. Only its pieces are drawn.
|
||||
// The pill's rounded rectangle draws them as lines and arcs; any other
|
||||
// shape cuts them out of its measured path.
|
||||
final rrect = RunningRRectOutline.of(shape, bounds);
|
||||
if (rrect != null) {
|
||||
for (final segment in runningHighlightSegments(
|
||||
progress: progress,
|
||||
length: rrect.length,
|
||||
primary: primary,
|
||||
tertiary: tertiary,
|
||||
)) {
|
||||
rrect.draw(
|
||||
canvas,
|
||||
segment.start,
|
||||
segment.end,
|
||||
line..color = segment.color,
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
for (final stroke in runningHighlightStrokes(
|
||||
outline: outline,
|
||||
outline: shape.getOuterPath(bounds),
|
||||
progress: progress,
|
||||
primary: primary,
|
||||
tertiary: tertiary,
|
||||
|
||||
Reference in New Issue
Block a user