package Ġcom . al mar ai . eas yp ick . data _ source . web . implementation Ċ Ċ import Ġcom . al mar ai . data . easy _ pick _ models . statistics . Statistics Ċ import Ġcom . al mar ai . eas yp ick . data _ source . interfaces . Statistics DataSource Ċ import Ġcom . al mar ai . eas yp ick . data _ source . web . WebService Ċ import Ġkotlinx . coroutines . flow . Mutable State Flow Ċ import Ġkotlinx . coroutines . flow . State Flow Ċ import Ġjavax . inject . Inject Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Singleton Ċ class ĠWeb Statistics DataSource Implementation Ġ@ Inject Ġconstructor ( private Ġval Ġweb Service : ĠWeb Service ) Ġ: ĊĠĠĠ ĠStatistics DataSource Ġ{ ĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġget Statistics ( ĊĠĠĠĠĠĠĠ Ġdep ot Code : ĠInt , ĊĠĠĠĠĠĠĠ Ġfrom Date : ĠLong , ĊĠĠĠĠĠĠĠ Ġto Date : ĠLong ĊĠĠĠ Ġ): ĠState Flow < Statistics > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġflow : ĠMutable State Flow < Statistics > Ġ= ĠMutable State Flow ( Statistics ( 0 , ĠlistOf ())) ĊĊĠĠĠĠĠĠĠ Ġval Ġstats Ġ= Ġweb Service . statistics Api . get Statistics ( from Date , Ġto Date ) ĊĊĠĠĠĠĠĠĠ Ġflow . value Ġ= Ġstats ĊĊĠĠĠĠĠĠĠ Ġreturn Ġflow ĊĠĠĠ Ġ} Ċ }