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

Car({String? sign, bool isRightSide = true})
Creates a new Car object with the given sign and side values.
const

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