|
1 | | -<!-- |
2 | | -This README describes the package. If you publish this package to pub.dev, |
3 | | -this README's contents appear on the landing page for your package. |
| 1 | +# simple_barcode_scanner |
4 | 2 |
|
5 | | -For information about how to write a good package README, see the guide for |
6 | | -[writing package pages](https://dart.dev/guides/libraries/writing-package-pages). |
| 3 | +simple_barcode_scanner let you scan barcode and qr code. |
7 | 4 |
|
8 | | -For general information about developing packages, see the Dart guide for |
9 | | -[creating packages](https://dart.dev/guides/libraries/create-library-packages) |
10 | | -and the Flutter guide for |
11 | | -[developing packages and plugins](https://flutter.dev/developing-packages). |
12 | | ---> |
13 | | - |
14 | | -TODO: Put a short description of the package here that helps potential users |
15 | | -know whether this package might be useful for them. |
| 5 | +## Demo |
| 6 | + |
16 | 7 |
|
17 | 8 | ## Features |
18 | 9 |
|
19 | | -TODO: List what your package can do. Maybe include images, gifs, or videos. |
| 10 | +* Scan barcode in mobile devices using flutter_barcode_scanner |
| 11 | +* Scan barcode in web/window using html5-qrcode package |
20 | 12 |
|
21 | 13 | ## Getting started |
22 | 14 |
|
23 | | -TODO: List prerequisites and provide or point to information on how to |
24 | | -start using the package. |
25 | | - |
26 | | -## Usage |
27 | | - |
28 | | -TODO: Include short and useful examples for package users. Add longer examples |
29 | | -to `/example` folder. |
| 15 | +```dart |
| 16 | +simple_barcode_scanner: ^0.0.1 |
30 | 17 |
|
| 18 | +``` |
| 19 | +Import the library: |
31 | 20 | ```dart |
32 | | -const like = 'sample'; |
33 | | -``` |
| 21 | +import 'package:simple_barcode_scanner/simple_barcode_scanner.dart'; |
34 | 22 |
|
35 | | -## Additional information |
| 23 | +``` |
| 24 | +## Usage |
36 | 25 |
|
37 | | -TODO: Tell users more about the package: where to find more information, how to |
38 | | -contribute to the package, how to file issues, what response they can expect |
39 | | -from the package authors, and more. |
| 26 | +```dart |
| 27 | +** ElevatedButton( |
| 28 | + onPressed: () async { |
| 29 | + var res = await Navigator.push( |
| 30 | + context, |
| 31 | + MaterialPageRoute( |
| 32 | + builder: (context) => const SimpleBarcodeScannerPage(), |
| 33 | + )); |
| 34 | + setState(() { |
| 35 | + if (res is String) { |
| 36 | + result = res; |
| 37 | + } |
| 38 | + }); |
| 39 | + }, |
| 40 | + child: const Text('Open Scanner'), |
| 41 | + ),** |
| 42 | +``` |
| 43 | +## Todo |
| 44 | +* Flash and switch camera are only available in mobile devices |
| 45 | +* Enhancement |
| 46 | + |
| 47 | +If you have any questions, feedback or ideas, feel free to [create an |
| 48 | +issue](https://github.com/CodingWithTashi/simple_barcode_scanner/issues/new). If you enjoy this |
| 49 | +project, I'd appreciate your [🌟 on GitHub](https://github.com/CodingWithTashi/simple_barcode_scanner/). |
| 50 | + |
| 51 | +## You can also buy me a cup of coffee |
| 52 | +<a href="https://www.buymeacoffee.com/codingwithtashi"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" width=200px></a> |
0 commit comments