ajinasokan / flutter_displaymode

A Flutter plugin to set display mode in Android
MIT License
184 stars 22 forks source link

Does flutter support 120 Hz automatically if my system enabled 120 hz? #5

Closed lucasjinreal closed 3 years ago

lucasjinreal commented 4 years ago

Does flutter support 120 Hz automatically if my system enabled 120 hz?

ajinasokan commented 3 years ago

What do you mean by "system"? If you mean your app with this plugin then yes. Otherwise Flutter defaults to the one set by the phone manufacturer.

lucasjinreal commented 3 years ago

@ajinasokan My Phone is Samsung Galaxy S20+, it can set fresh rate to 60hz or 120 hz. However my phone always set to 120hz since it's smoother. But I found all my flutter APP have some animation laggy then native apps. So I don't know it's flutter side doesn't support hight refresh rate or should I manually using this plugin to enable it.

ajinasokan commented 3 years ago

Yes you have to use this plugin to make Flutter apps switch to 120Hz

lucasjinreal commented 3 years ago

@ajinasokan thanks, that make it helpful. May I ask do you know why flutter doesn't support it dynamically based on system settings? In other words, how does native app able to do that while flutter can not?

ajinasokan commented 3 years ago

OS detects somehow an app is native or not. Most likely checking the presence of OpenGL(which is in use by Skia in Flutter). And it drops to 60Hz in that case to reduce battery consumption. It is upto the app to ask the OS to switch it back, which is what this plugin is doing. The discussion is in this issue https://github.com/flutter/flutter/issues/35162

lucasjinreal commented 3 years ago

@ajinasokan Thank u! I will try your plugin to see if it can solve my issue on Samsung Galaxy S 20 + or not