record method Null safety

Widget record(
  1. Widget child,
  2. {Key? key,
  3. bool recording = true}

Returns a widget that renders a widget in a box that can be recorded.

The returned widget wraps child in a box with a fixed size specified by frameSize. The key is also applied to the returned widget.

The frame is only recorded if the recording argument is true, or during a procedure that is wrapped within recording. In either case, the painted result of each frame will be stored and later available for display. If neither condition is met, the frames are not recorded, which is useful during setup phases.

The child must not be null.

See also:


Widget record(Widget child, {
  Key? key,
  bool recording = true,
}) {
  assert(child != null);
  return _AnimationSheetRecorder(
    key: key,
    size: frameSize,
    allLayers: allLayers,
    handleRecorded: recording ? _recordedFrames.add : null,
    child: child,