inlay_compose 0.1.1 copy "inlay_compose: ^0.1.1" to clipboard
inlay_compose: ^0.1.1 copied to clipboard

PlatformAndroid

Optional Jetpack Compose integration for the inlay framework - embed inlay Flutter screens directly into Compose navigation graphs. Android-only.

example/README.md

inlay_compose example #

Embedding inlay Flutter screens and dialogs in a Jetpack Compose host. For a complete, runnable Compose host see ComposeActivity.kt in the example Android app.

Add the package next to inlay in your Flutter module's pubspec.yaml:

dependencies:
  inlay: ^0.1.1
  inlay_compose: ^0.1.1

Embed a Flutter screen as a Compose destination #

import co.leancode.inlay.compose.InlayFlutterScreen

NavHost(navController, startDestination = "home") {
    composable("home") { HomeScreen() }

    composable("counter") {
        InlayFlutterScreen(
            route = CounterPage(seed = null),
            modifier = Modifier.fillMaxSize(),
            onResult = { count ->
                // count: Long? — the typed result the page popped with.
            },
        )
    }
}

Show a Flutter dialog, state-driven #

import co.leancode.inlay.compose.InlayFlutterDialog

var showDialog by remember { mutableStateOf(false) }

Button(onClick = { showDialog = true }) { Text("Delete") }

InlayFlutterDialog(
    isPresented = showDialog,
    route = ConfirmDeleteDialog(itemId = "42"),
    onDismissRequest = { showDialog = false },
    onResult = { confirmed ->
        // confirmed: Boolean? — already decoded.
    },
)

See the navigation guide for the full Compose integration.

1
likes
160
points
174
downloads

Documentation

API reference

Publisher

verified publisherleancode.co

Weekly Downloads

Optional Jetpack Compose integration for the inlay framework - embed inlay Flutter screens directly into Compose navigation graphs. Android-only.

Repository (GitHub)
View/report issues

Topics

#add-to-app #navigation #flutter-module #codegen #state

License

Apache-2.0 (license)

Dependencies

flutter, inlay

More

Packages that depend on inlay_compose

Packages that implement inlay_compose