Skip to content

Commit 2308c31

Browse files
committed
fix(content): align headlines page with non-nullable headline model
Updates the `_HeadlinesDataSource` in `headlines_page.dart` to correctly handle the `source` and `updatedAt` fields of the `Headline` model, which are non-nullable. Removes unnecessary null-aware operators and null checks, ensuring the UI code is synchronized with the data model's constraints.
1 parent 7b58044 commit 2308c31

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/content_management/view/headlines_page.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,12 @@ class _HeadlinesDataSource extends DataTableSource {
169169
},
170170
cells: [
171171
DataCell(Text(headline.title)),
172-
DataCell(Text(headline.source?.name ?? l10n.unknown)),
172+
DataCell(Text(headline.source.name)),
173173
DataCell(Text(headline.status.l10n(context))),
174174
DataCell(
175175
Text(
176-
headline.updatedAt != null
177-
// TODO(fulleni): Make date format configurable by admin.
178-
? DateFormat('dd-MM-yyyy').format(headline.updatedAt!.toLocal())
179-
: l10n.notAvailable,
176+
// TODO(fulleni): Make date format configurable by admin.
177+
DateFormat('dd-MM-yyyy').format(headline.updatedAt.toLocal()),
180178
),
181179
),
182180
DataCell(

0 commit comments

Comments
 (0)