A better state and alerts

This commit is contained in:
2026-02-23 20:19:07 +08:00
parent 0b900d3480
commit 1074572905
17 changed files with 673 additions and 428 deletions
+44
View File
@@ -103,6 +103,50 @@ void main() {
},
);
// new regression tests for desktop layout adjustments
testWidgets(
'Desktop adaptive list responsive width and horizontal scrollbar',
(tester) async {
final theme = AppTheme.light();
Future<double> contentWidthFor(double screenWidth) async {
await tester.pumpWidget(
MaterialApp(
theme: theme,
home: MediaQuery(
data: MediaQueryData(size: Size(screenWidth, 800)),
child: Scaffold(
body: TasQAdaptiveList<int>(
items: List.generate(100, (i) => i),
columns: List.generate(
20,
(i) => TasQColumn<int>(
header: 'C$i',
cellBuilder: (c, t) => Text('$t'),
),
),
mobileTileBuilder: (c, t, a) => const SizedBox.shrink(),
rowActions: (_) => [],
),
),
),
),
);
await tester.pumpAndSettle();
final box = tester.widget<SizedBox>(
find.byKey(const Key('adaptive_list_content')),
);
return box.width!;
}
final narrow = await contentWidthFor(1000);
final wide = await contentWidthFor(2000);
expect(find.byType(Scrollbar), findsWidgets);
expect(narrow / 1000, greaterThan(wide / 2000));
},
);
testWidgets('AppSurfaces tokens are present and dialog/card radii differ', (
WidgetTester tester,
) async {