FlameBuilder class
- Inheritance
-
- Object
- FlameWidget
- FlameBuilder
Constructors
- FlameBuilder({required FlameWidget build(BuildContext context)})
Properties
- bounds ↔ Vector2
-
The bounds of this widget, you cannot draw outside of these
This variable is initially set to 1, 1 only after being added
to the UI this might change, so don't use it only in the
constructor, but incorporate it in the render/update functions
getter/setter pairinherited
- childBuild ↔ FlameWidget?
-
getter/setter pairinherited
- context ↔ BuildContext?
-
getter/setter pairinherited
- disposed → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → FlameWidget -
Return widgets here that should be drawn as child(ren) of this widget
You should also update the child(ren) and call the render of the child(ren)
override
-
determinePrefferedSize(
Vector2 parentBounds) → Vector2 -
Determine how large this widget wants to be, based on constraints
like child, width, height, fontSize, ...
use parentBounds for unpreffered sizes
inherited
-
dispose(
) → void -
Overwrite to dispose when this object is removed from the tree
inherited
-
markForRebuild(
) → void -
Marks for rebuild, similar to setState in Flutter
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDragEnd(
Vector2 position) → void -
inherited
-
onDragStart(
Vector2 position) → void -
inherited
-
onDragUpdate(
Vector2 position) → void -
inherited
-
onScaleEnd(
Vector2 position, double scale) → void -
inherited
-
onScaleStart(
Vector2 position) → void -
inherited
-
onScaleUpdate(
Vector2 position, double scale) → void -
inherited
-
onTapDown(
Vector2 tapPosition) → void -
inherited
-
onTapUp(
Vector2 tapPosition) → void -
inherited
-
reBuildChild(
BuildContext context, Vector2 bounds) → void -
Used to build this child, override to disable if you don't require (re)build
inherited
-
render(
Canvas canvas, BuildContext context) → void -
You must call super if you override this and override build
Don't call super if you use this widget as a renderingWidget
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
double delta) → void -
Only used in
FlameRenderWidgets
for now, FlameWidgets are not being updated correctly. If you want to update your state, use a FlameCanvas with onUpdate Don't call super if you use this widget as a renderingWidgetinherited -
updateData(
Vector2 newBounds, BuildContext context, FlameWidget? parent) → void -
Update the bounds of this widget
Must call super first when overriding this
Note that your child(ren) should be updated during build
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited