ListenerGameWidget<T extends Game> class
A StatefulWidget that is in charge of attaching a Game
instance into the
Flutter tree.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ListenerGameWidget
Constructors
-
ListenerGameWidget({required T game, Key? key, TextDirection? textDirection, GameLoadingWidgetBuilder? loadingBuilder, GameErrorWidgetBuilder? errorBuilder, WidgetBuilder? backgroundBuilder, Map<
String, OverlayWidgetBuilder< ? overlayBuilderMap, List<T> >String> ? initialActiveOverlays, FocusNode? focusNode, bool autofocus = true, MouseCursor? mouseCursor, bool addRepaintBoundary = true}) -
Renders a
game
in a flutter widget tree.
Properties
- addRepaintBoundary → bool
-
Whether the game should assume the behavior of a RepaintBoundary,
defaults to
true
.final - autofocus → bool
-
Whether the focusNode requests focus once the game is mounted.
Defaults to true.
final
- backgroundBuilder → WidgetBuilder?
-
Builder to provide a widget tree to be built between the game elements and
the background color provided via
Game.backgroundColor
.final - errorBuilder → GameErrorWidgetBuilder?
-
If set, errors during the onLoad method will not be thrown
but instead this widget will be shown. If not provided, errors are
propagated up.
final
- focusNode → FocusNode?
-
The FocusNode to control the games focus to receive event inputs.
If omitted, defaults to an internally controlled focus node.
final
- game → T?
-
The game instance which this widget will render, if the normal constructor
is used.
If the
ListenerGameWidget.controlled
constructor is used, this will aways benull
.final -
gameFactory
→ GameFactory<
T> ? -
A function that creates a
Game
that this widget will render.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
initialActiveOverlays
→ List<
String> ? -
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingBuilder → GameLoadingWidgetBuilder?
-
Builder to provide a widget tree to be built while the Game's Future
provided via
Game.onLoad
andGame.onMount
is not resolved. By default this is an empty Container().final - mouseCursor → MouseCursor?
-
final
-
overlayBuilderMap
→ Map<
String, OverlayWidgetBuilder< ?T> > -
A map to show widgets overlay.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textDirection → TextDirection?
-
The text direction to be used in text elements in a game.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → ListenerGameWidgetState< T> -
Renders a game in a flutter widget tree alongside widgets overlays.
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, int wrapWidth = 65}) → 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