Aug 4, 2022
It seems ok to me. The viewLifecycleOwner's coroutine scope lives between onCreateView and onDestroyView. (Whereas the lifecycle owner's scope lives between onCreate and onDestroy, but that's unrelated to this comment.)
flowWithLifecycle will start and stop observing the flow as the lifecycle goes above or below the min active state, which will always be higher than or equal to the scope's outer boundaries.