fuseComponent<C extends Fuse> function

C fuseComponent<C extends Fuse>()

Returns the current Flame component.

Implementation

C fuseComponent<C extends Fuse>() {
  final component = Zone.current[#component];

  assert(
    component != null,
    'Fuses must be called inside the `fuse` method.',
  );

  assert(
    component is C,
    'This fuse requires a Flame component of type `$C`.',
  );

  return component as C;
}