Skip to content

Commit 887f3e3

Browse files
committed
fix(content): align sources page with non-nullable source model
Updates the `_SourcesDataSource` in `sources_page.dart` to correctly handle the `sourceType` and `updatedAt` fields of the `Source` 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 2308c31 commit 887f3e3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/content_management/view/sources_page.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,12 @@ class _SourcesDataSource extends DataTableSource {
168168
},
169169
cells: [
170170
DataCell(Text(source.name)),
171-
DataCell(Text(source.sourceType?.localizedName(l10n) ?? l10n.unknown)),
171+
DataCell(Text(source.sourceType.localizedName(l10n))),
172172
DataCell(Text(source.status.l10n(context))),
173173
DataCell(
174174
Text(
175-
source.updatedAt != null
176-
// TODO(fulleni): Make date format configurable by admin.
177-
? DateFormat('dd-MM-yyyy').format(source.updatedAt!.toLocal())
178-
: l10n.notAvailable,
175+
// TODO(fulleni): Make date format configurable by admin.
176+
DateFormat('dd-MM-yyyy').format(source.updatedAt.toLocal()),
179177
),
180178
),
181179
DataCell(

0 commit comments

Comments
 (0)