StateFlowはSharedFlowのサブクラス StateFlowは、SharedFlowのいくつかのパラメータを固定したサブクラスです。kotlinlang.orgに、StateFlowの内部動作を説明したソースコードが掲載されているので引用します。 // MutableStateFlow(initialValue) is a shared flow with the following parameters: val shared = MutableSharedFlow( replay = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST ) shared.tryEmit(initialValue) // emit the initial value val state = shared.distinctUntilChanged()