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
b16a7f3c
Verified
Commit
b16a7f3c
authored
Jun 06, 2021
by
Muhammad Ariq Basyar
Browse files
[CHORE] Done PBI 10, added previewable profile from kegiatan and komentar kegiatan
parent
67cc76a8
Pipeline
#81588
passed with stages
in 15 minutes and 54 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/model/kegiatan.dart
View file @
b16a7f3c
...
...
@@ -17,6 +17,8 @@ class KegiatanModel {
String
creator
;
@JsonKey
(
name:
'nama_kegiatan'
)
String
namaKegiatan
;
@JsonKey
(
name:
'creator_email'
)
String
creatorEmail
;
String
penyelenggara
;
String
deskripsi
;
@JsonKey
(
name:
'nama_kontak'
)
...
...
@@ -38,6 +40,7 @@ class KegiatanModel {
this
.
placeId
,
this
.
creator
,
this
.
namaKegiatan
,
this
.
creatorEmail
,
this
.
penyelenggara
,
this
.
deskripsi
,
this
.
namaKontak
,
...
...
lib/model/kegiatan.g.dart
View file @
b16a7f3c
...
...
@@ -27,6 +27,7 @@ KegiatanModel _$KegiatanModelFromJson(Map<String, dynamic> json) {
placeId:
json
[
'place_id'
]
as
String
,
creator:
json
[
'creator'
]
as
String
,
namaKegiatan:
json
[
'nama_kegiatan'
]
as
String
,
creatorEmail:
json
[
'creator_email'
]
as
String
,
penyelenggara:
json
[
'penyelenggara'
]
as
String
,
deskripsi:
json
[
'deskripsi'
]
as
String
,
namaKontak:
json
[
'nama_kontak'
]
as
String
,
...
...
@@ -45,6 +46,7 @@ Map<String, dynamic> _$KegiatanModelToJson(KegiatanModel instance) =>
'place_id'
:
instance
.
placeId
,
'creator'
:
instance
.
creator
,
'nama_kegiatan'
:
instance
.
namaKegiatan
,
'creator_email'
:
instance
.
creatorEmail
,
'penyelenggara'
:
instance
.
penyelenggara
,
'deskripsi'
:
instance
.
deskripsi
,
'nama_kontak'
:
instance
.
namaKontak
,
...
...
lib/model/komentar.dart
View file @
b16a7f3c
import
'package:intl/intl.dart'
;
import
'package:json_annotation/json_annotation.dart'
;
import
'package:bisaGo/config/custom_serializer.dart'
;
part
'komentar.g.dart'
;
...
...
lib/page/filter_fasilitas/kegiatan.dart
View file @
b16a7f3c
...
...
@@ -29,6 +29,7 @@ class _KegiatanState extends State<Kegiatan> {
id:
widget
.
kegiatan
.
id
,
placeId:
widget
.
kegiatan
.
placeId
,
creator:
widget
.
kegiatan
.
creator
,
creatorEmail:
widget
.
kegiatan
.
creatorEmail
,
namaKegiatan:
widget
.
kegiatan
.
namaKegiatan
,
penyelenggara:
widget
.
kegiatan
.
penyelenggara
,
deskripsi:
widget
.
kegiatan
.
deskripsi
,
...
...
lib/page/filter_fasilitas/postingan/detail_post_kegiatan.dart
View file @
b16a7f3c
...
...
@@ -2,7 +2,10 @@ import 'dart:async';
import
'package:bisaGo/model/kegiatan.dart'
;
import
'package:bisaGo/model/lokasi.dart'
;
import
'package:bisaGo/model/user.dart'
;
import
'package:bisaGo/page/filter_fasilitas/kegiatan_list_images.dart'
;
import
'package:bisaGo/page/profile/profile.dart'
;
import
'package:bisaGo/page/profile/profile_picture.dart'
;
import
'package:bisaGo/repository/dynamic_links_service_repository.dart'
;
import
'package:bisaGo/utils/share_utils.dart'
;
import
'package:bisaGo/utils/validator.dart'
;
...
...
@@ -349,14 +352,24 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
constraints:
BoxConstraints
(
maxWidth:
MediaQuery
.
of
(
context
)
.
size
.
width
*
0.3
),
child:
Text
(
'
${widget.kegiatan.creator}
'
,
key:
Key
(
'creator-
${widget.kegiatan.creator}
'
),
overflow:
TextOverflow
.
fade
,
softWrap:
false
,
style:
const
TextStyle
(
fontSize:
12
,
fontStyle:
FontStyle
.
italic
,
child:
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
_
)
=
>
Profile
(
email:
widget
.
kegiatan
.
creatorEmail
,
isPublic:
true
)));
},
child:
Text
(
'
${widget.kegiatan.creator}
'
,
key:
Key
(
'creator-
${widget.kegiatan.creator}
'
),
overflow:
TextOverflow
.
fade
,
softWrap:
false
,
style:
const
TextStyle
(
fontSize:
12
,
fontStyle:
FontStyle
.
italic
,
),
),
),
),
...
...
@@ -411,6 +424,8 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
.
map
<
Widget
>((
k
)
=
>
komentarKegiatanPlaceHolder
(
k
.
creator
,
k
.
creatorEmail
,
k
.
creatorPicture
,
k
.
created
,
k
.
deskripsi
))
.
toList
());
...
...
@@ -604,21 +619,17 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
}
Widget
komentarKegiatanPlaceHolder
(
String
name
,
DateTime
created
,
String
description
)
{
String
name
,
String
email
,
String
foto
,
DateTime
created
,
String
description
)
{
final
user
=
DetailUserModel
()
.
.
email
=
email
.
.
foto
=
foto
.
.
name
=
name
;
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Row
(
children:
<
Widget
>[
CircleAvatar
(
backgroundColor:
greenPrimary
,
child:
Text
(
_creatorInitials
(
name
),
style:
const
TextStyle
(
color:
Colors
.
white
,
),
),
),
ProfilePicture
(
user
,
redirectToDetailProfile:
true
),
Padding
(
padding:
const
EdgeInsets
.
all
(
regularSpace
),
child:
Column
(
...
...
@@ -649,16 +660,6 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
);
}
String
_creatorInitials
(
String
name
)
{
if
(
name
.
isEmpty
)
return
''
;
var
initials
=
''
;
for
(
final
i
in
name
.
split
(
' '
))
{
initials
+=
'
${i[0].toUpperCase()}
'
;
}
if
(
initials
.
length
>
2
)
return
initials
.
substring
(
0
,
2
);
return
initials
;
}
// Future<void> _updateInformasi() async {
// final sharedPreferences = await SharedPreferences.getInstance();
// if (sharedPreferences.getString('token') == null) {
...
...
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