Fakultas Ilmu Komputer UI

kegiatan.dart 1.12 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import 'package:json_annotation/json_annotation.dart';
import 'package:bisaGo/config/custom_serializer.dart';

part 'kegiatan.g.dart';

@JsonSerializable()
class KegiatanList {
  final List<KegiatanModel> allKegiatan;
  KegiatanList(this.allKegiatan);
}

@JsonSerializable()
class KegiatanModel {
  final int id;
jovi_013's avatar
jovi_013 committed
15
16
  @JsonKey(name: 'place_id')
  final String placeId;
17
  final String creator;
jovi_013's avatar
jovi_013 committed
18
  @JsonKey(name: 'nama_kegiatan')
19
20
21
22
  final String namaKegiatan;
  final String penyelenggara;
  final String narahubung;
  final String deskripsi;
jovi_013's avatar
jovi_013 committed
23
24
25
26
  // @JsonKey(name: 'time_start', fromJson: CustomSerializer.stringToDateTime)
  // final DateTime timeStart;
  // @JsonKey(name: 'time_end', fromJson: CustomSerializer.stringToDateTime)
  // final DateTime timeEnd;
27
28

  KegiatanModel(
29
    {
30
      this.id,
jovi_013's avatar
jovi_013 committed
31
      this.placeId,
32
33
34
35
36
      this.creator,
      this.namaKegiatan,
      this.penyelenggara,
      this.narahubung,
      this.deskripsi,
jovi_013's avatar
jovi_013 committed
37
38
      // this.timeStart,
      // this.timeEnd
39
40
    }
  );
41
42
43
44

  factory KegiatanModel.fromJson(Map<String, dynamic> json) => _$KegiatanModelFromJson(json);
  Map<String, dynamic> toJson() => _$KegiatanModelToJson(this);
}