diff --git a/qrcode/example/.flutter-plugins-dependencies b/qrcode/example/.flutter-plugins-dependencies index c398752..410b0f5 100644 --- a/qrcode/example/.flutter-plugins-dependencies +++ b/qrcode/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qrcode","path":"/home/vytor/projetos/mobile/qrcode/qrcode/","dependencies":[]}],"android":[{"name":"qrcode","path":"/home/vytor/projetos/mobile/qrcode/qrcode/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qrcode","dependencies":[]}],"date_created":"2020-06-24 16:02:25.633378","version":"1.17.3"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qrcode","path":"/home/luke/Projects/JTE/qrcode/qrcode/","dependencies":[]}],"android":[{"name":"qrcode","path":"/home/luke/Projects/JTE/qrcode/qrcode/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qrcode","dependencies":[]}],"date_created":"2021-01-15 15:27:33.514642","version":"1.26.0-8.0.pre"} \ No newline at end of file diff --git a/qrcode/example/ios/Flutter/flutter_export_environment.sh b/qrcode/example/ios/Flutter/flutter_export_environment.sh index cdfc81a..37ea4e9 100755 --- a/qrcode/example/ios/Flutter/flutter_export_environment.sh +++ b/qrcode/example/ios/Flutter/flutter_export_environment.sh @@ -1,11 +1,13 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/home/vytor/flutter" -export "FLUTTER_APPLICATION_PATH=/home/vytor/projetos/mobile/qrcode/qrcode/example" +export "FLUTTER_ROOT=/home/luke/Android/flutter" +export "FLUTTER_APPLICATION_PATH=/home/luke/Projects/JTE/qrcode/qrcode/example" export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build/ios" -export "OTHER_LDFLAGS=$(inherited) -framework Flutter" -export "FLUTTER_FRAMEWORK_DIR=/home/vytor/flutter/bin/cache/artifacts/engine/ios" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=false" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.packages" diff --git a/qrcode/example/lib/main.dart b/qrcode/example/lib/main.dart index e7fb91d..39bdfcb 100644 --- a/qrcode/example/lib/main.dart +++ b/qrcode/example/lib/main.dart @@ -10,8 +10,8 @@ class MyApp extends StatefulWidget { class _MyAppState extends State with TickerProviderStateMixin { QRCaptureController _captureController = QRCaptureController(); - Animation _animation; - AnimationController _animationController; + late Animation _animation; + late AnimationController _animationController; bool _isTorchOn = false; @@ -66,8 +66,8 @@ class _MyAppState extends State with TickerProviderStateMixin { width: 250, height: 250, child: QRCaptureView( - controller: _captureController, - ), + controller: _captureController, + ), ), Padding( padding: EdgeInsets.symmetric(horizontal: 56), @@ -97,33 +97,33 @@ class _MyAppState extends State with TickerProviderStateMixin { Widget _buildToolBar() { return Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FlatButton( - onPressed: () { - _captureController.pause(); - }, - child: Text('pause'), - ), - FlatButton( - onPressed: () { - if (_isTorchOn) { - _captureController.torchMode = CaptureTorchMode.off; - } else { - _captureController.torchMode = CaptureTorchMode.on; - } - _isTorchOn = !_isTorchOn; - }, - child: Text('torch'), - ), - FlatButton( - onPressed: () { - _captureController.resume(); - }, - child: Text('resume'), - ), - ], - ); + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + FlatButton( + onPressed: () { + _captureController.pause(); + }, + child: Text('pause'), + ), + FlatButton( + onPressed: () { + if (_isTorchOn) { + _captureController.torchMode = CaptureTorchMode.off; + } else { + _captureController.torchMode = CaptureTorchMode.on; + } + _isTorchOn = !_isTorchOn; + }, + child: Text('torch'), + ), + FlatButton( + onPressed: () { + _captureController.resume(); + }, + child: Text('resume'), + ), + ], + ); } } diff --git a/qrcode/example/pubspec.yaml b/qrcode/example/pubspec.yaml index a1ed4c8..431ba52 100644 --- a/qrcode/example/pubspec.yaml +++ b/qrcode/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Demonstrates how to use the qrcode plugin. publish_to: 'none' environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.12.0-0 <3.0.0" dependencies: flutter: diff --git a/qrcode/example/test/widget_test.dart b/qrcode/example/test/widget_test.dart index 4ff44e1..b3772a4 100644 --- a/qrcode/example/test/widget_test.dart +++ b/qrcode/example/test/widget_test.dart @@ -18,8 +18,8 @@ void main() { // Verify that platform version is retrieved. expect( find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data.startsWith('Running on:'), + (Widget widget) => + widget is Text && widget.data!.startsWith('Running on:'), ), findsOneWidget, ); diff --git a/qrcode/lib/qrcode.dart b/qrcode/lib/qrcode.dart index f7b61d6..8de5bcc 100644 --- a/qrcode/lib/qrcode.dart +++ b/qrcode/lib/qrcode.dart @@ -8,17 +8,17 @@ typedef CaptureCallback(String data); enum CaptureTorchMode { on, off } class QRCaptureController { - MethodChannel _methodChannel; - CaptureCallback _capture; - + MethodChannel? _methodChannel; + CaptureCallback? _capture; + QRCaptureController(); void _onPlatformViewCreated(int id) { _methodChannel = MethodChannel('plugins/qr_capture/method_$id'); - _methodChannel.setMethodCallHandler((MethodCall call) async { - if (call.method == 'onCaptured') { + _methodChannel?.setMethodCallHandler((MethodCall call) async { + if (call.method == 'onCaptured') { if (_capture != null && call.arguments != null) { - _capture(call.arguments.toString()); + _capture!(call.arguments.toString()); } } }); @@ -44,7 +44,7 @@ class QRCaptureController { class QRCaptureView extends StatefulWidget { final QRCaptureController controller; - QRCaptureView({Key key, this.controller}) : super(key: key); + QRCaptureView({Key? key, required this.controller}) : super(key: key); @override State createState() { @@ -53,19 +53,19 @@ class QRCaptureView extends StatefulWidget { } class QRCaptureViewState extends State { - @override Widget build(BuildContext context) { if (Platform.isIOS) { return UiKitView( - viewType: 'plugins/qr_capture_view', - creationParamsCodec: StandardMessageCodec(), - onPlatformViewCreated: (id) { + viewType: 'plugins/qr_capture_view', + creationParamsCodec: StandardMessageCodec(), + onPlatformViewCreated: (id) { widget.controller._onPlatformViewCreated(id); }, ); } else { - return AndroidView(viewType: 'plugins/qr_capture_view', + return AndroidView( + viewType: 'plugins/qr_capture_view', creationParamsCodec: StandardMessageCodec(), onPlatformViewCreated: (id) { widget.controller._onPlatformViewCreated(id); @@ -73,4 +73,4 @@ class QRCaptureViewState extends State { ); } } -} \ No newline at end of file +} diff --git a/qrcode/pubspec.yaml b/qrcode/pubspec.yaml index d96f9a4..f5ef2dc 100644 --- a/qrcode/pubspec.yaml +++ b/qrcode/pubspec.yaml @@ -1,11 +1,11 @@ name: qrcode description: A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android. -version: 1.0.5 +version: 2.0.0-nullsafety.0 author: chendaxin homepage: https://github.com/SiriDx/qrcode environment: - sdk: ">=2.1.0 <3.0.0" + sdk: ">=2.12.0-0 <3.0.0" dependencies: flutter: