From 7b84f908ec83602990ec057337d37ed471115645 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Tue, 1 Oct 2024 22:08:04 -0700 Subject: [PATCH] Added Dart docs (flutter/engine#54506) Added docs to `FrameCallback` and `FrameData` --- engine/src/flutter/lib/ui/platform_dispatcher.dart | 8 ++++++++ engine/src/flutter/lib/ui/window.dart | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/engine/src/flutter/lib/ui/platform_dispatcher.dart b/engine/src/flutter/lib/ui/platform_dispatcher.dart index 4594a3969a..db59d220f1 100644 --- a/engine/src/flutter/lib/ui/platform_dispatcher.dart +++ b/engine/src/flutter/lib/ui/platform_dispatcher.dart @@ -7,6 +7,14 @@ part of dart.ui; typedef VoidCallback = void Function(); /// Signature for [PlatformDispatcher.onBeginFrame]. +/// +/// The `duration` argument is the point at which the current frame interval +/// began, expressed as a duration since some epoch. The epoch in all +/// frames will be the same, but it may not match [DateTime]'s epoch. +/// +/// For any two frames `a` and `b` such that the frame number of `a` is less +/// than the frame number of `b`, the duration argument for `a` will be less +/// than or equal to the duration argument for `b`. typedef FrameCallback = void Function(Duration duration); /// Signature for [PlatformDispatcher.onReportTimings]. diff --git a/engine/src/flutter/lib/ui/window.dart b/engine/src/flutter/lib/ui/window.dart index 6bb26674b6..229022b0fb 100644 --- a/engine/src/flutter/lib/ui/window.dart +++ b/engine/src/flutter/lib/ui/window.dart @@ -1059,6 +1059,13 @@ enum Brightness { final SingletonFlutterWindow window = SingletonFlutterWindow._(); /// Additional data available on each flutter frame. +/// +/// See also: +/// +/// * [Window.frameData] and [PlatformDispatcher.frameData], which expose the +/// frame data for the current frame. +/// * [PlatformDispatcher.onFrameDataChanged], which notifies listeners when +/// a window's frame data has changed. class FrameData { const FrameData._({this.frameNumber = -1});