package Ġcom . no 1 . ta iw an . new sb asket . widget . view model Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . ViewModel Provider . Android ViewModel Factory Ċ Ċ /** Ċ Ġ* ĠA Ġfactory Ġfor Ġcreating Ġa Ġmap Ġto Ġstore Ġa Ġrelated Ġ[ ViewModel ]' s Ġtag Ġand Ġthe Ġ[ ViewModel ]. Ċ Ġ*/ Ċ class ĠViewModel Factory ( ĊĠĠĠ Ġapplication : ĠApplication , ĊĠĠĠ Ġprivate Ġval Ġview Models : ĠLook Up ViewModel Ċ ) Ġ: ĠAndroid ViewModel Factory ( application ) Ġ{ ĊĠĠĠ Ġ@ Suppress (" UN CHECK ED _ CAST ") ĊĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel > Ġcreate ( model Class : ĠClass < T >) Ġ= Ġview Models [ model Class ] Ġas ĠT Ċ } Ċ