Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The example code is not working #31

Open
alexyuyl opened this issue May 19, 2024 · 1 comment
Open

The example code is not working #31

alexyuyl opened this issue May 19, 2024 · 1 comment

Comments

@alexyuyl
Copy link

I tried

  1. Creating a new flutter project and referencing the library
  2. Downloading the zip and running the example/main.dart
  3. Forking the project and running the example/main.dart

Firstly I am greeted by error about the app is not wrapped inside MaterialApp. I fixed this by wrapping the MyApp inside MaterialApp().

However after the build compiled, none of the three approached worked. It appears the code is only showing a camera preview and the ocr is not working. Tested on both Android and iOS.

Please inform if the example code is the minimum functional code, or I have to add some missing parts myself.

@GuillianDrouin
Copy link
Contributor

Yes, it is now mandatory to have a MaterialApp.
The module is not started in the example, sorry for that.
You can modify in the example by:

   Widget _buildLiveScan() {
     return LiveScanWidget(
       ocrTextResult: (ocrTextResult) {
         ocrTextResult.mapResult.forEach((module, result) {});
       },
       scanModules: [ScanAllModule()..start()],
     );
   }

I will make a correction to the example, thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants