commit
dabff48f7c
4 files changed
+23
-31
No files matched your search
@@ -30,6 +30,9 @@ abstract final class AppColors {
|
|||||||
/// 首页及剧集播放页视频信息文案:参考设计图的 65% 半透明白。
|
/// 首页及剧集播放页视频信息文案:参考设计图的 65% 半透明白。
|
||||||
static const homeFeedVideoCopy = Color(0xA6FFFFFF);
|
static const homeFeedVideoCopy = Color(0xA6FFFFFF);
|
||||||
|
|
||||||
|
/// 首页观看全集按钮:参考设计稿的中性深灰表面。
|
||||||
|
static const watchAllSurface = Color(0xFF333333);
|
||||||
|
|
||||||
/// 主操作、选中态、播放进度。旧品牌橙已全量映射为品牌红(2026-10 改版)。
|
/// 主操作、选中态、播放进度。旧品牌橙已全量映射为品牌红(2026-10 改版)。
|
||||||
static const blue = Color(0xFFF04E4E);
|
static const blue = Color(0xFFF04E4E);
|
||||||
static const primary = blue;
|
static const primary = blue;
|
||||||
|
|||||||
@@ -35,13 +35,8 @@ const _metadataStrutStyle = StrutStyle(
|
|||||||
const double _watchAllInset = 12;
|
const double _watchAllInset = 12;
|
||||||
const double _watchAllRadius = 6;
|
const double _watchAllRadius = 6;
|
||||||
const double _watchAllFont = 16;
|
const double _watchAllFont = 16;
|
||||||
const _watchAllGradient = LinearGradient(
|
|
||||||
begin: Alignment.centerLeft,
|
|
||||||
end: Alignment.centerRight,
|
|
||||||
colors: [AppColors.mineStatShade, AppColors.brandRed, AppColors.vipButtonEnd],
|
|
||||||
);
|
|
||||||
|
|
||||||
/// 「观看完整剧集」渐变按钮高度,overlay 用它安排底部避让。
|
/// 「观看完整剧集」按钮高度,overlay 用它安排底部避让。
|
||||||
const double homeFeedWatchAllHeight = _watchAllHeight;
|
const double homeFeedWatchAllHeight = _watchAllHeight;
|
||||||
|
|
||||||
/// 播放量紧凑展示(跟随语言):zh 20万 / en 200K / id 200 rb。
|
/// 播放量紧凑展示(跟随语言):zh 20万 / en 200K / id 200 rb。
|
||||||
@@ -212,8 +207,8 @@ class HomeFeedWatchAllBar extends StatelessWidget {
|
|||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(_watchAllRadius),
|
borderRadius: BorderRadius.circular(_watchAllRadius),
|
||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
key: const Key('home-feed-full-series-gradient'),
|
key: const Key('home-feed-full-series-surface'),
|
||||||
decoration: const BoxDecoration(gradient: _watchAllGradient),
|
decoration: const BoxDecoration(color: AppColors.watchAllSurface),
|
||||||
child: Material(
|
child: Material(
|
||||||
key: const Key('home-feed-full-series-bg'),
|
key: const Key('home-feed-full-series-bg'),
|
||||||
color: AppColors.transparent,
|
color: AppColors.transparent,
|
||||||
|
|||||||
@@ -260,23 +260,15 @@ void main() {
|
|||||||
_expectNoShadows(tester);
|
_expectNoShadows(tester);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('should_use_small_radius_and_brand_gradient_when_watching_all', (
|
testWidgets('should_use_reference_surface_when_watching_all', (tester) async {
|
||||||
tester,
|
|
||||||
) async {
|
|
||||||
await _pump(tester);
|
await _pump(tester);
|
||||||
final background = find.byKey(const Key('home-feed-full-series-bg'));
|
final background = find.byKey(const Key('home-feed-full-series-bg'));
|
||||||
final decorated = tester.widget<DecoratedBox>(
|
final decorated = tester.widget<DecoratedBox>(
|
||||||
find.byKey(const Key('home-feed-full-series-gradient')),
|
find.byKey(const Key('home-feed-full-series-surface')),
|
||||||
);
|
);
|
||||||
final decoration = decorated.decoration as BoxDecoration;
|
final decoration = decorated.decoration as BoxDecoration;
|
||||||
expect((decoration.gradient! as LinearGradient).colors, [
|
expect(decoration.color, AppColors.watchAllSurface);
|
||||||
AppColors.mineStatShade,
|
expect(decoration.gradient, isNull);
|
||||||
AppColors.brandRed,
|
|
||||||
AppColors.vipButtonEnd,
|
|
||||||
]);
|
|
||||||
final gradient = decoration.gradient! as LinearGradient;
|
|
||||||
expect(gradient.begin, Alignment.centerLeft);
|
|
||||||
expect(gradient.end, Alignment.centerRight);
|
|
||||||
expect(tester.widget<Text>(find.text('Watch all')).style?.fontSize, 16);
|
expect(tester.widget<Text>(find.text('Watch all')).style?.fontSize, 16);
|
||||||
expect(
|
expect(
|
||||||
tester.widget<Text>(find.text('Watch all')).style?.fontWeight,
|
tester.widget<Text>(find.text('Watch all')).style?.fontWeight,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// Author: fruit.com.cn
|
// Author: fruit.com.cn
|
||||||
// 职责:检查观看全集按钮实际绘制像素,防止渐变只配置而不可见。
|
// 职责:检查观看全集按钮实际绘制像素,防止配色只配置而不可见。
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
@@ -10,15 +10,16 @@ import 'package:fruitshorts/core/data/models/drama.dart';
|
|||||||
import 'package:fruitshorts/l10n/app_localizations.dart';
|
import 'package:fruitshorts/l10n/app_localizations.dart';
|
||||||
import 'package:fruitshorts/pages/player/widgets/home_feed_recommend_panel.dart';
|
import 'package:fruitshorts/pages/player/widgets/home_feed_recommend_panel.dart';
|
||||||
|
|
||||||
const _boundaryKey = Key('watch-gradient-boundary');
|
const _boundaryKey = Key('watch-surface-boundary');
|
||||||
const _width = 280.0;
|
const _width = 280.0;
|
||||||
const _sampleInset = 16;
|
const _sampleInset = 16;
|
||||||
const _sampleY = 4;
|
const _sampleY = 4;
|
||||||
const _rgbaChannels = 4;
|
const _rgbaChannels = 4;
|
||||||
const _minimumRedDelta = 50;
|
const _surfaceChannel = 0.2;
|
||||||
|
const _surfaceTolerance = 0.01;
|
||||||
const _drama = Drama(
|
const _drama = Drama(
|
||||||
id: 'gradient',
|
id: 'surface',
|
||||||
title: 'Gradient',
|
title: 'Surface',
|
||||||
synopsis: '',
|
synopsis: '',
|
||||||
posterUrl: '',
|
posterUrl: '',
|
||||||
);
|
);
|
||||||
@@ -52,7 +53,7 @@ Color _sample(ByteData bytes, int width, int x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('should_paint_visible_red_gradient_instead_of_flat_fill', (
|
testWidgets('should_paint_reference_dark_surface_when_watching_all', (
|
||||||
tester,
|
tester,
|
||||||
) async {
|
) async {
|
||||||
await _pumpButton(tester);
|
await _pumpButton(tester);
|
||||||
@@ -68,11 +69,12 @@ void main() {
|
|||||||
final middle = _sample(bytes, image.width, image.width ~/ 2);
|
final middle = _sample(bytes, image.width, image.width ~/ 2);
|
||||||
final right = _sample(bytes, image.width, image.width - _sampleInset);
|
final right = _sample(bytes, image.width, image.width - _sampleInset);
|
||||||
image.dispose();
|
image.dispose();
|
||||||
expect(left.a, 1);
|
for (final sample in [left, middle, right]) {
|
||||||
expect(right.a, 1);
|
expect(sample.a, 1);
|
||||||
expect((right.r - left.r) * 255, greaterThan(_minimumRedDelta));
|
expect(sample.r, closeTo(_surfaceChannel, _surfaceTolerance));
|
||||||
expect(left.g, lessThan(middle.g));
|
expect(sample.g, closeTo(_surfaceChannel, _surfaceTolerance));
|
||||||
expect(middle.g, lessThan(right.g));
|
expect(sample.b, closeTo(_surfaceChannel, _surfaceTolerance));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user