Skip to content

Conversation

@doTTTTT
Copy link
Contributor

@doTTTTT doTTTTT commented Sep 3, 2025

No description provided.

@doTTTTT doTTTTT requested a review from florent37 September 3, 2025 07:42
@doTTTTT doTTTTT self-assigned this Sep 3, 2025
@doTTTTT doTTTTT added the enhancement New feature or request label Sep 3, 2025
@@ -0,0 +1,16 @@
package io.github.openflocon.navigation

class FloconNavigationState internal constructor() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please :

  1. split into interface/impl
interface FloconNavigationState {
    val stack: State<List<FloconRoute>>

    fun navigate(route: FloconRoute)

    fun back(count: Int = 1)
}
  1. use a mutable state & collect
    // not sure mutableStateListOf exists, maybe mutableStateOf<List>(
class FloconNavigationState internal constructor() {

    private val _stack = mutableStateListOf<FloconRoute>(LoadingRoute)
    val stack: State<List<FloconRoute>> = _stack

    fun navigate(route: FloconRoute) {
        _stack.add(route)
    }

    fun back(count: Int = 1) {
        repeat(count) { _stack.removeLast() }
    }

}
val stack by navigationState.stack

@doTTTTT doTTTTT linked an issue Oct 15, 2025 that may be closed by this pull request
@doTTTTT doTTTTT requested a review from florent37 October 29, 2025 19:01
@doTTTTT doTTTTT marked this pull request as ready for review November 3, 2025 14:19
@doTTTTT
Copy link
Contributor Author

doTTTTT commented Nov 3, 2025

@florent37 I'll migrate progressively other screen to use nav3. Otherwise this PR will be to big

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Navigation3

3 participants