package Ġcom . example . recipe app . model . database Ċ Ċ import Ġandroidx . annotation . Worker Thread Ċ import Ġcom . example . recipe app . model . entities . Fav D ish Ċ import Ġkotlinx . coroutines . flow . Flow ĊĊ Ċ class ĠF av D ish Repository ( private Ġval Ġfav D ish Dao : ĠF av D ish Dao ) Ġ{ ĊĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġsuspend Ġfun Ġinsert Fav D ish Data ( fav D ish : ĠF av D ish ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfav D ish Dao . insert Fav D ish Details ( fav D ish ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġall Dis hes List : ĠFlow < List < Fav D ish >> Ġ= Ġfav D ish Dao . getAll Dis hes List () ĊĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġsuspend Ġfun Ġupdate Fav D ish Data ( fav D ish : ĠF av D ish ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfav D ish Dao . update Fav D ish Details ( fav D ish ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġfavorite Dis hes : ĠFlow < List < Fav D ish >> Ġ= Ġfav D ish Dao . get Favorite Dis hes List () ĊĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġsuspend Ġfun Ġdelete Fav D ish Data ( fav D ish : ĠF av D ish ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfav D ish Dao . delete Fav D ish ( fav D ish ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġfilter edList Dis hes ( value : ĠString ): ĠFlow < List < Fav D ish >> Ġ= ĊĠĠĠĠĠĠĠ Ġfav D ish Dao . get Filtered Dis hes List ( value ) Ċ }