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 url = shareAlbumUrl(widget.album, localeName);
|
||||
final title = albumDisplayTitle(widget.album, localeName);
|
||||
final start = formatAlbumDateTime(
|
||||
widget.album.startAt,
|
||||
widget.album.timezone,
|
||||
localeName,
|
||||
);
|
||||
// 海报日期:日期粒度(UI06 选择器已去时间;展示同口径)。
|
||||
String posterDate(DateTime utc) {
|
||||
final wall = tryToAlbumZone(utc, widget.album.timezone) ?? utc.toUtc();
|
||||
return '${wall.year}/${wall.month}/${wall.day}';
|
||||
}
|
||||
|
||||
final start = posterDate(widget.album.startAt);
|
||||
final end = widget.album.endAt == null
|
||||
? null
|
||||
: formatAlbumDateTime(
|
||||
widget.album.endAt!,
|
||||
widget.album.timezone,
|
||||
localeName,
|
||||
);
|
||||
: posterDate(widget.album.endAt!);
|
||||
final dateRange = end == null ? start : '$start ~ $end';
|
||||
final venue = albumDisplayVenue(widget.album, localeName);
|
||||
String? addressForPoster(AlbumSummary album) {
|
||||
@@ -451,19 +449,19 @@ class _PosterSheetState extends ConsumerState<_PosterSheet> {
|
||||
padding: const EdgeInsets.all(kSpace24),
|
||||
child: Column(
|
||||
children: [
|
||||
// 活动标题。
|
||||
// 活动标题(居左;二维码保持居中)。
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
textAlign: TextAlign.left,
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
color: const Color(0xFF172033),
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: kSpace12),
|
||||
// 时间。
|
||||
// 时间(居左)。
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.event_outlined,
|
||||
@@ -486,7 +484,7 @@ class _PosterSheetState extends ConsumerState<_PosterSheet> {
|
||||
if (venue != null) ...[
|
||||
const SizedBox(height: kSpace4),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.place_outlined,
|
||||
|
||||
@@ -81,7 +81,8 @@ void main() {
|
||||
expect(find.byType(QrImageView), findsOneWidget);
|
||||
expect(find.text('Scan to view photos'), 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 + 已复制提示',
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user