package Ġcom . nw ag u . chess boy . shared models . presentation Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroid . widget . Toast Ċ import Ġandroidx . core . content . Context Compat Ċ import Ġandroidx . lifecycle . Android ViewModel Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . nw ag u . chess boy . shared models . Che ss Application Ċ import Ġcom . nw ag u . chess boy . shared models . data . Database Driver Factory Ċ import Ġcom . nw ag u . chess boy . shared models . data . Local Games History Repository Ċ import Ġkotlinx . coroutines . Coroutine Scope Ċ Ċ actual Ġopen Ġclass ĠBase ViewModel : ĠAndroid ViewModel Ġ{ ĊĊĠĠĠ Ġactual Ġconstructor (): Ġthis ( Che ss Application . context !! ) ĊĠĠĠ Ġconstructor ( application : ĠApplication ): Ġsuper ( application ) ĊĊĠĠĠ Ġactual Ġval Ġclient Scope : ĠCor outine Scope Ġ= ĠviewModel Scope ĊĠĠĠ Ġactual Ġval Ġgames History Repository Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠLocal Games History Repository ( Database Driver Factory ( getApplication ())) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġactual Ġoverride Ġfun Ġon Cle ared () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Cle ared () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġactual Ġfun Ġshow Toast ( message : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠContext Compat . get Main Executor ( getApplication ()). execute Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠToast . makeText ( getApplication (), Ġmessage , ĠToast . LENGTH _ LONG ). show () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }