mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-08 09:30:27 +00:00
fix(ui): refine create task actions and relocate icon sources (#1500)
This commit is contained in:
64 files changed
+193
-139
No files matched your search
@@ -2669,9 +2669,9 @@ void main() {
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: ResolveFileTree(
|
||||
files: [
|
||||
FileInfo(path: 'videos', name: 'clip.mp4', size: 1024),
|
||||
FileInfo(path: 'docs', name: 'notes.txt', size: 128),
|
||||
FileInfo(path: 'docs', name: 'manual.pdf', size: 256),
|
||||
FileInfo(path: 'videos', name: 'clip.mp4', size: 0),
|
||||
FileInfo(path: 'docs', name: 'notes.txt', size: 0),
|
||||
FileInfo(path: 'docs', name: 'manual.pdf', size: 0),
|
||||
],
|
||||
initialSelection: const [0, 1, 2],
|
||||
onSelectionChanged: (values) => selected = values,
|
||||
@@ -2708,7 +2708,26 @@ void main() {
|
||||
expect(find.byKey(const ValueKey('resolve-tree-expand-toggle')), findsOneWidget);
|
||||
expect(find.byType(shad.OutlinedContainer), findsOneWidget);
|
||||
expect(find.text('clip.mp4'), findsOneWidget);
|
||||
expect(find.text('Unknown size'), findsOneWidget);
|
||||
expect(tester.widget<Text>(find.text('clip.mp4')).style?.color, AppPalette.light.textPrimary);
|
||||
final baselines = tester
|
||||
.widgetList<Baseline>(
|
||||
find.descendant(
|
||||
of: find.byKey(const ValueKey('resolve-tree-selection-stats')),
|
||||
matching: find.byType(Baseline),
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
expect(baselines, hasLength(2));
|
||||
expect(baselines.first.baseline, baselines.last.baseline);
|
||||
expect(baselines.every((widget) => widget.baselineType == TextBaseline.alphabetic), isTrue);
|
||||
final filtersRect = tester.getRect(find.byKey(const ValueKey('resolve-tree-filters')));
|
||||
final statsRect = tester.getRect(find.byKey(const ValueKey('resolve-tree-selection-stats')));
|
||||
final selectedCountRect = tester.getRect(find.byKey(const ValueKey('resolve-tree-selected-count')));
|
||||
final selectedSizeRect = tester.getRect(find.byKey(const ValueKey('resolve-tree-selected-size')));
|
||||
expect(statsRect.center.dy, closeTo(filtersRect.center.dy, 0.01));
|
||||
expect(selectedCountRect.center.dy, closeTo(selectedSizeRect.center.dy, 0.01));
|
||||
expect(selectedSizeRect.left, greaterThan(selectedCountRect.right));
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('resolve-tree-expand-toggle')));
|
||||
await tester.pumpAndSettle();
|
||||
@@ -2770,8 +2789,16 @@ void main() {
|
||||
expect(find.text('clip.mp4'), findsOneWidget);
|
||||
expect(selected, [0, 1, 2]);
|
||||
|
||||
tester.view.physicalSize = const Size(360, 620);
|
||||
tester.view.physicalSize = const Size(280, 620);
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
tester.getRect(find.byKey(const ValueKey('resolve-tree-selection-stats'))).top,
|
||||
greaterThanOrEqualTo(tester.getRect(find.byKey(const ValueKey('resolve-tree-filters'))).bottom),
|
||||
);
|
||||
expect(
|
||||
tester.getRect(find.byKey(const ValueKey('resolve-tree-selected-size'))).top,
|
||||
greaterThanOrEqualTo(tester.getRect(find.byKey(const ValueKey('resolve-tree-selected-count'))).bottom),
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user