profileFrameFromFunction function

ProfileFrame profileFrameFromFunction(
  1. List<ProfileFunction> functions,
  2. int functionIndex
)

Implementation

ProfileFrame profileFrameFromFunction(
  List<ProfileFunction> functions,
  int functionIndex,
) {
  if (functionIndex < 0 || functionIndex >= functions.length) {
    return const ProfileFrame(name: 'unknown', kind: 'unknown', location: null);
  }

  final function = functions[functionIndex];
  return ProfileFrame(
    name: displayNameForFunction(function),
    kind: function.kind ?? 'unknown',
    location: locationForFunction(function),
  );
}