Hello team, I was wondering if we could find a wo...
# general-advice
j
Hello team, I was wondering if we could find a workaround, since the package-private concept isn’t supported in Kotlin. In Jetpack Compose, I have a Composable function that’s about 1,000 lines long. I’d like to extract some of its components into separate files so they’re easier to find within the package, rather than scrolling through the entire file to locate specific functions. Extracting them into a separate module feels like overkill — they’re already part of a cohesive feature module. I just don’t want those extracted components to be public. I’ve seen some workarounds, such as creating a custom lint rule, but I hope we can consider an official approach for this.
s
It either has to be part of some separate module which holds such UI components for you. Or make them private in the file which contains that one composable if it is the only one that needs to use them in the first place.
h
It's currently the third most voted issue on YouTrack and they're doing nothing about it. Workarounds are using huge files and making a lot of stuff public. Make sure to keep voting for this issue and tell them in each and every developer survey...
❤️ 1
s
Is
internal
not a good replacement?