Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
bisago
bisago-fe
Commits
4b192f89
Commit
4b192f89
authored
May 15, 2021
by
jovi_013
Browse files
[WIP] Render all Kegiatan in Lokasi
parent
90409f9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/model/kegiatan.dart
View file @
4b192f89
...
...
@@ -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
}
);
...
...
lib/model/kegiatan.g.dart
View file @
4b192f89
...
...
@@ -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
[
'nama
K
egiatan'
]
as
String
,
namaKegiatan:
json
[
'nama
_k
egiatan'
]
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
,
'nama
K
egiatan'
:
instance
.
namaKegiatan
,
'nama
_k
egiatan'
:
instance
.
namaKegiatan
,
'penyelenggara'
:
instance
.
penyelenggara
,
'narahubung'
:
instance
.
narahubung
,
'deskripsi'
:
instance
.
deskripsi
,
'time_start'
:
instance
.
timeStart
?.
toIso8601String
(),
'time_end'
:
instance
.
timeEnd
?.
toIso8601String
(),
};
lib/page/filter_fasilitas/kegiatan.dart
View file @
4b192f89
// 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
.
nama
Kegiatan
),
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
.
nama
Kegiatan
,
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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment