Car class final
A class that represents a car.
The Car
class is a simple value object that represents a car. It consists
of a String
value that represents the sign of the car, and a bool
value
that indicates whether the cars in specific country are right-side or
left-side driven. The sign
field may be null
or a non-empty string, and
the isRightSide
field defaults to true
.
Example usage:
final car = const Car(sign: "NEP", isRightSide: false);
print(car.sign); // Prints: "NEP"
print(car.isRightSide); // Prints: false
- Implemented types
- Available Extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- isRightSide → bool
-
Indicates whether the car is right-side or left-side drive.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sign → String?
-
The sign of the car.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
{JsonCodec codec = const JsonCodec()}) → String -
Returns a JSON-encoded string representation of the object.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
covariant Car other) → bool -
The equality operator.
override