Control status bar color dynamically without unwanted theme change effects

In the following simplified app I want to change the status bar color from default black to white (the main iPhone theme is light) but nothing else. I'm partly succeeded doing so, but the theme of keyboard is wrong: when it is first appeared it is good (light) and as soon as i start typing it changes itself to unwanted dark. Is there a way to change just the status bar color but nothing else? Note that I want the status bar color be dynamic - sometimes white, sometimes black depending upon what the app is doing.

import SwiftUI

struct ContentView: View {
    @State var string = "Hello, World"

    var body: some View {
        TextField("EditableText", text: $string)
            .font(.largeTitle)
            .frame(maxHeight: 1000)
            .navigationTitle("Hello, World")
            .background(
                Color(red: 1, green: 0.7, blue: 0.7, opacity: 1)
            )
            .colorScheme(.light) // attempt to "undo" the effect
            .preferredColorScheme(.dark)
    }
}

@main struct NavBarTestApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

PS. I don't mind dropping to UIKit for status bar handling if it is not possible to do it in SwiftUI. The rest of app itself is SwiftUI and it is quite big, here I am showing a stripped down version.