Toggle works in a way that it connects to some True/False property directly and changes the value of this property immediately.
And then you can have a conditional visibility based on this True/False property
If you would like to do it without having any DB collection’s property involded, then it’s a different story.
As a workaround - you can create an auxiliary input field (and hide it). Then you change its value with some imitation of toggle (see here for example Small hints: Toggle Imitation)
And along with changing toggle imitations’ visibility, you can change the text field visibility.
Hope this helps.