Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 0452186

Browse files
Remove 'init' static method (#1108)
1 parent 98e7634 commit 0452186

File tree

5 files changed

+8
-18
lines changed

5 files changed

+8
-18
lines changed

packages/camera/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
## 0.3.0+1
2+
3+
* Remove initial method call invocation from static camera method.
4+
15
## 0.3.0
6+
27
* **Breaking change**. Migrate from the deprecated original Android Support
38
Library to AndroidX. This shouldn't result in any functional changes, but it
49
requires any Android apps using this plugin to [also

packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ public static void registerWith(Registrar registrar) {
148148
@Override
149149
public void onMethodCall(MethodCall call, final Result result) {
150150
switch (call.method) {
151-
case "init":
152-
if (camera != null) {
153-
camera.close();
154-
}
155-
result.success(null);
156-
break;
157151
case "availableCameras":
158152
try {
159153
String[] cameraNames = cameraManager.getCameraIdList();

packages/camera/ios/Classes/CameraPlugin.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,7 @@ - (instancetype)initWithRegistry:(NSObject<FlutterTextureRegistry> *)registry
633633
}
634634

635635
- (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result {
636-
if ([@"init" isEqualToString:call.method]) {
637-
if (_camera) {
638-
[_camera close];
639-
}
640-
result(nil);
641-
} else if ([@"availableCameras" isEqualToString:call.method]) {
636+
if ([@"availableCameras" isEqualToString:call.method]) {
642637
AVCaptureDeviceDiscoverySession *discoverySession = [AVCaptureDeviceDiscoverySession
643638
discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera ]
644639
mediaType:AVMediaTypeVideo

packages/camera/lib/camera.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import 'package:flutter/widgets.dart';
1010

1111
part 'camera_image.dart';
1212

13-
final MethodChannel _channel = const MethodChannel('plugins.flutter.io/camera')
14-
// TODO(amirh): remove this on when the invokeMethod update makes it to stable Flutter.
15-
// https://github.com/flutter/flutter/issues/26431
16-
// ignore: strong_mode_implicit_dynamic_method
17-
..invokeMethod('init');
13+
final MethodChannel _channel = const MethodChannel('plugins.flutter.io/camera');
1814

1915
enum CameraLensDirection { front, back, external }
2016

packages/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed and capturing images.
4-
version: 0.3.0
4+
version: 0.3.0+1
55
authors:
66
- Flutter Team <flutter-dev@googlegroups.com>
77
- Luigi Agosti <luigi@tengio.com>

0 commit comments

Comments
 (0)