refresh_rate 1.0.1
refresh_rate: ^1.0.1 copied to clipboard
Unlock 90/120/144Hz on Android, iOS & desktop. Query display rates, control refresh, benchmark FPS with live debug overlays. Uses modern platform APIs.
Changelog #
1.0.1 #
Web support #
- Added web platform implementation using
requestAnimationFrameinterval timing to detect the display's current refresh rate (same technique as TestUFO). - Control methods are graceful no-ops (browsers own vsync scheduling).
- FPS overlay and benchmark sessions work unchanged on web.
Documentation #
- Added comprehensive Dartdoc comments to all public APIs.
Platform fixes #
- Restructured
Package.swiftintoios/refresh_rate/andmacos/refresh_rate/for correct Swift Package Manager module resolution. - Resolved minor lint warnings from test suites.
1.0.0 #
Initial stable release — unlock, query, overlay, and benchmark display refresh rates across all Flutter platforms.
Control #
RefreshRate.enable()— one-line unlock of peak display refresh rateRefreshRate.preferMax()/preferDefault()— explicit rate preferenceRefreshRate.matchContent(fps)— sync display cadence to content frame rate (fixes 24 fps video judder)RefreshRate.boost(duration)— temporary max-rate spike for gesture-driven animationsRefreshRate.category(RateCategory)— Android 15 semantic rate categoryRefreshRate.setTouchBoost(bool)— Android 15 touch-driven rate boost
Diagnostics #
RefreshRate.info— synchronous cachedRefreshRateInfosnapshot (current rate, max, min, supported rates, VRR, API level)RefreshRate.onChanged— stream fires on rate change, Low Power Mode toggle, or thermal state changeRefreshRate.isLowPowerMode/thermalState/isProMotionReady
Debug overlay #
RefreshRate.showOverlay()— full diagnostic HUD with live FPS, build/raster timings, frame budgetRefreshRate.showFPS()/showHz()— individual overlay badges- FPS colour is relative to the device's actual target rate, not a hard-coded 60 Hz baseline
Benchmark sessions #
RefreshRate.startSession(name)returnsRefreshRateSessionsession.end()returnsSessionReportwith verdict, bottleneck, avgFps, 1% low FPS, missed-frame %, and JSON export- Sessions auto-exclude backgrounded periods, resume warmup, LPM changes, and thermal changes
Platform coverage #
- Android 6+ (API 23):
SurfaceControl.Transaction.setFrameRate()(API 34+),preferredRefreshRate+preferredDisplayModeId(API 30–33), legacypreferredDisplayModeIdfallback (API 23–29) - iOS 15+:
CADisplayLink.preferredFrameRateRangewith runtimeInfo.plistProMotion validation - macOS 14+:
CADisplayLink-based control viaNSView.displayLink - macOS < 14 / Windows / Linux: query-only (reports real monitor refresh rate)
- All platform bridges use pigeon — fully typed, zero codec overhead
