# flutter_scan
**Repository Path**: Spring_Cloud_Sell/flutter_scan
## Basic Information
- **Project Name**: flutter_scan
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-11-26
- **Last Updated**: 2024-11-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# scan
[](https://pub.dev/packages/scan)
scan qrcode & barcode in widget tree.
decode qrcode & barcode image from path.
> if you want to generate qrcode image, you should use [qr_flutter](https://pub.dev/packages/qr_flutter)
### Features
- use `ScanView` in widget tree to show scan view.
- custom identifiable area.
- decode qrcode from image path by `Scan.parse`.
### prepare
##### ios
info.list
```
NSCameraUsageDescription
Your Description
io.flutter.embedded_views_preview
YES
```
##### android
```xml
```
```yaml
scan: ^newest
```
```dart
import 'package:scan/scan.dart';
```
### Usage
- show scan view in widget tree
```dart
ScanController controller = ScanController();
String qrcode = 'Unknown';
Container(
width: 250, // custom wrap size
height: 250,
child: ScanView(
controller: controller,
// custom scan area, if set to 1.0, will scan full area
scanAreaScale: .7,
scanLineColor: Colors.green.shade400,
onCapture: (data) {
// do something
},
),
),
```
- you can use `controller.resume()` and `controller.pause()` resume/pause camera
```dart
controller.resume();
controller.pause();
```
- get qrcode string from image path
```dart
String result = await Scan.parse(imagePath);
```
- toggle flash light
```dart
controller.toggleTorchMode();
```
### proguard-rules
```
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
```
# License
MIT License