"#22 styling of task overview"
This commit is contained in:
parent
1a2e192227
commit
e1c05bb0d4
9 changed files with 140 additions and 37 deletions
|
@ -1,11 +1,12 @@
|
|||
package be.ugent.sel.studeez.domain
|
||||
|
||||
import be.ugent.sel.studeez.data.local.models.task.Subject
|
||||
import be.ugent.sel.studeez.data.local.models.task.Task
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface TaskDAO {
|
||||
|
||||
fun getTasks(): Flow<List<Task>>
|
||||
fun getTasks(subject: Subject): Flow<List<Task>>
|
||||
|
||||
fun saveTask(newTask: Task)
|
||||
|
||||
|
|
|
@ -1,18 +1,31 @@
|
|||
package be.ugent.sel.studeez.domain.implementation
|
||||
|
||||
import be.ugent.sel.studeez.data.local.models.task.Subject
|
||||
import be.ugent.sel.studeez.data.local.models.task.Task
|
||||
import be.ugent.sel.studeez.domain.AccountDAO
|
||||
import be.ugent.sel.studeez.domain.TaskDAO
|
||||
import com.google.firebase.firestore.FirebaseFirestore
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flowOf
|
||||
import javax.inject.Inject
|
||||
|
||||
class FireBaseTaskDAO @Inject constructor(
|
||||
private val firestore: FirebaseFirestore,
|
||||
private val auth: AccountDAO,
|
||||
) : TaskDAO {
|
||||
override fun getTasks(): Flow<List<Task>> {
|
||||
TODO("Not yet implemented")
|
||||
override fun getTasks(subject: Subject): Flow<List<Task>> {
|
||||
return flowOf(
|
||||
listOf(
|
||||
Task(
|
||||
name = "Test Task",
|
||||
completed = false,
|
||||
),
|
||||
Task(
|
||||
name = "Test Task 2",
|
||||
completed = true,
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun saveTask(newTask: Task) {
|
||||
|
|
Reference in a new issue