position method
override
Report the position of the motor based on its encoder. The value returned is the number of revolutions relative to its zero position. This method will raise an exception if position reporting is not supported by the motor.
// Get the current position of an encoded motor.
var position = await myMotor.position();
For more information, see Motor component.
Implementation
@override
Future<double> position({Map<String, dynamic>? extra}) async {
final request = GetPositionRequest()
..name = name
..extra = extra?.toStruct() ?? Struct();
final result = await client.getPosition(request);
return result.position;
}