소스 검색

refactor: changed onPermissionSet argument to non nullable

flutter-beta
Julian Steenbakker 5 년 전
부모
커밋
0d0ae75ed6
No known key found for this signature in database GPG 키 ID: 16E437C7A3D94250
1개의 변경된 파일4개의 추가작업 그리고 5개의 파일을 삭제
  1. +4
    -5
      lib/src/qr_code_scanner.dart

+ 4
- 5
lib/src/qr_code_scanner.dart 파일 보기

@@ -14,7 +14,7 @@ import 'types/camera_exception.dart';
import 'types/features.dart';

typedef QRViewCreatedCallback = void Function(QRViewController);
typedef PermissionSetCallback = void Function(QRViewController, bool?);
typedef PermissionSetCallback = void Function(QRViewController, bool);

/// The [QRView] is the view where the camera
/// and the barcode scanner gets displayed.
@@ -198,15 +198,14 @@ class QRViewController {
}
break;
case 'onPermissionSet':
await getSystemFeatures(); // if we have no permission all features will not be available
if (call.arguments != null) {
if (call.arguments as bool) {
if (call.arguments != null && call.arguments is bool) {
if (call.arguments) {
_hasPermissions = true;
} else {
_hasPermissions = false;
}
if (onPermissionSet != null) {
onPermissionSet(this, call.arguments as bool?);
onPermissionSet(this, call.arguments);
}
}
break;


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