Skip to content

Commit

Permalink
fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
hmbenhaim committed Nov 21, 2021
1 parent b10f76f commit d012b03
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@
## 0.0.3-beta-1

* change assets location

## 0.0.3-beta-2

* change assets location

## 0.0.4

* change script include in index.html file to <script src="packages/qr_scanner_web/assets/qr_scanner_web.js" type="text/javascript"></script>

## 0.0.5

* remove unnecessary code
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
## Useage
- inport int your index.html
```sh
<script src="assets/packages/qr_scanner_web/assets/qr_scanner_web.js" type="text/javascript"></script>
<script src="packages/qr_scanner_web/assets/qr_scanner_web.js" type="text/javascript"></script>
```
- inastall the package
```sh
Expand Down
7 changes: 6 additions & 1 deletion lib/qr_scanner_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@ library script.js;
import 'dart:convert';
import 'dart:js_util';
import 'dart:typed_data';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:js/js.dart';

// import 'package:webviewx/webviewx.dart';
@JS()
external dynamic qrScannerScanImag(String image);

class QrScannerWeb extends QrScannerPlatform {
static void registerWith(Registrar registrar) {
var qrScannerWeb = QrScannerWeb();
QrScannerPlatform.instance = qrScannerWeb;
}

@override
Future<String?> fromImageBytes(Uint8List imageBytes, String mimeType) async {
final base64 = base64Encode(imageBytes);
final result = await promiseToFuture(
qrScannerScanImag('data:$mimeType;base64,$base64'));

print(result);
return result;
}
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: qr_scanner_web
description: QR Scanner for WEB.
version: 0.0.3-beta-1
version: 0.0.5
homepage: https://github.com/hmbenhaim/qr_scanner_web

environment:
Expand Down

0 comments on commit d012b03

Please sign in to comment.