TrainPosition class
Represents the position of a train.
Constructors
- TrainPosition({required int numCars, required String circuitId, String? destinationStationCode, required int directionNum, String? lineCode, required int secondsAtLocation, required ServiceType serviceType, required String trainId, required String trainNumber})
-
Creates a new TrainPosition object.
const
- TrainPosition.empty()
-
Creates an empty TrainPosition object.
const
-
TrainPosition.fromJson(Map<
String, dynamic> json) -
Creates a new TrainPosition object from a JSON map.
factory
Properties
- circuitId → String
-
The circuit identifier the train is currently on.
final
- destinationStationCode → String?
-
Destination station code.
final
- directionNum → int
-
The direction of movement regardless of which track the train is on.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isEmpty → bool
-
Whether or not this TrainPosition object is empty.
no setter
- isNotEmpty → bool
-
Whether or not this TrainPosition object is not empty.
no setter
- lineCode → String?
-
Two-letter abbreviation for the line (e.g.: RD, BL, YL, OR, GR, or SV).
final
- numCars → int
-
Number of cars.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondsAtLocation → int
-
Approximate "dwell time".
final
- serviceType → ServiceType
-
Service type of the train.
final
- trainId → String
-
Unique identifier for the train.
final
- trainNumber → String
-
Non-unique train identifier, often used by WMATA's Rail Scheduling and
Operations Teams, as well as over open radio communication.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Returns a JSON representation of this object.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override