25 lines
527 B
Dart
25 lines
527 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
part 'event.g.dart';
|
|
|
|
@JsonSerializable()
|
|
class Event {
|
|
String name;
|
|
String picture;
|
|
String organizer = 'Organizer';
|
|
String? place;
|
|
DateTime? date;
|
|
bool isFavorite;
|
|
|
|
Event({
|
|
required this.name,
|
|
required this.picture,
|
|
required this.organizer,
|
|
this.date,
|
|
this.place,
|
|
this.isFavorite = false,
|
|
});
|
|
|
|
factory Event.fromJson(Map<String, dynamic> json) => _$EventFromJson(json);
|
|
Map<String, dynamic> toJson() => _$EventToJson(this);
|
|
} |