package Ġopen food facts . github . scr ach x . open food . features . product . view . photos Ċ Ċ import Ġandroidx . lifecycle . Saved State Handle Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . as Flow Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġdagger . h ilt . android . lifecycle . H ilt ViewModel Ċ import Ġkotlinx . coroutines . flow . Sharing Started Ċ import Ġkotlinx . coroutines . flow . filter NotNull Ċ import Ġkotlinx . coroutines . flow . map Ċ import Ġkotlinx . coroutines . flow . state In Ċ import Ġopen food facts . github . scr ach x . open food . features . product . edit . Product Edit Activity Ċ import Ġopen food facts . github . scr ach x . open food . images . extract Images Name Sorted By Upload Time Desc Ċ import Ġopen food facts . github . scr ach x . open food . models . Product State Ċ import Ġopen food facts . github . scr ach x . open food . network . services . Products API Ċ import Ġjavax . inject . Inject Ċ Ċ @ H ilt ViewModel Ċ class ĠProduct Photos ViewModel Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġproducts API : ĠProducts API , ĊĠĠĠ Ġsaved State Handle : ĠSaved State Handle Ċ ) Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġproduct State Ġ= Ġsaved State Handle . get LiveData < Product State >( Product Edit Activity . KEY _ STATE ). as Flow () ĊĊĠĠĠ Ġval Ġimage Names Ġ= Ġproduct State ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġit . product Ġ} ĊĠĠĠĠĠĠĠ Ġ. filter NotNull () ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġproduct Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġproducts API . get Product Images ( product . code ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. extract Images Name Sorted By Upload Time Desc () ĊĠĠĠĠĠĠĠ Ġ}. state In ( viewModel Scope , ĠSh aring Started . While Sub scribed (), Ġempty List ()) Ċ } Ċ