Skip to content

Add an option for Apps to set a preferred refresh rate for variable refresh rate devices.  #119268

@cyanglaz

Description

@cyanglaz

Add a dart:ui API to set the preferred refresh rate.

Currently On iOS, if the device is a pro-motion device, Flutter engine sets the refresh rate to 120fps. This drains unnecessary batteries when the app is idle or performing a low-impact animations (a small spinner widget etc).

This issue propose below changes to the current behavior.

  1. Lower the refresh rate to 60fps as it satisfies most non-high-impact animations.
  2. Add a dart:ui API to allow Apps to bump the refresh rate to 80 or 120 as they see fit.
  3. Call this API in certain default Flutter widgets to take advantage of high refresh rates during high-impact animations (scrolling, page transition etc)

Above iOS 15, the preferred refresh rate is set as a range: (minimum, preferred, max)
Below iOS 15, one can only set a single value as preferred refresh rate.

The dart:UI API should be something like:
setPreferredRefreshRate(RefreshRateRange rate)
The object RefreshRateRange should contain 3 values, minimum, preferred, max. Below iOS 15, only preferred is used.

Another option is to have the default stay in 120fps, App can choose to lower the refresh rate (using the provided dart:ui API) to 60 if they need to preserve battery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions