Cube class

The Rubik's Cube.

Constructors

Cube.from(String definition)
Creates a Cube from the your definition string U..R..F..D..L..B.
factory
Cube.fromJson(dynamic json)
Creates a Cube instance from a json object.
factory
Cube.of(List<Color> definition)
Creates a Cube from the your definition colors U..R..F..D..L..B.
factory
Cube.scrambled({int n = 20})
Creates a scrambled Cube after n random moves.
factory

Properties

colors List<Color>
Returns the facelet colors.
no setter
definition String
Returns the Cube's definition string U..R..F..D..L..B.
no setter
hashCode int
The hash code for this object.
no setterinherited
isNotOk bool
Checks if Cube's status is not okay.
no setter
isOk bool
Checks if Cube's status is okay.
no setter
isSolved bool
Returns true if the Cube is solved.
no setter
prettyDefinition String
Returns the Cube's pretty definition.
no setter
props List<Object>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

computeCornerParity() int
computeEdgeParity() int
computeFlip() int
computeFrontRightToBottomRight() int
computeTwist() int
computeUpBottomToDownFront() int
computeUpRightFrontToDownLeftBottom() int
computeUpRightFrontToDownLeftFront() int
computeUpRightToBottomRight() int
computeUpRightToDownFront() int
computeUpRightToUpLeft() int
cornerMultiply(Cube b) Cube
edgeMultiply(Cube b) Cube
flip(int value) Cube
frontRightToBottomRight(int index) Cube
inverse() Cube
move(Move move) Cube
Turns a face of the Cube applying a move.
multiply(Cube b) Cube
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patternize(Cube to) Cube
Returns the patternized Cube to solve the pattern from this cube to to cube.
solve({Solver solver = kociemba, int maxDepth = Solver.defaultMaxDepth, Duration timeout = Solver.defaultTimeout}) Solution?
Returns the Solution for the Cube using the solver algorithm or null if the timeout is exceeded or there is no Solution.
solveDeeply({Solver solver = kociemba, Duration timeout = Solver.defaultTimeout}) Stream<Solution>
Gets the Solutions as much as possible using the solver algorithm until the minimum number of moves is reached or the timeout is exceeded.
svg({int width = 1024, int height = 1024, Map<Color, String> colors = const <Color, String>{}, List<Rotation> orientation = const []}) String
Generates an SVG image of the Cube.
toJson() Map<String, dynamic>
Returns the Cube state as a json object.
toString() String
A string representation of this object.
inherited
twist(int value) Cube
upBottomToDownFront(int index) Cube
upRightFrontToDownLeftBottom(int index) Cube
upRightFrontToDownLeftFront(int index) Cube
upRightToBottomRight(int index) Cube
upRightToDownFront(int index) Cube
upRightToUpLeft(int index) Cube
verify() CubeStatus
Verifies if the Cube has invalid facelet positions.

Operators

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

Static Properties

anaconda Cube
A Cube from a anaconda-like pattern.
final
checkerboard Cube
A Cube from a checkerboard-like pattern.
final
chickenFeet Cube
A Cube from a chicken-feet-like pattern.
final
crossOne Cube
A Cube from a cross-like pattern.
final
crossTwo Cube
A Cube from a cross-like pattern.
final
cubeInCube Cube
A Cube from a cube-in-cube-like pattern.
final
cubeInCubeInCube Cube
A Cube from a cube-in-cube-in-cube-like pattern.
final
feliksZemdegs422 Cube
Rubik's Cube World Record by Feliks Zemdegs on May 6th, 2018, at Cube for Cambodia 2018 (Melbourne, Australia) in 4.22 seconds.
final
fourSpots Cube
A Cube from a four-spots pattern.
final
python Cube
A Cube from a python-like pattern.
final
sixSpots Cube
A Cube from a six-spots pattern.
final
sixTs Cube
A Cube from a six-Ts pattern.
final
spiral Cube
A Cube from a spiral-like pattern.
final
stripes Cube
A Cube from a stripe-like pattern.
final
tetris Cube
A Cube from a tetris-like pattern.
final
twister Cube
A Cube from a twister-like pattern.
final
wire Cube
A Cube from a wire-like pattern.
final
yushengDu347 Cube
Rubik's Cube World Record by Yusheng Du (杜宇生) on Nov 24th, 2018, at Wuhu Open 2018 (Wuhu, China) in 3.47 seconds.
final

Constants

solved → const Cube
The solved Cube.