mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-05 18:48:38 +02:00
fix(ui): refine track action spacing
This commit is contained in:
@@ -431,6 +431,31 @@ void main() {
|
||||
expect(card.color, Colors.transparent);
|
||||
});
|
||||
|
||||
testWidgets('flat style keeps trailing actions near the card edge', (
|
||||
tester,
|
||||
) async {
|
||||
const trailingKey = Key('flat-trailing');
|
||||
await tester.pumpWidget(
|
||||
host(
|
||||
const SizedBox(
|
||||
width: 320,
|
||||
child: TrackCard(
|
||||
leading: SizedBox(width: 24),
|
||||
title: 'Song',
|
||||
style: TrackCardStyle.flat,
|
||||
trailing: SizedBox(key: trailingKey, width: 48, height: 48),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final cardRect = tester.getRect(find.byType(Card));
|
||||
final trailingRect = tester.getRect(find.byKey(trailingKey));
|
||||
// Card's render box includes its 8dp flat-row margin; content itself is
|
||||
// inset another 6dp from the painted card edge.
|
||||
expect(cardRect.right - trailingRect.right, 14);
|
||||
});
|
||||
|
||||
testWidgets('grid variant is a real button with a semantic label', (
|
||||
tester,
|
||||
) async {
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:spotiflac_android/l10n/l10n.dart';
|
||||
import 'package:spotiflac_android/models/track.dart';
|
||||
import 'package:spotiflac_android/providers/music_player_provider.dart';
|
||||
import 'package:spotiflac_android/widgets/preview_button.dart';
|
||||
import 'package:spotiflac_android/widgets/track_collection_quick_actions.dart';
|
||||
|
||||
void main() {
|
||||
const track = Track(
|
||||
@@ -66,4 +67,21 @@ void main() {
|
||||
);
|
||||
expectCenteredHitbox(tester, Icons.play_circle_fill_rounded);
|
||||
});
|
||||
|
||||
testWidgets('overflow menu icon is centered in its adjacent hitbox', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
const ProviderScope(
|
||||
child: MaterialApp(
|
||||
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
home: Scaffold(body: TrackCollectionQuickActions(track: track)),
|
||||
),
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
|
||||
expectCenteredHitbox(tester, Icons.more_vert);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user