output.dart 1011 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:vid/us/vid_us_unit.dart';
  2. class OutputItem<T> {
  3. T value;
  4. String name;
  5. VidUsUnit? unit;
  6. int id;
  7. late String description;
  8. late String additionalDescription;
  9. late String briefDescription;
  10. OutputItem({
  11. required this.id,
  12. required this.value,
  13. required this.name,
  14. this.unit,
  15. String? description,
  16. String? additionalDescription,
  17. String? briefDescription,
  18. }) {
  19. updateDescription(
  20. description: description,
  21. additionalDescription: additionalDescription,
  22. briefDescription: briefDescription,
  23. );
  24. }
  25. void updateDescription({
  26. String? description,
  27. String? additionalDescription,
  28. String? briefDescription,
  29. }) {
  30. if (description != null && description.isNotEmpty) {
  31. this.description = description;
  32. this.additionalDescription = additionalDescription ?? '';
  33. this.briefDescription = briefDescription ?? '';
  34. } else {
  35. this.additionalDescription = '';
  36. this.briefDescription = '';
  37. }
  38. }
  39. }