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

Commit

Permalink
Merge branch 'master' into camera_federated
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom committed Nov 11, 2020
2 parents d98a51e + 06530f9 commit 96b40fc
Show file tree
Hide file tree
Showing 18 changed files with 437 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Expand Up @@ -163,7 +163,7 @@ task:
- name: build-ipas+drive-examples
env:
PATH: $PATH:/usr/local/bin
PLUGINS_TO_SKIP_XCTESTS: "battery/battery,camera,connectivity/connectivity,device_info/device_info,espresso,google_maps_flutter/google_maps_flutter,google_sign_in/google_sign_in,image_picker/image_picker,in_app_purchase,integration_test,ios_platform_images,local_auth,package_info,path_provider/path_provider,quick_actions,sensors,shared_preferences/shared_preferences,url_launcher/url_launcher,video_player/video_player,webview_flutter,wifi_info_flutter/wifi_info_flutter"
PLUGINS_TO_SKIP_XCTESTS: "battery/battery,camera/camera,connectivity/connectivity,device_info/device_info,espresso,google_maps_flutter/google_maps_flutter,google_sign_in/google_sign_in,in_app_purchase,integration_test,ios_platform_images,local_auth,package_info,path_provider/path_provider,quick_actions,sensors,shared_preferences/shared_preferences,url_launcher/url_launcher,video_player/video_player,webview_flutter,wifi_info_flutter/wifi_info_flutter"
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
Expand Down
8 changes: 8 additions & 0 deletions packages/camera/camera/CHANGELOG.md
@@ -1,3 +1,11 @@
## 0.5.8+16

* Moved package to camera/camera subdir, to allow for federated implementations.

## 0.5.8+15

* Added the `debugCheckIsDisposed` method which can be used in debug mode to validate if the `CameraController` class has been disposed.

## 0.5.8+14

* Changed the order of the setters for `mediaRecorder` in `MediaRecorderBuilder.java` to make it more readable.
Expand Down
7 changes: 7 additions & 0 deletions packages/camera/camera/lib/camera.dart
Expand Up @@ -307,6 +307,13 @@ class CameraController extends ValueNotifier<CameraValue> {
StreamSubscription<dynamic> _imageStreamSubscription;
Completer<void> _creatingCompleter;

/// Checks whether [CameraController.dispose] has completed successfully.
///
/// This is a no-op when asserts are disabled.
void debugCheckIsDisposed() {
assert(_isDisposed);
}

/// Initializes the camera on the device.
///
/// Throws a [CameraException] if the initialization fails.
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera/pubspec.yaml
Expand Up @@ -2,8 +2,8 @@ name: camera
description: A Flutter plugin for getting information about and controlling the
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
and streaming image buffers to dart.
version: 0.5.8+14
homepage: https://github.com/flutter/plugins/tree/master/packages/camera
version: 0.5.8+16
homepage: https://github.com/flutter/plugins/tree/master/packages/camera/camera

dependencies:
flutter:
Expand Down
44 changes: 44 additions & 0 deletions packages/camera/camera/test/camera_test.dart
@@ -0,0 +1,44 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:camera/camera.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
group('camera', () {
test('debugCheckIsDisposed should not throw assertion error when disposed',
() {
final MockCameraDescription description = MockCameraDescription();
final CameraController controller = CameraController(
description,
ResolutionPreset.low,
);

controller.dispose();

expect(controller.debugCheckIsDisposed, returnsNormally);
});

test('debugCheckIsDisposed should throw assertion error when not disposed',
() {
final MockCameraDescription description = MockCameraDescription();
final CameraController controller = CameraController(
description,
ResolutionPreset.low,
);

expect(
() => controller.debugCheckIsDisposed(),
throwsAssertionError,
);
});
});
}

class MockCameraDescription extends CameraDescription {
@override
CameraLensDirection get lensDirection => CameraLensDirection.back;

@override
String get name => 'back';
}
@@ -1,3 +1,7 @@
## 1.0.1

* Allow type groups that allow any file.

## 1.0.0

* Initial release.
Expand Up @@ -5,18 +5,16 @@
/// A set of allowed XTypes
class XTypeGroup {
/// Creates a new group with the given label and file extensions.
///
/// A group with none of the type options provided indicates that any type is
/// allowed.
XTypeGroup({
this.label,
this.extensions,
this.mimeTypes,
this.macUTIs,
this.webWildCards,
}) : assert(
!((extensions == null || extensions.isEmpty) &&
(mimeTypes == null || mimeTypes.isEmpty) &&
(macUTIs == null || macUTIs.isEmpty) &&
(webWildCards == null || webWildCards.isEmpty)),
"At least one type must be provided for an XTypeGroup.");
});

/// The 'name' or reference to this group of types
final String label;
Expand Down
Expand Up @@ -3,7 +3,7 @@ description: A common platform interface for the file_selector plugin.
homepage: https://github.com/flutter/plugins/tree/master/packages/file_selector/file_selector_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 1.0.0
version: 1.0.1

dependencies:
flutter:
Expand Down
Expand Up @@ -7,10 +7,6 @@ import 'package:file_selector_platform_interface/file_selector_platform_interfac

void main() {
group('XTypeGroup', () {
test('fails assertion with no parameters set', () {
expect(() => XTypeGroup(), throwsAssertionError);
});

test('toJSON() creates correct map', () {
final label = 'test group';
final extensions = ['.txt', '.jpg'];
Expand All @@ -33,5 +29,17 @@ void main() {
expect(jsonMap['macUTIs'], macUTIs);
expect(jsonMap['webWildCards'], webWildCards);
});

test('A wildcard group can be created', () {
final group = XTypeGroup(
label: 'Any',
);

final jsonMap = group.toJSON();
expect(jsonMap['extensions'], null);
expect(jsonMap['mimeTypes'], null);
expect(jsonMap['macUTIs'], null);
expect(jsonMap['webWildCards'], null);
});
});
}
4 changes: 4 additions & 0 deletions packages/image_picker/image_picker/CHANGELOG.md
@@ -1,3 +1,7 @@
## 0.6.7+14

* Set up XCUITests.

## 0.6.7+13

* Update documentation of `getImage()` about HEIC images.
Expand Down

0 comments on commit 96b40fc

Please sign in to comment.