package Ġcom . e gor iku . lad y happy . post creator . data . remote Ċ Ċ import Ġcom . e gor iku . lad y happy . core . IF ire base Ċ import Ġcom . e gor iku . lad y happy . network . firestore . await ImageUrl Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . with Context Ċ Ċ private Ġconst Ġval ĠSTORAGE _ CHILD Ġ= Ġ" List All H ats / 2 0 2 0 /" Ċ Ċ class ĠUpload Post Image Repository ( firebase : ĠIF ire base ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġreference Ġ= Ġfirebase . firebase Storage . reference ĊĊĠĠĠ Ġsuspend Ġfun Ġupload ( fileName : ĠString , Ġbytes : ĠByteArray ): ĠString Ġ= Ġwith Context ( Dispatch ers . IO ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwith ( reference . child ( STORAGE _ CHILD Ġ+ ĠfileName )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġput Bytes ( bytes ). await ImageUrl ( this ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }