mirror of
https://github.com/friebetill/TubeCards.git
synced 2025-08-15 10:31:53 +08:00
28 lines
732 B
Dart
28 lines
732 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'csv_card.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class CSVCard {
|
|
CSVCard({required this.front, required this.back});
|
|
|
|
/// Constructs a new [CSVCard] from the given [json].
|
|
///
|
|
/// A conversion from JSON is especially useful in order to handle results
|
|
/// from an import.
|
|
factory CSVCard.fromJson(Map<String, dynamic> json) {
|
|
return _$CSVCardFromJson(json);
|
|
}
|
|
|
|
/// Front content of the card
|
|
final String front;
|
|
|
|
/// Back content of the card.
|
|
final String back;
|
|
|
|
/// Constructs a new json map from this [CSVCard].
|
|
///
|
|
/// A conversion to JSON is useful in order to send through an isolate.
|
|
Map<String, dynamic> toJson() => _$CSVCardToJson(this);
|
|
}
|