markTimeToDisplay method

  1. @override
Future<void> markTimeToDisplay({
  1. String reason = 'flutter_first_frame',
})
override

Signals native that the app has reached its first meaningful display (Time-To-Initial / Time-To-Full Display), closing the native app.start span so it can be emitted.

On iOS the native SDK detects display via UIKit view-controller / CADisplayLink signals, which never fire for Flutter's engine-rendered UI (a single FlutterViewController). Dart must therefore mark this explicitly on the first frame, otherwise the span only closes via the native 10s fallback timeout (as a mislabeled "warm/suspended" span).

Implementation

@override
Future<void> markTimeToDisplay({
  String reason = 'flutter_first_frame',
}) async {
  try {
    await startupChannel.invokeMethod('markTimeToDisplay', {'reason': reason});
  } on MissingPluginException {
    // Platforms that derive app-start display timing natively (e.g. Android)
    // do not implement this method — no Dart-driven marker is needed there.
  }
}