start method

Future<void> start({
  1. List<String> deviceIds = const [],
  2. List<String> employeeIds = const [],
  3. void onUpdate(
    1. LiveUpdate
    )?,
})

Implementation

Future<void> start({List<String> deviceIds = const [], List<String> employeeIds = const [] , void Function(stub.LiveUpdate)? onUpdate}) async {
  _channel = _factory.createChanel();
  _client = stub.GpsTrackingServicesClient(_channel!);
  final opts = await _factory.callOptions();

  final req = stub.SubscribeLiveRequest()
    ..deviceIds.addAll(deviceIds)
    ..employeeIds.addAll(employeeIds);

  final stream = _client!.subscribeLive(req, options: opts);
  _sub = stream.listen(onUpdate ?? (_) {});
}