capsule top-level constant

Shorthand for a fully formed capsule.

Basic usage:

final countPlusOneCapsule = capsule((use) {
  return use(countCapsule) + 1;
});

Warning

Although capsule is convenient, source code created with it loses explicitly written type information. For that reason, it is strongly recommended to use capsule as such:

final Capsule<int> countPlusOneCapsule = capsule((use) {
  return use(countCapsule) + 1;
});

Implementation

const capsule = CapsuleCreationConvenience._();