forXifLess / LinkNavigator

🌊 Easy & Powerful navigation library in SwiftUI
Other
382 stars 27 forks source link

DarkMode is not working with sheet and full sheet #35

Closed ngocpd-1250 closed 4 months ago

ngocpd-1250 commented 4 months ago

Could you please download the example code provided below? In SingleBasicApp, I have set preferredColorScheme to dark. I have also created a color asset named primary with custom dark-light mode colors. In Page1, I set the background color to primary. When I open Page1 using navigator.backOrNext(linkItem:..) or navigator.next(linkItem:..), the color appears correctly. However, when I open it using .sheet(linkItem:...) or .fullSheet(linkItem:...), the dark mode does not seem to be working.

Please help me check. Thank you!

LinkNavigator-main.zip

Screenshot: https://github.com/forXifLess/LinkNavigator/assets/49447154/afb93523-c1c2-4e78-9727-b2225eba05f5

interactord commented 4 months ago

Dear @ngocpd-1250 , Thank you so much for actively suggesting the issue. In the case of sheets, if the set value is changed to WindowGroup by force, the corresponding value is not applied to the sheet.

However, when the color scheme is changed in the system, the sheet also changes to dark/light mode accordingly.

If you want to use it forcibly, specify it as a global variable and apply it to all screens such as "RouteBuilder" or "Page."

Record

ngocpd-1250 commented 4 months ago

@interactord I understand, thank you.