flutter_plugin_qrcode
二維碼掃描 同時支持 Android&IOS
Getting Started
掃描效果
android
IOS
引入方式
dependencies:
flutter_plugin_qrcode: ^1.0.1
##導入頭文件
import 'package:flutter_plugin_qrcode/flutter_plugin_qrcode.dart';
使用
Future<void> getQrcodeState() async {
String qrcode;
try {
qrcode = await FlutterPluginQrcode.getQRCode;
} on PlatformException {
qrcode = 'Failed to get platform version.';
}
if (!mounted) return;
//獲取到掃描的結果進行頁面更新
setState(() {
_qrcode = qrcode;
});
}
github地址
關注公衆號獲取更多內容
------------------------關注公衆號第一時間獲取最新內容------------------------