PresentationWidget class

A widget that can present the slides.

It is as simple as just passing the list of slides to be displayed to the slides in the required order. We can also pass (optional) a widget to background that is displayed when a slide doesn't have a background. This enables use of a common background all over the presentation. To show the current slide number, set the showSlideNumber to true.

By default, the widget makes the slides resolution to SlideSize.widescreenBig (1920x1080). The slideSize can be used to set preferred resolution. Also, packaged along with this comes an option on how to fit the slide in this widget using slideFit.

It is best to use a Material widget as a parent of this widget. And always use this widget inside a MaterialApp.

This widget will add an "End of the presentation" slide at the end.

This widget automatically handles all the key events and tap events to advance or reverse the slides (as below).

Key Events:

  • Arrow Right key to advance the slide
  • Arrow Left key to reverse the slide

Tap Events:

  • Tap on the 2/3rd right part of the screen* to advance the slide
  • Tap on the 1/3rd left part of the screen* to reverse the slide

*screen here is the area where this widget is displayed.

Note1: It is recomended to use this widget as a complete page as the presentations are usually full screen.

Note2: When a slide doesn't have a background, this widget's background is considered. And, when this widget doesn't have a background, the default flutter app background is displayed (white or black based on theme).

Note3: Text when the current slide number is displayed uses the TextTheme.labelLarge style.

See also:

Inheritance

Constructors

PresentationWidget({required List<SlideWidget> slides, Key? key, Widget? background, bool showSlideNumber = false, ValueChanged<SlideChangeData>? onSlideChange, SlideSize slideSize = SlideSize.widescreenBig, BoxFit slideFit = BoxFit.contain})
creates a PresentationWidget to present the slides.
const

Properties

background Widget?
The background widget for the presentation. It will displayed when a slide doesn't have a background.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSlideChange ValueChanged<SlideChangeData>?
An event callback when a slide is changed. The data passed in this callback is SlideChangeData. The callback happens only when a slide is changed. The index of slides start from 1. current slide value is (slidesLength + 1) when reaching the end of the presentation slide.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showSlideNumber bool
Show the current slide number when set to true
final
slideFit BoxFit
How to inscribe the slide into the space allocated during layout.
final
slides List<SlideWidget>
The list of slides made from or using SlideWidget to present.
final
slideSize SlideSize
Resolution of slide in the presentation widget.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PresentationWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited