import 'package:isar/isar.dart';
import 'package:json_annotation/json_annotation.dart';

import '../../../consts/consts.dart';

part 'id_value_color.g.dart';

@JsonSerializable(explicitToJson: true)
@embedded
class IdValueColor {
  IdValueColor();

  int? id;
  String? value;
  String? color;

  factory IdValueColor.fromJson(Map<String, dynamic> json) =>
      _$IdValueColorFromJson(json);

  toJson() => (prefs.getBool('extended_json') == true)
      ? _$IdValueColorToJson(this)
      : id;
}
