package Ġcom . than os fish er man . presentation . viewModel Ċ Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . as LiveData Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . than os fish er man . domain . use case . Exchange UseCase Ċ import Ġcom . than os fish er man . domain . enums . Pad Type Ċ import Ġcom . than os fish er man . domain . use case . Calculate UseCase Ċ import Ġkotlinx . coroutines . Experimental Cor outines Api Ċ import Ġkotlinx . coroutines . Flow Preview Ċ import Ġkotlinx . coroutines . flow . as Flow Ċ Ċ @ Flow Preview Ċ @ Experimental Cor outines Api Ċ class ĠMain ViewModel ( private Ġval Ġcalculate UseCase : ĠCalculate UseCase , Ġprivate Ġval Ġexchange UseCase : ĠExchange UseCase ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġval Ġlive Calculate State Result Ġ= Ġcalculate UseCase . channel Result . as Flow (). as LiveData () ĊĠĠĠ Ġval Ġlive Network State Result Ġ= Ġexchange UseCase . channel Result . as Flow (). as LiveData () ĊĊĠĠĠ Ġfun Ġadd Expression ( pad Type : ĠPad Type ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcalculate UseCase ( viewModel Scope , Ġpad Type ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġexchange ( from Symbol : ĠString , Ġto Symbol : ĠString , Ġamount : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġexchange UseCase ( viewModel Scope , ĠlistOf ( from Symbol , Ġto Symbol , Ġamount )) ĊĠĠĠ Ġ} Ċ }