composablehorizons / compose-examples

This repository it used to keep track of user feedback, issues and suggestions for https://composablesui.com
https://composablesui.com
10 stars 0 forks source link

[Component: Profile Details Screens] Expecting a top level declaration in IntelliJ #8

Closed javac9 closed 2 months ago

javac9 commented 2 months ago

I want to use the Profile Details Screens component. However, IntelliJ is complaining related to this spot in code:

that "Expecting a top level declaration in IntelliJ" and the red squiggly lines are shown for each line of that block.

EDIT from Alex: Removed the code as it's part of a paid component

alexstyl commented 2 months ago

Are you using the Material Compose dependency in your project?

javac9 commented 2 months ago

I do, I'm using some other components without any issues. Try pasting this component yourself - the Scaffold appears to be outside a composable function.

alexstyl commented 2 months ago

I see what you mean. it is indeed outside a composable function. no component example in composablesui.com is inside a composable function.

you would need to place them inside your own screen composable

javac9 commented 2 months ago

Thanks, I just found it out as well and came here to close the issue.