Util class

Some utilities that did not fit anywhere else.

To use this class, access it via Flame.util.

Constructors

Util()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addGestureRecognizer(GestureRecognizer recognizer) → void
This properly binds a gesture recognizer to your game. [...]
animationAsWidget(Position size, Animation animation) Widget
Returns a regular Flutter widget representing this animation, rendered with the specified size. [...]
drawWhere(Canvas c, Position p, void fn(Canvas)) → void
Utility method to render stuff on a specific place. [...]
fullScreen() Future<void>
Sets the app to be fullscreen (no buttons bar os notifications on top). [...]
initialDimensions() Future<Size>
Waits for the initial screen dimensions to be available. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeGestureRecognizer(GestureRecognizer recognizer) → void
This properly removes the bind of a gesture recognizer to your game. [...]
setLandscape() Future<void>
Sets the preferred orientation of the app to landscape only. [...]
setLandscapeLeftOnly() Future<void>
Sets the preferred orientation of the app to DeviceOrientation.landscapeLeft only. [...]
setLandscapeRightOnly() Future<void>
Sets the preferred orientation of the app to DeviceOrientation.landscapeRight only. [...]
setOrientation(DeviceOrientation orientation) Future<void>
Sets the preferred orientation (landscape or portrait) for the app. [...]
setOrientations(List<DeviceOrientation> orientations) Future<void>
Sets the preferred orientations (landscape left, right, portrait up, or down) for the app. [...]
setPortrait() Future<void>
Sets the preferred orientation of the app to portrait only. [...]
setPortraitDownOnly() Future<void>
Sets the preferred orientation of the app to DeviceOrientation.portraitDown only. [...]
setPortraitUpOnly() Future<void>
Sets the preferred orientation of the app to DeviceOrientation.portraitUp only. [...]
spriteAsWidget(Size size, Sprite sprite) CustomPaint
Returns a regular Flutter widget represeting this sprite, rendered with the specified size. [...]
toString() String
A string representation of this object. [...]
inherited

Operators

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