package Ġcom . example . my application . room . Repository Ċ Ċ import Ġandroidx . annotation . Worker Thread Ċ import Ġcom . example . my application . room . Dao . UserInfo Dao Ċ import Ġcom . example . my application . room . Entity . UserInfo Ċ import Ġjava . util . concurrent . Flow Ċ Ċ class ĠUserInfo Repository ( private Ġval ĠuserInfo Dao : UserInfo Dao ) Ġ{ Ċ fun Ġlogin ( userName : String ) Ġ: Ġkotlinx . coroutines . flow . Flow < UserInfo > Ġ{ ĊĠĠĠ Ġval ĠuserInfo Ġ= ĠuserInfo Dao . getUser Info By UserName ( userName ) ĊĠĠĠ Ġreturn ĠuserInfo Ċ } ĊĠĠĠ Ġ@ Suppress (" Red undant Suspend Modifier ") ĊĠĠĠ Ġ@ Worker Thread ĊĠĠĠ Ġsuspend Ġfun Ġregister ( userInfo : UserInfo ){ ĊĠĠĠĠĠĠĠ ĠuserInfo Dao . insert ( userInfo ) ĊĠĠĠ Ġ} Ċ }