This works well, although there is a few seconds delay of freezing and black screen.
One of the most popular issues is when the user is using the app (text editing) and then they toggle dark mode from the status bar, not necessarily leaving the app, causing the app to lose context in native or restart in Flutter.
This isn't an issue on all other platforms including iOS, and it's heavily used by many users.
I guess one of the solutions is to add a dark mode button that is visible all the time inside the app.
Android delays dark mode if enabled automatically after locking the screen.