StarfieldController class

Controller class to add functionality to the starfield.

Each individual star will be generated using the provided configuration. Thenever the an property has changed (e.g. the number), the app must be restarted in order for the StarfieldController to be initialized using the updated configuration.

Constructors

StarfieldController({required int number, required Size size, required double depth, required double velocity, required double scale})
Creates a StarfieldController.

Properties

absoluteVelocity double
getter/setter pair
center Offset
Returns the view port's center point.
no setter
depth double
The depth of the space in which the stars are displayed.
final
hashCode int
The hash code for this object.
no setterinherited
maxAxisLength double
Returns the larger view port axis (x,y).
no setter
maxAxisLengthAbs double
Returns the larger view port axis (x,y) as an absolute value.
no setter
maxY double
The uttermost starfield's y-axis position.
no setter
minX double
The uttermost starfield's x-axis position.
no setter
number int
The number of stars to be displayed.
final
random Random
The random instance used to create aberrations of the given center point, therefore making the Stars appear on different locations.
getter/setter pair
revisedDepth double
Returns a revised depth (0-1) based on the provided depth.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
States which scale to apply on each star.
final
size Size
The starfield's size.
final
stars List<Star>
The List of Star objects which will be part of the starfield.
getter/setter pair
velocity double
The velocity the stars will travel at.
final

Methods

calcAbsVelo(double relVelo) double
Calculates a absolute velocity based on the current view port and returns its value.
dispose() → void
Disposes the controller state by emptying the stars list.
init() → void
Initializes the StarfieldController by creating the Stars.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
transformStar(Star star) → void
Translates the provided Star's points.

Operators

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