Flutter 二維碼掃描插件

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地址

Github地址

關注公衆號獲取更多內容

------------------------關注公衆號第一時間獲取最新內容------------------------

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章