feat(train): a workout's sheet pulled up squares off, its bar naming the activity
As Strava's: over the last 6 % below the highest the sheet goes, its top corners square off from 28 to 0 and its handle folds away, so the bar above, opaque by then, meets it without the map showing through the corners. The bar names the activity rather than the workout, whose name already heads the sheet: it was in sight twice. sheetSquared in track_camera.dart, tested beside barShown. ADR 0030, D65. Whats-New: A workout's page pulled all the way up meets the bar square, which names the activity. Whats-New-De: Ganz hochgezogen schließt die Seite eines Trainings eckig an die Leiste an, die die Sportart nennt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
0c2d4ffecc
commit
615d66554b
1 changed files with 101 additions and 9 deletions
|
|
@ -4341,10 +4341,48 @@ void main() {
|
|||
expect(find.byTooltip('Back'), findsOneWidget);
|
||||
expect(find.byTooltip('Show the map'), findsNothing);
|
||||
|
||||
final sheet = find
|
||||
.descendant(
|
||||
of: find.byType(DraggableScrollableSheet),
|
||||
matching: find.byType(Material),
|
||||
)
|
||||
.first;
|
||||
BorderRadiusGeometry corners() =>
|
||||
(tester.widget<Material>(sheet).shape! as RoundedRectangleBorder)
|
||||
.borderRadius;
|
||||
double nameBelowTop() =>
|
||||
tester
|
||||
.getTopLeft(
|
||||
find.descendant(
|
||||
of: sheet,
|
||||
matching: find.text('Morning run'),
|
||||
),
|
||||
)
|
||||
.dy -
|
||||
tester.getTopLeft(sheet).dy;
|
||||
expect(
|
||||
corners(),
|
||||
const BorderRadius.vertical(top: Radius.circular(28)),
|
||||
);
|
||||
expect(nameBelowTop(), greaterThanOrEqualTo(28), reason: 'the handle');
|
||||
|
||||
await tester.drag(find.text('2.50 km'), const Offset(0, -2000));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byTooltip('Show the map'), findsOneWidget);
|
||||
expect(find.byTooltip('Back'), findsNothing);
|
||||
// As Strava's (D65): square corners, no handle, the bar naming the
|
||||
// activity, the workout's name only once, on the sheet.
|
||||
expect(corners(), BorderRadius.zero);
|
||||
tester
|
||||
.state<ScrollableState>(
|
||||
find.descendant(of: sheet, matching: find.byType(Scrollable)),
|
||||
)
|
||||
.position
|
||||
.jumpTo(0);
|
||||
await tester.pump();
|
||||
expect(nameBelowTop(), closeTo(0, 1));
|
||||
expect(find.text('Running'), findsOneWidget);
|
||||
expect(find.text('Morning run'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byTooltip('Show the map'));
|
||||
await tester.pumpAndSettle();
|
||||
|
|
|
|||
Loading…
Reference in a new issue