recordAppStartEvent method

  1. @override
Future<void> recordAppStartEvent(
  1. String name,
  2. int epochMs
)
override

Stamps an event onto the in-flight native cold-start app.start span.

epochMs is when the phase actually happened, so callers may record it a little after the fact. Native drops the event once the startup span has ended, so phases must be pushed as they occur rather than batched to first frame — on Android the span closes at the first committed frame.

Defaults to a no-op: platforms without a handler, and test fakes, need no override.

Implementation

@override
Future<void> recordAppStartEvent(String name, int epochMs) async {
  try {
    await startupChannel.invokeMethod('recordAppStartEvent', {
      'name': name,
      'epochMs': epochMs,
    });
  } on MissingPluginException {
    // Platform has no native handler yet — the phase is simply not recorded.
  }
}