selfprivacy.org.app/lib/ui/components/jobs_content/job_icon.dart

30 lines
903 B
Dart
Raw Normal View History

2024-11-05 19:27:21 +00:00
import 'package:flutter/material.dart';
import 'package:selfprivacy/logic/models/json/server_job.dart';
IconData getJobIcon(final JobStatusEnum status) {
switch (status) {
case JobStatusEnum.created:
return Icons.query_builder_outlined;
case JobStatusEnum.running:
return Icons.pending_outlined;
case JobStatusEnum.finished:
return Icons.check_circle_outline;
case JobStatusEnum.error:
return Icons.error_outline;
}
}
Color getJobColor(final JobStatusEnum status, final BuildContext context) {
switch (status) {
case JobStatusEnum.created:
return Theme.of(context).colorScheme.secondary;
case JobStatusEnum.running:
return Theme.of(context).colorScheme.tertiary;
case JobStatusEnum.finished:
return Theme.of(context).colorScheme.primary;
case JobStatusEnum.error:
return Theme.of(context).colorScheme.error;
}
}