getTripState method

  1. @override
Future<MoveTripState> getTripState()
override

Returns the current SDK trip state.

Implementation

@override
Future<MoveTripState> getTripState() async {
  final tripState = await methodChannel.invokeMethod<String>('getTripState');
  MoveTripState? result = MoveTripState.values.firstWhereOrNull(
      (element) => element.name.toLowerCase() == tripState?.toLowerCase());
  return result ?? MoveTripState.unknown;
}