package Ġcom . max im erous sy . trend hub . presentation Ċ Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġjavax . inject . Inject Ċ import Ġdagger . Lazy Ċ Ċ class ĠViewModel Factory < T Ġ: ĠViewModel > Ġ@ Inject Ġconstructor ( private Ġval ĠviewModel : ĠLazy < T >) Ġ: ĠViewModel Provider . Factory Ġ{ ĊĠ Ġ@ Suppress (" UN CHECK ED _ CAST ") ĊĠ Ġoverride Ġfun Ġ< T Ġ: ĠViewModel ?> Ġcreate ( model Class : ĠClass < T >): ĠT Ġ= ĠviewModel . get () Ġas ĠT Ċ } Ċ