import 'package:vid/us/vid_us_unit.dart';

class OutputItem<T> {
  T value;
  String name;
  VidUsUnit? unit;
  late String description;
  late String additionalDescription;
  late String briefDescription;

  OutputItem({
    required this.value,
    required this.name,
    this.unit,
    String? description,
    String? additionalDescription,
    String? briefDescription,
  }) {
    updateDescription(
      description: description,
      additionalDescription: additionalDescription,
      briefDescription: briefDescription,
    );
  }

  void updateDescription({
    String? description,
    String? additionalDescription,
    String? briefDescription,
  }) {
    if (description != null && description.isNotEmpty) {
      this.description = description;
      this.additionalDescription = additionalDescription ?? '';
      this.briefDescription = briefDescription ?? '';
    } else {
      this.additionalDescription = '';
      this.briefDescription = '';
    }
  }
}
