barcode_scan2 icon indicating copy to clipboard operation
barcode_scan2 copied to clipboard

[Bug] SwiftBarcodeScanPlugin.swift deprecated code

Open sarahk opened this issue 4 years ago • 2 comments

BUG REPORTS WITHOUT PROVIDING THESE INFORMATIONS WILL BE CLOSED DIRECTLY. DON'T REMOVE THE SECTIONS!

Describe the bug A build warning that .devices(for:) is deprecated

'devices(for:)' was deprecated in iOS 10.0: Use AVCaptureDeviceDiscoverySession instead. File: SwiftBarcodeScanPlugin.swift Function: public func handle Line: 23

result(AVCaptureDevice.devices(for: .video).count)

To Reproduce Steps to reproduce the behavior:

  1. Open in Xcode
  2. Build

Expected behavior Expected no error

Screenshots

Logs

Environment (please complete the following information):

  • Version of barcode_scan 4.1.4
  • Output of flutter --version:
Flutter 2.2.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f4abaa0735 (9 weeks ago) • 2021-07-01 12:46:11 -0700
Engine • revision 241c87ad80
Tools • Dart 2.13.4

Additional context Only warnings at this stage

sarahk avatar Sep 02 '21 00:09 sarahk

+1 for this

dan1229 avatar Sep 21 '21 00:09 dan1229

i have this message too:

[21:42:14]: ▸     'flashMode' was deprecated in iOS 10.0: Use AVCapturePhotoSettings.flashMode instead.
[21:42:14]: ▸     return device != nil && (device?.flashMode == AVCaptureDevice.FlashMode.on || device?.torchMode == .on)
[21:42:14]: ▸                                      ^
[21:42:14]: ▸ 'flashMode' was deprecated in iOS 10.0: Use AVCapturePhotoSettings.flashMode instead.
[21:42:14]: ▸       device.flashMode = on ? .on : .off
[21:42:14]: ▸              ^

redDwarf03 avatar Jan 06 '22 20:01 redDwarf03