'How to use kotlin flow flatMap in Android

In my application I want flatMap operators such as flatMapMerge.
But after write codes show me highlight on flatMapMerge and say add one annotation!
I write below codes :

    private fun myFunction() {
    lifecycleScope.launchWhenCreated {
        flowOf("Nerd", "Subby", "Mord")
            .flatMapMerge { userInfo(it) }
            .collect {
                binding.showInfoText.append("$it \n")
            }
    }
}

Show me below highlight :
enter image description here

When added this annotation : @FlowPreview , then not show this highlight!
But my question is why show this highlight? why I should add this annotation?
What's worked this annotation ?



Solution 1:[1]

why show this highlight?

Flow preview has no backward compatibility guarantees, including both binary and source compatibility

why I should add this annotation?

you are accept/agree on the drawback of relying on preview API. In the document they are mentioned , they collecting the feed backs on this.upcoming release they will fix the issue.

refer FlowPreview

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sasikumar