Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 39 additions & 38 deletions lib/features/earthquake/presentation/pages/report_list_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -244,39 +244,47 @@ class _DaySection extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(
left: AppSpacing.xs,
bottom: AppSpacing.sm,
),
child: Row(
children: [
Flexible(
child: Text(
_dayLabel(day, l10n, locale),
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
SizedBox(
width: double.infinity,
child: Padding(
padding: const EdgeInsets.only(
left: AppSpacing.xs,
bottom: AppSpacing.sm,
),
child: Row(
children: [
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
Comment on lines +256 to 269

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other · medium
佈局邏輯變動可能導致 UI 呈現不符合預期。原本使用 Flexible 搭配 Expanded (Divider),可以讓 Label 佔用所需空間並讓 Divider 填滿剩餘空間。現在將 Label 改為 Expanded,會導致 Label 與 Divider 平分剩餘空間,使得 Divider 的位置不再位於右側,而是移至畫面中間。若要兼顧防止溢出與正確佈局,建議改回 Flexible 並保留 FittedBox

Suggestion:

Suggested change
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
Flexible(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),

),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
),
),
Comment on lines +256 to 277

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bug · medium
佈局邏輯變動:將原本用於標籤的 Flexible 改為 Expanded 會導致標籤與分隔線 (Divider) 平分剩餘空間,這會使分隔線不再位於右側,而是變成在畫面中間,這與原本「標籤 + 填充式分隔線」的 UI 設計不符。

Suggestion:

Suggested change
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
),
),
Flexible(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
),
),

),
const SizedBox(width: AppSpacing.sm),
Text(
l10n.reportListDayCount(reports.length),
style: theme.textTheme.labelMedium?.copyWith(
color: colors.onSurfaceVariant,
fontFeatures: const [FontFeature.tabularFigures()],
const SizedBox(width: AppSpacing.sm),
Text(
l10n.reportListDayCount(reports.length),
style: theme.textTheme.labelMedium?.copyWith(
color: colors.onSurfaceVariant,
fontFeatures: const [FontFeature.tabularFigures()],
),
),
),
],
],
),
),
),
Material(
Expand Down Expand Up @@ -310,20 +318,13 @@ class _DaySection extends StatelessWidget {
} else if (day == today.subtract(const Duration(days: 1))) {
relative = l10n.reportListYesterday;
}
if (relative != null) {
final date = _relativeDayFormats
.putIfAbsent(locale, () => DateFormat.yMMMd(locale))
.format(day);
return '$relative ($date)';
}
// Parsing a locale's pattern is not free — memoised per locale.
return _dayFormats
final date = _dayFormats
.putIfAbsent(locale, () => DateFormat.yMMMEd(locale))
.format(day);
return relative == null ? date : '$date ($relative)';
Comment on lines +321 to +324

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other · medium
日期顯示順序與格式發生了變動:

  1. 顯示順序從 '$relative ($date)' (例如: 昨天 (9月13日)) 變更為 '$date ($relative)' (例如: 9月13日 (昨天))。
  2. 日期格式從 yMMMd 統一變更為 yMMMEd
    這屬於 UI/UX 邏輯的重大變更,請確認是否符合產品設計規範或使用者習慣。

Comment on lines +321 to +324

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other · low
日期顯示邏輯變動:相對日期的顯示順序從 '$relative ($date)' (例如: Yesterday (Jan 1, 2023)) 改為 '$date ($relative)' (例如: Jan 1, 2023 (Yesterday)),且日期格式由 yMMMd 變更為 yMMMEd。請確認此變更是否符合產品設計規格。

}

static final Map<String, DateFormat> _dayFormats = {};
static final Map<String, DateFormat> _relativeDayFormats = {};
}

class _ReportTile extends StatelessWidget {
Expand Down
Loading