Ai Barcode | Coderz Repository

ai_barcode

Last updated:

0 purchases

ai_barcode Image
ai_barcode Images

Free

Languages

Categories

Add to Cart

Description:

ai barcode

ai_barcode #





English Document
中文文档



ai_barcode:支持Android、iOS、web识别'一维条码'和'二维条码'的识别与生成



Plugin
Pub
Points
Popularity
Likes




ai_barcode







亮点: ai_barcode:支持在flutter页面中嵌入Scanner以此来应对多变的业务需求
Effect #



iOS-Scanner
Android-Scanner














iOS-Creator
Android-Creator














Web-Creator
Web-Scanner











ai_barcode 在项目中的实战应用flutter sample



下载安卓apk安装包
IOS安装包,请下载example后运行项目获取
博客地址



1.安装 #
使用当前包作为依赖库
1. 依赖此库 #
在文件 'pubspec.yaml' 中添加



Plugin
Pub
Points
Popularity
Likes




ai_barcode








dependencies:

ai_barcode: ^version

copied to clipboard
或者以下方式依赖
dependencies:

# barcode package.
ai_barcode:
git:
url: https://github.com/pdliuw/ai_barcode.git

copied to clipboard
2. 安装此库 #
你可以通过下面的命令行来安装此库

$ flutter pub get


copied to clipboard
你也可以通过项目开发工具通过可视化操作来执行上述步骤
3. 导入此库 #
现在,在你的Dart编辑代码中,你可以使用:

import 'package:ai_barcode/ai_barcode.dart';

copied to clipboard
2.使用 #
使用'相机'需要动态申请权限,动态权限推荐:permission_handler
配置权限
Android权限配置:

<uses-permission android:name="android.permission.CAMERA"/>

copied to clipboard
iOS权限配置:

<key>NSCameraUsageDescription</key>
<string>Can we access your camera in order to scan barcodes?</string>


copied to clipboard
iOS支持PlatformView配置:

<key>io.flutter.embedded_views_preview</key>
<true/>

copied to clipboard
1.使用'一维条码、二维条码'的地方中: #

1、识别条码 简要示例

//cameraWidth:相机的宽度;cameraHeight相机的高度,可根据实际的业务来动态调整
Container(
color: Colors.black26,
width: cameraWidth,
height: cameraHeight,
child: PlatformAiBarcodeScannerWidget(
platformScannerController: _scannerController,
),
),

copied to clipboard

2、生成/创建条码 简要示例

Column(
children: <Widget>[
Text("生成的二维码:$_qrCodeOfInput"),
Container(
width: 300,
height: 300,
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors.blue,
width: 15,
),
borderRadius: BorderRadius.all(
Radius.circular(10),
),
),
),
margin: EdgeInsets.all(40),
child: PlatformAiBarcodeCreatorWidget(
creatorController: _creatorController,
initialValue: "$_qrCodeOfInput",
),
),
],
),

copied to clipboard
完整示例
完整示例,点击这里
2.调用/应用 #
*1、打开相机设备

_scannerController.startCamera();

copied to clipboard
*2、打开预览/识别'条码'

_scannerController.startCameraPreview();

copied to clipboard
*3、关闭预览/识别'条码'

_scannerController.stopCameraPreview();

copied to clipboard
*4、关闭相机设备

_scannerController.stopCamera();

copied to clipboard
*5、打开手电筒

_scannerController.openFlash();

copied to clipboard
*5、关闭手电筒

_scannerController.closeFlash();

copied to clipboard
*5、切换手电筒

_scannerController.toggleFlash();

copied to clipboard
看到这里还意犹未尽?点击,查看项目示例
感谢 #



iOS-一维码/二维码 识别/生成
Android-一维码/二维码 识别/生成
Web、MacOS-二维码 生成






基于: MTBBarcodeScanner
基于: zxing
基于: qr_flutter



待办 #

支持:iOS上成功扫描条形码后也可以冻结相机图像

LICENSE #
BSD 3-Clause License

Copyright (c) 2020, pdliuw
All rights reserved.
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product: (if this is empty don't purchase this product)

Customer Reviews

There are no reviews.