Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #134 from brandon8863/master
Browse files Browse the repository at this point in the history
Fix dart future not returning on cancel
  • Loading branch information
matthewtsmith authored Jul 30, 2019
2 parents 4271490 + 73c7a7e commit 39ecc57
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Classes/BarcodeScanPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

@interface BarcodeScanPlugin : NSObject<FlutterPlugin, BarcodeScannerViewControllerDelegate>

@property(nonatomic, retain) FlutterResult result;
@property(nonatomic, copy) FlutterResult result;
@property (nonatomic, assign) UIViewController *hostViewController;
@end
1 change: 1 addition & 0 deletions ios/Classes/BarcodeScannerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ - (void)startScan {
}

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

Expand Down
1 change: 1 addition & 0 deletions lib/barcode_scan.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/services.dart';

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');
Expand Down

1 comment on commit 39ecc57

@Lalrinfela
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Matthew,

With the new iOS 13, the scan initial page is behaving a little weird. Can you please look into it.

Thanks.

Please sign in to comment.