Scandit AR functionality on Flutter does not show anything

I'm developing a shopping list application in which users can scan multiple barcodes and see some data associated with the products. I succesfully integrated Scandit with MatrixScan and with BarcodeTrackingBasicOverlay it focuses correctly on the barcodes. I want then to migrate to BarcodeTrackingAdvancedOverlay and show a simple view with some text over the barcode but it doesen't work. I have a license to use Matrixscan. My initialization code is this

bool _loading = false;
Camera _camera = Camera.defaultCamera;
BarcodeTracking _barcodeTracking;
DataCaptureView _captureView;
TorchState _torchState = TorchState.off;
bool _isPermissionMessageVisible = false;
BarcodeTrackingAdvancedOverlay overlay;

@override
  void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);

_camera.applySettings(BarcodeCapture.recommendedCameraSettings);

_checkPermission();

var captureSettings = BarcodeTrackingSettings();
captureSettings.enableSymbologies({
  Symbology.ean8,
  Symbology.ean13Upca,
  Symbology.upce,
  Symbology.code39,
  Symbology.code128,
});

_barcodeTracking = BarcodeTracking.forContext(_context, captureSettings)
  ..addListener(this);

_captureView = DataCaptureView.forContext(_context);

/*var _basicOverlay = BarcodeTrackingBasicOverlay.withBarcodeTrackingForView(
  _barcodeTracking,
  _captureView,
)..brush = Brush(Color(0x00FFFFFF), Color(0xFFFFFFFF), 2);*/

overlay = BarcodeTrackingAdvancedOverlay.withBarcodeTrackingForView(
  _barcodeTracking,
  _captureView,
)..listener = this;

//_captureView.addOverlay(_basicOverlay);
_captureView.addOverlay(overlay);

_context.setFrameSource(_camera);
_camera.switchToDesiredState(FrameSourceState.on);
_barcodeTracking.isEnabled = true;
}

The body of the view is a simple Stack with a Center in which I show the _captureview and some text. My fist implementation was with the BarcodeTrackingAdvancedOverlayListener and it didn't show any widget over barcodes:

  @override
 PointWithUnit offsetForTrackedBarcode(
  BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) {
return PointWithUnit(DoubleWithUnit(0, MeasureUnit.fraction),
    DoubleWithUnit(-1, MeasureUnit.fraction));
 }

 @override
 Anchor anchorForTrackedBarcode(
  BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) {
  return Anchor.center;
 }

 @override
 Widget widgetForTrackedBarcode(
  BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) {
return ARWidget(data: trackedBarcode.barcode.data ?? 'CIAO');
 }

I also tried with the didUpdateSession implementation (similar to the Scandit sample app) but also didn't work:

@override
void didUpdateSession(
  BarcodeTracking barcodeTracking, BarcodeTrackingSession session) {

  for (final lostTrackIdentifier in session.removedTrackedBarcodes) {
  // You now know the identifier of the tracked barcode that has been lost.
  // Usually here you would remove the views associated.
  }

for (final trackedBarcode in session.addedTrackedBarcodes) {
  // Fixed identifier for the tracked barcode.
  var trackingIdentifier = trackedBarcode.identifier;

  // Current location of the tracked barcode.
  var location = trackedBarcode.location;
  _captureView
      .viewQuadrilateralForFrameQuadrilateral(location)
      .then((quadrilateral) => {
    _updateView(trackedBarcode, location)
          });
  }
}

_updateView(TrackedBarcode trackedBarcode, Quadrilateral viewLocation) {
// If the barcode is wider than the desired percent of the data capture view's width, show it to the user.
var shouldBeShown = viewLocation.width() > MediaQuery.of(context).size.width * 0.1;
if (!shouldBeShown) {
  overlay.setWidgetForTrackedBarcode(null, trackedBarcode);
  return;
}

var bubble = ARWidget(data: trackedBarcode.barcode.data ?? '');
overlay.setWidgetForTrackedBarcode(bubble, trackedBarcode);
print('YES');
}

@override void didTapViewForTrackedBarcode( BarcodeTrackingAdvancedOverlay overlay, TrackedBarcode trackedBarcode) {}

My ARWidget is this:

class ARWidget extends StatelessWidget {
final String data;

const ARWidget({Key key, this.data}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
  width: 180,
  height: 60,
  decoration: BoxDecoration(
    color: const Color(0xFFFFFFEE),
    borderRadius: BorderRadius.circular(30),
  ),
  child: Row(
    textDirection: TextDirection.ltr,
    children: [
      Container(
        width: 60,
        height: 60,
        decoration: BoxDecoration(
          color: const Color(0xFF58B5C2),
          borderRadius: BorderRadius.circular(30),
        ),
        child: Icon(
          Icons.widgets,
          color: Colors.white,
        ),
      ),
    ],
  ),
);
}

}

I saw on console that every time it tries to render the widget this error occur:

[        ] I/flutter ( 1208): 'package:flutter/src/widgets/focus_manager.dart': Failed assertion: line 1463 pos 12: 'RawKeyboard.instance.keyEventHandler == null': is not true.

Which with a bit of debugging found that it refers to LINE 34 of widget_to_base64_converter.dart.

final buildOwner = BuildOwner();

I also tried the sample AR Flutter app and had the same result. Do you have any idea on how to solve this issue or is it Scandit's fault?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum