Last active
December 21, 2019 16:06
-
-
Save gastsail/43768759589891fa054eef10cedbded1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventsRepoImpl : IEventsRepo { | |
override suspend fun getEventsDB(): Resource<MutableList<Event>> { | |
val eventList = mutableListOf<Event>() | |
val resultList = FirebaseFirestore.getInstance() | |
.collection("events") | |
.get().await() | |
for (document in resultList) { | |
val photoUrl = document.getString("photoUrl") | |
val eventName = document.getString("eventName") | |
val time = document.getString("time") | |
eventList.add(Event(photoUrl!!, eventName!!, time!!)) | |
} | |
return Resource.Success(eventList) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment