Giter Club home page Giter Club logo

Comments (15)

lookfirst avatar lookfirst commented on June 20, 2024 1

@victor5171

  barcode_scan:
    git: https://github.com/apptreesoftware/flutter_barcode_reader
    ref: 39ecc57bc0eef7b0465c891d900d2fb1f34a2390

from flutter_barcode_reader.

jakolion avatar jakolion commented on June 20, 2024

Fixed with the mentioned merge request #55 and release 0.0.8. Can be closed.

from flutter_barcode_reader.

lauraseidler avatar lauraseidler commented on June 20, 2024

@jakolion do you get the FormatException on iOS? For me the scanner now stops and disappears, but I get neither an exception (not even in the last general catch block), nor a result.

from flutter_barcode_reader.

jakolion avatar jakolion commented on June 20, 2024

@jakolion do you get the FormatException on iOS? For me the scanner now stops and disappears, but I get neither an exception (not even in the last general catch block), nor a result.

You are describing the behavior I had before version 0.0.8. The scanner disappeared and the previous page was shown but it was still running in the background.
With release 0.0.8 it worked the same way as before and throws the FormatException when canceling.
https://pub.dartlang.org/packages/barcode_scan/versions/0.0.8

from flutter_barcode_reader.

lauraseidler avatar lauraseidler commented on June 20, 2024

You are describing the behavior I had before version 0.0.8. The scanner disappeared and the previous page was shown but it was still running in the background.

Not quite - the scanner is off, as far as I can see, but I'm still not getting any Exception (or empty result). It feels like the Future is somehow not resolving at all (and I have 0.0.8).

from flutter_barcode_reader.

jakolion avatar jakolion commented on June 20, 2024

Not quite - the scanner is off, as far as I can see, but I'm still not getting any Exception (or empty result). It feels like the Future is somehow not resolving at all (and I have 0.0.8).

After cancelling the scanner was still active in line 3 of my code above. There wasn't any result or exception as well. If you are really using version 0.0.8 then I don't have any idea. Currently it's working fine for me.

from flutter_barcode_reader.

theneedyguy avatar theneedyguy commented on June 20, 2024

I have the same issue. The app on iOS does not throw the format exception when I press cancel. Using 0.0.8 too.

from flutter_barcode_reader.

mdudek avatar mdudek commented on June 20, 2024

I'm facing same issue as @theneedyguy with version 0.0.8.

from flutter_barcode_reader.

ricpar11 avatar ricpar11 commented on June 20, 2024

still having this error in version 1.0.0, any fix?

from flutter_barcode_reader.

JohanSnygg avatar JohanSnygg commented on June 20, 2024

I have no way of testing this, but I may have a fix if someone could test it out and then commit it to the branch.

in the file BarcodeScannerViewController.m change the method "cancel" to:

- (void)cancel {
[self.delegate barcodeScannerViewController:self didFailWithErrorCode:@"USER_CANCELED"];
[self dismissViewControllerAnimated:true completion:nil];
}

and in barcode_scan.dart add:

static const UserCancelled = 'USER_CANCELED';

for use in exception handling around BarcodeScanner.scan();

Hope this helps

from flutter_barcode_reader.

duskmont avatar duskmont commented on June 20, 2024

I have the same issue when using 1.0.0

from flutter_barcode_reader.

ashkryab avatar ashkryab commented on June 20, 2024

I have the same issue 1.0.0

from flutter_barcode_reader.

lookfirst avatar lookfirst commented on June 20, 2024

Ok, I figured it out, something just started working after resetting my codebase:

Per instructions from @JohanSnygg above. This seems pretty obvious now... cancel is called, but nothing is returned, so the Future in Dart never completes...

- (void)cancel {
    [self.delegate barcodeScannerViewController:self didFailWithErrorCode:@"USER_CANCELED"];
    [self dismissViewControllerAnimated:true completion:nil];
}

Now we can check for the PlatformException:

class BarcodeScanner {
  static const CameraAccessDenied = 'PERMISSION_NOT_GRANTED';
  static const UserCanceled = 'USER_CANCELED';
  static const MethodChannel _channel =
      const MethodChannel('com.apptreesoftware.barcode_scan');
  static Future<String> scan() async => await _channel.invokeMethod('scan');
}

I think this was the final goodness, change to copy (Also fixes warning in xcode)...

@property(nonatomic, copy) FlutterResult result;

from flutter_barcode_reader.

victor5171 avatar victor5171 commented on June 20, 2024

Hello! Do you have any ideas when this fixed version will be published at Dart's Repository?

from flutter_barcode_reader.

devtronic avatar devtronic commented on June 20, 2024

@victor5171 A new version is available

from flutter_barcode_reader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.