fix(ui): 修正六屏顶栏与内容间距
This commit is contained in:
1 parent
e03ea76505
commit
2fd92cdbea
11 files changed
+281
-66
No files matched your search
@@ -10,6 +10,7 @@ import 'package:fruitshorts/core/data/models/watch_progress.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/favorite_repository.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/playback_repository.dart';
|
||||
import 'package:fruitshorts/core/data/repositories/watch_history_repository.dart';
|
||||
import 'package:fruitshorts/core/theme/app_colors.dart';
|
||||
|
||||
import '../support/fake_catalog.dart';
|
||||
import '../support/fake_category.dart';
|
||||
@@ -59,11 +60,57 @@ void main() {
|
||||
|
||||
expect(find.byKey(const Key('mine-user-row')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-wallet')), findsOneWidget);
|
||||
for (final key in const [Key('mine-search-button'), Key('mine-avatar')]) {
|
||||
expect(tester.getSize(find.byKey(key)), const Size(36, 36));
|
||||
expect(
|
||||
tester
|
||||
.widget<Icon>(
|
||||
find.descendant(of: find.byKey(key), matching: find.byType(Icon)),
|
||||
)
|
||||
.size,
|
||||
18,
|
||||
);
|
||||
}
|
||||
expect(find.byKey(const Key('mine-continue-watching')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-language')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-library-tab-0')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-library-tab-1')), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-library-tab-2')), findsOneWidget);
|
||||
final tab0 = find.byKey(const Key('mine-library-tab-0'));
|
||||
final tab1 = find.byKey(const Key('mine-library-tab-1'));
|
||||
final tab2 = find.byKey(const Key('mine-library-tab-2'));
|
||||
expect(tester.getTopLeft(tab0).dx, lessThan(tester.getTopLeft(tab1).dx));
|
||||
expect(tester.getTopLeft(tab1).dx, lessThan(tester.getTopLeft(tab2).dx));
|
||||
expect(
|
||||
tester.getTopLeft(tab1).dx - tester.getTopRight(tab0).dx,
|
||||
closeTo(20, 1),
|
||||
);
|
||||
expect(
|
||||
(tester
|
||||
.widget<AnimatedContainer>(
|
||||
find.descendant(
|
||||
of: tab0,
|
||||
matching: find.byType(AnimatedContainer),
|
||||
),
|
||||
)
|
||||
.decoration
|
||||
as BoxDecoration)
|
||||
.color,
|
||||
AppColors.blue,
|
||||
);
|
||||
expect(
|
||||
(tester
|
||||
.widget<AnimatedContainer>(
|
||||
find.descendant(
|
||||
of: tab1,
|
||||
matching: find.byType(AnimatedContainer),
|
||||
),
|
||||
)
|
||||
.decoration
|
||||
as BoxDecoration)
|
||||
.color,
|
||||
Colors.transparent,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user