Kotlearn - Kotlin Tutorials
Kotlearn - Kotlin Tutorials
  • 9
  • 3 154
DataStore for Kotlin Multiplatform - Local Preferences (#7)
Learn how to use DataStore in a Kotlin Multiplatform or Compose Multiplatform project to manage local preferences such as user settings. In this episode, we implement DataStore in MinesweeperK to handle preferences to store the username.
Repository
github.com/kotlearn/minesweeperk/tree/06-datastore-preferences
00:00 - Intro and Dependencies
00:25 - Creating the DataStore
01:20 - Creating the Android DataStore
01:51 - Creating the iOS DataStore
02:35 - Creating the Desktop DataStore
03:14 - Initializing Android
03:26 - Initializing iOS
03:35 - Initializing Desktop
03:44 - MinesweeperK Implementation
#composemultiplatform #kotlinmultiplatform #kotlin
Переглядів: 137

Відео

Minesweeper UI with Jetpack Compose (#6)
Переглядів 36221 день тому
Next episode ua-cam.com/video/xGw4p4OWZ6Q/v-deo.html In this video, we create a fully responsive and interactive Minesweeper board, complete with customizable tiles and a dynamic layout. Repository github.com/kotlearn/minesweeperk/tree/05-minesweeper-ui 00:00 - Tile states 03:25 - Tile UI 13:02 - Color scheme 17:27 - Tile borders 28:08 - Minesweeper board #composemultiplatform #kotlinmultiplatf...
Global Padding and Dimensions in Jetpack Compose (#5)
Переглядів 273Місяць тому
Next episode ua-cam.com/video/kaDOKzUk0ys/v-deo.html Learn how to use CompositionLocal in Jetpack Compose to define and apply global padding and dimensions throughout your app. Repository github.com/kotlearn/minesweeperk/tree/04-global-padding 00:00 - Intro 00:08 - What is CompositionLocal? 00:45 - Benefits of CompositionLocal 01:09 - Defining a CompositionLocal 01:31 - Examples 01:58 - Impleme...
Koin Best Practices for Compose Multiplatform (#4)
Переглядів 542Місяць тому
Next episode ua-cam.com/video/rt0YZydHSww/v-deo.html In this video, we set up Koin for dependency injection in our Compose Multiplatform app - MinesweeperK. We explore how each module manages its own dependencies and ties into the larger project using Koin modules. This video should also apply to Kotlin Multiplatform projects that aren't using Compose Multiplatform. Repository github.com/kotlea...
How to Structure a Clean, Multi-Module Compose Multiplatform App (#3)
Переглядів 461Місяць тому
Next episode ua-cam.com/video/goZc6U-KRew/v-deo.html Learn how to build a clean, multi-module architecture in Compose Multiplatform! In this video, we’ll explain the purpose of each module layer-app, feature, UI, domain, and data-and how they interact. You’ll see how structuring your project this way improves scalability, maintainability, and builds a solid foundation for a Compose Multiplatfor...
Setting Up a Compose Multiplatform Project: Project Creation and Dependencies (#2)
Переглядів 261Місяць тому
Next episode ua-cam.com/video/D_SIknHwIIw/v-deo.html In this video, we kick off the MinesweeperK series by setting up a Compose Multiplatform project from scratch. By the end of this video, you’ll have a fully set up project ready for cross-platform development with Compose Multiplatform. Stay tuned for the next episode, where we’ll dive into creating a clean multi-module architecture. Reposito...
Compose Multiplatform Crash Course Building Minesweeper | Introduction to the Series (#1)
Переглядів 8402 місяці тому
Next episode ua-cam.com/video/ND1QTnafqlg/v-deo.html In this series, I'll be guiding you step-by-step to build a fully functional version of Minesweeper that can run on Android, iOS, and desktop platforms. By the end, you'll have a versatile Compose Multiplatform app that’s structured for real-world, cross-platform development. This project uses: Compose Multiplatform Navigation Component for C...
Share TopAppBar Across Screens with Full Control - Jetpack Compose and Compose Multiplatform
Переглядів 1713 місяці тому
Today we’re covering how you can share a TopAppBar across multiple screens using a Scaffold with Compose. This is a useful pattern for building consistent UI across your app and this video shows 2 ways to implement it. Although this is done in a Kotlin Multiplatform project using compose, the same principles apply for implementing this in a standard Android project with Jetpack Compose. GitHub ...

КОМЕНТАРІ

  • @charr0max686
    @charr0max686 2 дні тому

    great stuff, i will be using this Storage interface in my own projects! also I modified the ViewModel username state in this way (got it from philipp lackner and loved the code) : val userName: StateFlow<String> = getUserNameAsFlow() .stateIn( viewModelScope, SharingStarted.WhileSubscribed(5000L), "" // Valor inicial del flujo ) fun save(name: String) = viewModelScope.launch { updateUserName(name) } this requires a LaunchedEffect screen-side to react to the username change and update the text: val userName by viewModel.userName.collectAsStateWithLifecycle() var newName by remember { mutableStateOf(userName) } LaunchedEffect(userName) { newName = userName } what do you think? anyway thank you for taking the time to do this, not a lot of good kmm/cmp tutorials out there

  • @prashlovessamosa
    @prashlovessamosa 2 дні тому

    thanks

  • @yurikayel6246
    @yurikayel6246 3 дні тому

    Nice!

  • @yurikayel6246
    @yurikayel6246 3 дні тому

    Nice work 😊

  • @neyasbit
    @neyasbit 4 дні тому

    nice practice for using the datastore. 👍

  • @AM-tv2fs
    @AM-tv2fs 4 дні тому

    lets goo! was really waiting for this. thank you!

  • @BossFlight
    @BossFlight 17 днів тому

    I think It is interesting to learn coding and langauge concepts based of a game, but the amount of boilerplate code and class design is overwhelming, specially when compared to a 80 lines of code (yes, just eighty lines ) Javascript version of Minesweeper I found in a simple websearch. It is a very minimalist version but It is kind of shocking nonetheless

  • @BHARATGARANDE
    @BHARATGARANDE 18 днів тому

    Great Sir .. Waiting for next one..

  • @neyasbit
    @neyasbit 19 днів тому

    I like this UI, nice design

  • @neyasbit
    @neyasbit 20 днів тому

    In order for the Shared Module creation item to appear, you need to enable Settings -> Advanced Settings -> Kotlin -> Enable Experimental Multiplatform IDE features. But I also prefer to do it manually.

    • @Kotlearn
      @Kotlearn 20 днів тому

      Ah that's good to know thank you!

  • @neyasbit
    @neyasbit 20 днів тому

    i have waiting it!

  • @neyasbit
    @neyasbit 20 днів тому

    You are great! 🔥

  • @charr0max686
    @charr0max686 23 дні тому

    TIL how to draw vectors using code, thank you for all your effort

  • @charr0max686
    @charr0max686 23 дні тому

    Thank you for this series, it's by far the most comprehensive i've seen on KMM on here

    • @Kotlearn
      @Kotlearn 22 дні тому

      I'm glad you're enjoying it :D. It's my first time creating something like this but I'm enjoying it a lot so will most likely create more after I've wrapped this one up.

  • @eonarma
    @eonarma 24 дні тому

    Thank you for the video! great content!

  • @AM-tv2fs
    @AM-tv2fs 24 дні тому

    have you considered making the navigation into a separate module? im following along but making a few changes, hopefully I dont break anything xDD. I like experimenting. thank you again for this amazing videos. really excited to keep learning.

    • @Kotlearn
      @Kotlearn 22 дні тому

      Yes, but you need to be careful creating a separate module for navigation. I'm not sure what your plan for which modules depend on which, but try to think of your app (composeApp) module as the module that coordinates the navigation between your features. The only way I'd recommend having a navigation module is if only the app module depends on it. The most important thing to NOT do, is have your feature modules depending on your navigation module. Try to build your feature modules as something that can be easily placed into another app that may require that feature. That being said, it's always worth experimenting yourself as I believe that's the best way to learn what works well for you. You can always view other samples in the future to see what's common practice.

  • @AM-tv2fs
    @AM-tv2fs 26 днів тому

    thank you for showing how to manually build a module. In a different course I had to do a mess downloading plugins or trying with unstable versions of android studio to get the KMP module option.

    • @Kotlearn
      @Kotlearn 26 днів тому

      No problem. I think it's important to know how to create them manually exactly for that reason.

  • @AM-tv2fs
    @AM-tv2fs 28 днів тому

    just found your channel, great conent. im taking the journey of learning kotlin on my own and content like this is super singhtful and apreciated.

  • @krystianchalimoniuk434
    @krystianchalimoniuk434 Місяць тому

    Very nice tutorial about modularization, looking forward for next episodes. I'd love to see some custom gradle plugins implementation to not copy all that code to every build.gradle.kts file.

    • @Kotlearn
      @Kotlearn Місяць тому

      Thank you, glad you're enjoying them! In practice, it's never felt that tedious to do as modules are rarely ever all created at the same time as we've done in this series. It's something I wanted to fully set up at the start so that it won't take time out of future episodes.

  • @ubersticks
    @ubersticks Місяць тому

    You went from using the KMP Wizard to do a new project, added dependencies to lib.versions.toml and compose app build.gradle (which was fine) then all of a sudden features/ and is populated with build.gradles. This makes it hard to follow and definitely not showing how to do this myself on a new project...

    • @Kotlearn
      @Kotlearn Місяць тому

      You're probably right. I'll have more of a think about how I'm structuring these episodes. Just to give you some context, this is for a project that I've already built so I have the benefit of already knowing everything that I need. That probably is resulting in me not rebuilding this in a natural way. Is there a specific part you struggled to follow? I can hopefully add any additional info/help into a pinned comment. This is my first time ever making tutorials of YT videos so I'm still learning 😅

    • @ubersticks
      @ubersticks Місяць тому

      Are you sure that the videos in the play list are in the correct order? Putting 1, 2, 3... in the title is recommended

    • @Kotlearn
      @Kotlearn 22 дні тому

      You were correct, I had the playlist ordered the wrong way round 😅. I've also added numbers to the titles and fixed the suggested video at the end of each episode.

  • @LeonardoMorales08
    @LeonardoMorales08 Місяць тому

    Thanks for the KMP tutorials!

    • @Kotlearn
      @Kotlearn Місяць тому

      No problem! Thanks for watching 😁

  • @tatavarthitarun2739
    @tatavarthitarun2739 Місяць тому

    Thank you for doing it in Multiple Module

    • @Kotlearn
      @Kotlearn Місяць тому

      No problem, just let me know if there's anything specific you'd like to see in this series 🙂

    • @LeonardoMorales08
      @LeonardoMorales08 Місяць тому

      @@Kotlearn It would be incredible to see a KMP multiplayer game with Ktor and WebSocket

    • @Kotlearn
      @Kotlearn Місяць тому

      I'm planning on recording building chess with ktor and websockets after this series. It may be a while but I'll start this some time in January 🙂

    • @craig5832
      @craig5832 Місяць тому

      @@Kotlearn I think it would be good to do a chess game with ktor

  • @neyasbit
    @neyasbit Місяць тому

    intresting 🔥