ソースを参照

Updated Flutter min sdk of example to match plugin. Updated README.md

flutter-beta
Julian Steenbakker 5年前
コミット
6d8b7799f9
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 16E437C7A3D94250
3個のファイルの変更26行の追加16行の削除
  1. +24
    -14
      example/README.md
  2. +1
    -1
      example/lib/main.dart
  3. +1
    -1
      example/pubspec.yaml

+ 24
- 14
example/README.md ファイルの表示

@@ -52,20 +52,7 @@ class _QRViewExampleState extends State<QRViewExample> {
return Scaffold(
body: Column(
children: <Widget>[
Expanded(
flex: 4,
child: QRView(
key: qrKey,
onQRViewCreated: _onQRViewCreated,
overlay: QrScannerOverlayShape(
borderColor: Colors.red,
borderRadius: 10,
borderLength: 30,
borderWidth: 10,
cutOutSize: 300,
),
),
),
Expanded(flex: 4, child: _buildQrView(context)),
Expanded(
flex: 1,
child: FittedBox(
@@ -163,6 +150,29 @@ class _QRViewExampleState extends State<QRViewExample> {
return backCamera == current;
}

Widget _buildQrView(BuildContext context) {
// To ensure the Scanner view is properly sizes after rotation
// we need to listen for Flutter SizeChanged notification and update controller
return NotificationListener<SizeChangedLayoutNotification>(
onNotification: (notification) {
Future.microtask(() => controller?.updateDimensions(qrKey));
return false;
},
child: SizeChangedLayoutNotifier(
key: const Key('qr-size-notifier'),
child: QRView(
key: qrKey,
onQRViewCreated: _onQRViewCreated,
overlay: QrScannerOverlayShape(
borderColor: Colors.red,
borderRadius: 10,
borderLength: 30,
borderWidth: 10,
cutOutSize: 300,
),
)));
}

void _onQRViewCreated(QRViewController controller) {
this.controller = controller;
controller.scannedDataStream.listen((scanData) {


+ 1
- 1
example/lib/main.dart ファイルの表示

@@ -129,7 +129,7 @@ class _QRViewExampleState extends State<QRViewExample> {

Widget _buildQrView(BuildContext context) {
// To ensure the Scanner view is properly sizes after rotation
// we need to listen for Flutter SizeChanged notifiation and update controller
// we need to listen for Flutter SizeChanged notification and update controller
return NotificationListener<SizeChangedLayoutNotification>(
onNotification: (notification) {
Future.microtask(() => controller?.updateDimensions(qrKey));


+ 1
- 1
example/pubspec.yaml ファイルの表示

@@ -3,7 +3,7 @@ description: Demonstrates how to use the flutter_qr plugin.
publish_to: 'none'

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.3.0 <3.0.0"

dependencies:
flutter:


読み込み中…
キャンセル
保存