fix(app): poster — date-only text, left-aligned title/time/venue (QR stays centered)
用户反馈:海报日期仍带时间(表单已日期粒度,海报 formatAlbumDateTime 同步改 posterDate 只显 y/M/d);宣传图下标题/时间/地址居左;二维码保持居中。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -379,18 +379,16 @@ class _PosterSheetState extends ConsumerState<_PosterSheet> {
|
|||||||
final localeName = l10n.localeName;
|
final localeName = l10n.localeName;
|
||||||
final url = shareAlbumUrl(widget.album, localeName);
|
final url = shareAlbumUrl(widget.album, localeName);
|
||||||
final title = albumDisplayTitle(widget.album, localeName);
|
final title = albumDisplayTitle(widget.album, localeName);
|
||||||
final start = formatAlbumDateTime(
|
// 海报日期:日期粒度(UI06 选择器已去时间;展示同口径)。
|
||||||
widget.album.startAt,
|
String posterDate(DateTime utc) {
|
||||||
widget.album.timezone,
|
final wall = tryToAlbumZone(utc, widget.album.timezone) ?? utc.toUtc();
|
||||||
localeName,
|
return '${wall.year}/${wall.month}/${wall.day}';
|
||||||
);
|
}
|
||||||
|
|
||||||
|
final start = posterDate(widget.album.startAt);
|
||||||
final end = widget.album.endAt == null
|
final end = widget.album.endAt == null
|
||||||
? null
|
? null
|
||||||
: formatAlbumDateTime(
|
: posterDate(widget.album.endAt!);
|
||||||
widget.album.endAt!,
|
|
||||||
widget.album.timezone,
|
|
||||||
localeName,
|
|
||||||
);
|
|
||||||
final dateRange = end == null ? start : '$start ~ $end';
|
final dateRange = end == null ? start : '$start ~ $end';
|
||||||
final venue = albumDisplayVenue(widget.album, localeName);
|
final venue = albumDisplayVenue(widget.album, localeName);
|
||||||
String? addressForPoster(AlbumSummary album) {
|
String? addressForPoster(AlbumSummary album) {
|
||||||
@@ -451,19 +449,19 @@ class _PosterSheetState extends ConsumerState<_PosterSheet> {
|
|||||||
padding: const EdgeInsets.all(kSpace24),
|
padding: const EdgeInsets.all(kSpace24),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// 活动标题。
|
// 活动标题(居左;二维码保持居中)。
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.left,
|
||||||
style: theme.textTheme.titleLarge?.copyWith(
|
style: theme.textTheme.titleLarge?.copyWith(
|
||||||
color: const Color(0xFF172033),
|
color: const Color(0xFF172033),
|
||||||
fontWeight: FontWeight.w700,
|
fontWeight: FontWeight.w700,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: kSpace12),
|
const SizedBox(height: kSpace12),
|
||||||
// 时间。
|
// 时间(居左)。
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.event_outlined,
|
Icons.event_outlined,
|
||||||
@@ -486,7 +484,7 @@ class _PosterSheetState extends ConsumerState<_PosterSheet> {
|
|||||||
if (venue != null) ...[
|
if (venue != null) ...[
|
||||||
const SizedBox(height: kSpace4),
|
const SizedBox(height: kSpace4),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.place_outlined,
|
Icons.place_outlined,
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ void main() {
|
|||||||
expect(find.byType(QrImageView), findsOneWidget);
|
expect(find.byType(QrImageView), findsOneWidget);
|
||||||
expect(find.text('Scan to view photos'), findsOneWidget);
|
expect(find.text('Scan to view photos'), findsOneWidget);
|
||||||
expect(find.text('Download poster image'), findsOneWidget);
|
expect(find.text('Download poster image'), findsOneWidget);
|
||||||
expect(find.text('2026/9/18 14:30'), findsOneWidget);
|
// UI06:海报日期粒度(无时间)。
|
||||||
|
expect(find.text('2026/9/18'), findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('Copy link(主操作)→ 剪贴板收到带 lang 的 URL + 已复制提示',
|
testWidgets('Copy link(主操作)→ 剪贴板收到带 lang 的 URL + 已复制提示',
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user