소스 검색

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

flutter-beta
Julian Steenbakker 5 년 전
부모
커밋
6d8b7799f9
No known key found for this signature in database 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:


불러오는 중...
취소
저장