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

Working Example on Web #128

Open
ardeshir-33033 opened this issue Sep 22, 2024 · 1 comment
Open

Working Example on Web #128

ardeshir-33033 opened this issue Sep 22, 2024 · 1 comment

Comments

@ardeshir-33033
Copy link

I am using the package on android and ios and everything is great.

the problem is in the Web which does not seem to work and even the example is not working on the web.

@rvndsngwn
Copy link
Member

Hi @ardeshir-33033 Verify the web platform setup is correct. I verified the example web is working correctly.

Web

As of version 5.0.0 adding the barcode scanning library script to the index.html is no longer required,
as the script is automatically loaded on first use.

Providing a mirror for the barcode scanning library

If a different mirror is needed to load the barcode scanning library,
the source URL can be set beforehand.

import 'package:flutter/foundation.dart';
import 'package:mobile_scanner/mobile_scanner.dart';

final String scriptUrl = // ...

if (kIsWeb) {
  MobileScannerPlatform.instance.setBarcodeLibraryScriptUrl(scriptUrl);
}

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

No branches or pull requests

2 participants