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
c68c3754
Commit
c68c3754
authored
May 17, 2021
by
Yoga Pratama
Browse files
[CHORES] Add fetch image logic
parent
cf13d486
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/repository/kegiatan_terdekat_repository.dart
View file @
c68c3754
...
...
@@ -10,8 +10,23 @@ class KegiatanTerdekatRepository implements BaseKegiatanTerdekatRepository {
@override
Future
fetchKegiatanTerdekatResponse
()
async
{
final
response
=
await
_network
.
get
(
url:
'/informasi-fasilitas/lokasi/kegiatan-terdekat'
,
isLogin:
false
);
url:
'/informasi-fasilitas/lokasi/kegiatan-terdekat'
,
isLogin:
false
);
var
kegiatan
=
KegiatanModel
.
fromJson
(
response
);
kegiatan
.
image
=
await
fetchFotoKegiatan
(
kegiatan
.
placeId
,
kegiatan
.
id
);
return
kegiatan
;
}
}
\ No newline at end of file
Future
<
List
<
String
>>
fetchFotoKegiatan
(
String
placeId
,
int
kegiatanId
)
async
{
final
response
=
await
_network
.
get
(
url:
'/informasi-fasilitas/lokasi/list-foto-kegiatan/
$placeId
/
$kegiatanId
'
,
isLogin:
false
);
final
List
<
String
>
data
=
response
.
values
.
toList
()
.
map
<
String
>((
element
)
=
>
element
[
'foto'
]
.
toString
())
.
toList
();
return
data
;
}
}
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