launch static method
void
launch(
- BuildContext context, {
- required AmphitheatreController controller,
- AmphitheatreRouteBuilder routeBuilder = _defaultAmphitheatreRouteBuilder,
- bool enableToggleControls = true,
- bool enableReplayButton = true,
- bool autoPlay = true,
Launches the Amphitheatre with the given controller, consuming the controller. See Amphitheatre.consume.
If you require further customization, such as the ability to supply custom widgets for buttons, etc., then you should directly use the Amphitheatre.consume API instead (which consumes an AmphitheatreController) - this function is simply a wrapper around that API.
Implementation
static void launch(
final BuildContext context, {
required final AmphitheatreController controller,
final AmphitheatreRouteBuilder routeBuilder =
_defaultAmphitheatreRouteBuilder,
final bool useRootNavigator = false,
final bool enableToggleControls = true,
final bool enableReplayButton = true,
final bool autoPlay = true,
}) {
final Widget child = Amphitheatre.consume(
controller: controller,
enableToggleControls: enableToggleControls,
enableReplayButton: enableReplayButton,
autoPlay: autoPlay,
);
unawaited(
Navigator.of(context, rootNavigator: useRootNavigator)
.push(routeBuilder(child)),
);
}