Last active
November 10, 2023 19:25
-
-
Save AzizaHelmy/4354c01fcab8f789bfe978f13355fb3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package presentation.meals | |
class MealsScreen(private val cuisineId: String, private val cuisineName: String) : | |
BaseScreen<MealsScreenModel, MealsUiState, MealsUiEffect, MealsInteractionListener>() { | |
@Composable | |
override fun Content() { | |
initScreen(getScreenModel { parametersOf(cuisineId, cuisineName) }) | |
} | |
@OptIn(ExperimentalResourceApi::class) | |
@Composable | |
private fun content( | |
state: MealsUiState, | |
onMealSelected: (MealUIState) -> Unit, | |
onBackClicked: () -> Unit, | |
) { | |
val meals = state.meals.collectAsLazyPagingItems() | |
Column( | |
Modifier.fillMaxSize().background(Theme.colors.background).padding( | |
getNavigationBarPadding() | |
) | |
) { | |
... | |
BpPagingList(data = meals) { meal -> | |
meal?.let { | |
MealCard( | |
meal = it, | |
modifier = Modifier.noRippleEffect { onMealSelected(it) } | |
) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment