Fakultas Ilmu Komputer UI

Commit 4b192f89 authored by jovi_013's avatar jovi_013
Browse files

[WIP] Render all Kegiatan in Lokasi

parent 90409f9e
......@@ -12,29 +12,30 @@ class KegiatanList {
@JsonSerializable()
class KegiatanModel {
final int id;
@JsonKey(name: 'nama_lokasi')
final String namaLokasi;
@JsonKey(name: 'place_id')
final String placeId;
final String creator;
@JsonKey(name: 'nama_kegiatan')
final String namaKegiatan;
final String penyelenggara;
final String narahubung;
final String deskripsi;
@JsonKey(name: 'time_start', fromJson: CustomSerializer.stringToDateTime)
final DateTime timeStart;
@JsonKey(name: 'time_end', fromJson: CustomSerializer.stringToDateTime)
final DateTime timeEnd;
// @JsonKey(name: 'time_start', fromJson: CustomSerializer.stringToDateTime)
// final DateTime timeStart;
// @JsonKey(name: 'time_end', fromJson: CustomSerializer.stringToDateTime)
// final DateTime timeEnd;
KegiatanModel(
{
this.id,
this.namaLokasi,
this.placeId,
this.creator,
this.namaKegiatan,
this.penyelenggara,
this.narahubung,
this.deskripsi,
this.timeStart,
this.timeEnd
// this.timeStart,
// this.timeEnd
}
);
......
......@@ -24,26 +24,22 @@ Map<String, dynamic> _$KegiatanListToJson(KegiatanList instance) =>
KegiatanModel _$KegiatanModelFromJson(Map<String, dynamic> json) {
return KegiatanModel(
id: json['id'] as int,
namaLokasi: json['nama_lokasi'] as String,
placeId: json['place_id'] as String,
creator: json['creator'] as String,
namaKegiatan: json['namaKegiatan'] as String,
namaKegiatan: json['nama_kegiatan'] as String,
penyelenggara: json['penyelenggara'] as String,
narahubung: json['narahubung'] as String,
deskripsi: json['deskripsi'] as String,
timeStart: CustomSerializer.stringToDateTime(json['time_start'] as String),
timeEnd: CustomSerializer.stringToDateTime(json['time_end'] as String),
);
}
Map<String, dynamic> _$KegiatanModelToJson(KegiatanModel instance) =>
<String, dynamic>{
'id': instance.id,
'nama_lokasi': instance.namaLokasi,
'place_id': instance.placeId,
'creator': instance.creator,
'namaKegiatan': instance.namaKegiatan,
'nama_kegiatan': instance.namaKegiatan,
'penyelenggara': instance.penyelenggara,
'narahubung': instance.narahubung,
'deskripsi': instance.deskripsi,
'time_start': instance.timeStart?.toIso8601String(),
'time_end': instance.timeEnd?.toIso8601String(),
};
// import 'package:bisaGo/config/strings.dart';
import 'package:bisaGo/model/lokasi.dart';
import 'package:flutter/material.dart';
// import 'package:bisaGo/component/image_holder.dart';
......@@ -16,24 +15,18 @@ class Kegiatan extends StatefulWidget {
}
class _KegiatanState extends State<Kegiatan> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return InkWell(
// key: Key('Kegiatan'),
key: Key(widget.kegiatan.namaKegiatan),
child: Container(
margin: const EdgeInsets.only(bottom: regularSpace),
padding: const EdgeInsets.all(doubleSpace),
decoration: BoxDecoration(
boxShadow: regularShadow,
border: Border.all(width: 2, color: greenPrimary.withOpacity(0.4)),
borderRadius: const BorderRadius.all(
Radius.circular(10)
),
borderRadius: const BorderRadius.all(Radius.circular(10)),
color: Colors.white,
),
child: Stack(
......@@ -46,7 +39,7 @@ class _KegiatanState extends State<Kegiatan> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
'Kegiatan',
widget.kegiatan.namaKegiatan,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w800,
......@@ -74,7 +67,7 @@ class _KegiatanState extends State<Kegiatan> {
children: <Widget>[
Flexible(
child: Text(
'ditambahkan oleh TEST',
'ditambahkan oleh ${widget.kegiatan.creator}',
softWrap: true,
style: const TextStyle(
fontSize: 12,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment