Skip to content

Commit e667796

Browse files
committed
feat(ui): enhance visual distinction of report entity types
- Replace uniform chip background color with entity-specific colors - Implement _getEntityTypeColor function to map entity types to colors - Update chip design to improve visual distinction across different report entity types
1 parent 7bfba86 commit e667796

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

lib/community_management/view/reports_page.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ class _ReportsDataSource extends DataTableSource {
195195
DataCell(
196196
Chip(
197197
label: Text(report.entityType.l10n(context)),
198-
backgroundColor:
199-
Theme.of(context).colorScheme.tertiaryContainer.withOpacity(0.5),
198+
backgroundColor: _getEntityTypeColor(context, report.entityType),
200199
side: BorderSide.none,
201200
visualDensity: VisualDensity.compact,
202201
),
@@ -217,4 +216,19 @@ class _ReportsDataSource extends DataTableSource {
217216

218217
@override
219218
int get selectedRowCount => 0;
219+
220+
Color? _getEntityTypeColor(
221+
BuildContext context,
222+
ReportableEntity entityType,
223+
) {
224+
final colorScheme = Theme.of(context).colorScheme;
225+
switch (entityType) {
226+
case ReportableEntity.headline:
227+
return colorScheme.primaryContainer.withOpacity(0.5);
228+
case ReportableEntity.source:
229+
return colorScheme.secondaryContainer.withOpacity(0.5);
230+
case ReportableEntity.engagement:
231+
return colorScheme.tertiaryContainer.withOpacity(0.5);
232+
}
233+
}
220234
}

0 commit comments

Comments
 (0)