Amphitheatre.consume constructor

const Amphitheatre.consume({
  1. required AmphitheatreController controller,
  2. AmphitheatreComponentBuilder buildCloseButton = _buildCloseButton,
  3. AmphitheatreComponentBuilder? buildDoneButton,
  4. AmphitheatreComponentBuilder buildReplayButton = _buildReplayButton,
  5. AmphitheatreComponentBuilder buildProgressSlider = _buildProgressSlider,
  6. AmphitheatreComponentBuilder buildVideoControls = _buildVideoControls,
  7. AmphitheatreComponentBuilder buildVideoInfo = _buildVideoInfo,
  8. bool enableToggleControls = true,
  9. bool enableReplayButton = true,
  10. bool autoPlay = true,
  11. Key? key,
})

Equivalent to the default constructor, Amphitheatre.new, but indicates to Amphitheatre that the controller has been 'consumed'.

This means that the Amphitheatre state will automatically initialize and dispose of the controller in accordance with its own lifecycle.

This is intended for where the controller is ephemerally linked to the Amphitheatre lifecycle (e.g., in the case of launch).

Implementation

const Amphitheatre.consume({
  required this.controller,
  this.buildCloseButton = _buildCloseButton,
  this.buildDoneButton,
  this.buildReplayButton = _buildReplayButton,
  this.buildProgressSlider = _buildProgressSlider,
  this.buildVideoControls = _buildVideoControls,
  this.buildVideoInfo = _buildVideoInfo,
  this.enableToggleControls = true,
  this.enableReplayButton = true,
  this.autoPlay = true,
  super.key,
}) : consumedController = true;