Skip to content

Commit 0ff21a5

Browse files
Merge pull request #83 from CodingWithTashi/CodingWithTashi-patch-4
Update README.md
2 parents dda93a2 + 502901e commit 0ff21a5

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Window | Web
3333
## Getting started
3434

3535
```dart
36-
simple_barcode_scanner: ^0.0.8
36+
simple_barcode_scanner: ^2.0.0
3737
3838
```
3939
Import the library:
@@ -47,21 +47,21 @@ import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
4747
ElevatedButton(
4848
onPressed: () async {
4949
50-
String? res = await SimpleBarcodeScanner.scanBarcode(
51-
context,
52-
barcodeAppBar: const BarcodeAppBar(
50+
String? res = await SimpleBarcodeScanner.scanBarcode(
51+
context,
52+
barcodeAppBar: const BarcodeAppBar(
5353
appBarTitle: 'Test',
5454
centerTitle: false,
5555
enableBackButton: true,
5656
backButtonIcon: Icon(Icons.arrow_back_ios),
57-
),
58-
isShowFlashIcon: true,
59-
delayMillis: 2000,
60-
cameraFace: CameraFace.front,
61-
);
62-
setState(() {
63-
result = res as String;
64-
});
57+
),
58+
isShowFlashIcon: true,
59+
delayMillis: 2000,
60+
cameraFace: CameraFace.front,
61+
);
62+
setState(() {
63+
result = res as String;
64+
});
6565
},
6666
child: const Text('Open Scanner'),
6767
)
@@ -72,17 +72,17 @@ import 'package:simple_barcode_scanner/simple_barcode_scanner.dart';
7272
onPressed: () async {
7373
7474
SimpleBarcodeScanner.streamBarcode(
75-
context,
76-
barcodeAppBar: const BarcodeAppBar(
77-
appBarTitle: 'Test',
78-
centerTitle: false,
79-
enableBackButton: true,
80-
backButtonIcon: Icon(Icons.arrow_back_ios),
81-
),
82-
isShowFlashIcon: true,
83-
delayMillis: 2000,
75+
context,
76+
barcodeAppBar: const BarcodeAppBar(
77+
appBarTitle: 'Test',
78+
centerTitle: false,
79+
enableBackButton: true,
80+
backButtonIcon: Icon(Icons.arrow_back_ios),
81+
),
82+
isShowFlashIcon: true,
83+
delayMillis: 2000,
8484
).listen((event) {
85-
print("Stream Barcode Result: $event");
85+
print("Stream Barcode Result: $event");
8686
});
8787
},
8888
child: const Text('Open Scanner'),

0 commit comments

Comments
 (0)