Added docs to `FrameCallback` and `FrameData`
This commit is contained in:
Todd Volkert
2024-10-01 22:08:04 -07:00
committed by GitHub
parent c41cce147f
commit 7b84f908ec
2 changed files with 15 additions and 0 deletions

View File

@@ -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].

View File

@@ -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});