在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):joreilly/MortyComposeKMM开源软件地址(OpenSource Url):https://github.com/joreilly/MortyComposeKMM开源编程语言(OpenSource Language):Kotlin 79.8%开源软件介绍(OpenSource Introduction):MortyComposeKMMKotlin Multiplatform sample that demonstrates use of GraphQL + Jetpack Compose and SwiftUI (based on https://github.com/Dimillian/MortyUI SwiftUI project). Makes use of Apollo library's Kotlin Multiplatform support and is also included as one of the samples for that project. Related Posts: The project also makes use of Jetpack Compose's Paging library
that allows setting up class CharacterListsViewModel(private val repository: MortyRepository): ViewModel() {
val characters: Flow<PagingData<CharacterDetail>> = Pager(PagingConfig(pageSize = 20)) {
CharactersDataSource(repository)
}.flow
}
@Composable
fun CharactersListView() {
val characterListsViewModel = getViewModel<CharacterListsViewModel>()
val lazyCharacterList = characterListsViewModel.characters.collectAsLazyPagingItems()
LazyColumn {
items(lazyCharacterList) { character ->
character?.let {
CharactersListRowView(character)
}
}
}
} iOS AppA small SwiftUI iOS app that uses same shared Kotlin Multiplatform code is in the |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论