Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4b3c599
Migrate image picker platform interface to cross_file
BeMacized Jun 21, 2021
c4c5de4
[image_picker] Implemented changes for cross_file migration
BeMacized Jun 21, 2021
44aa4c5
[image_picker] migrated web implementation to cross_file
BeMacized Jun 22, 2021
e39fa1f
Reverted changes to web implementation to move to separate PR
BeMacized Jun 23, 2021
f4fbd0c
[image_picker_for_web] Migration to cross_file
BeMacized Jun 23, 2021
2de19b4
Merge branch 'master' into issue/70886
BeMacized Jun 30, 2021
86f604b
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized Jun 30, 2021
7b39862
Merge branch 'issue/70886' into issue/70886-impl-android-ios
BeMacized Jun 30, 2021
68e2ef8
Re-added old methods and marked them as deprecated.
BeMacized Jun 30, 2021
d345b37
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized Jun 30, 2021
a0ab00e
Update to match platform interface changes
BeMacized Jun 30, 2021
875704e
Merge branch 'issue/70886' into issue/70886-impl-android-ios
BeMacized Jun 30, 2021
a987170
Format & annotate deprecated classes.
BeMacized Jun 30, 2021
6ab2bb0
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized Jun 30, 2021
5900446
Merge branch 'issue/70886' into issue/70886-impl-android-ios
BeMacized Jun 30, 2021
217949d
Updated to match platform interface changes
BeMacized Jun 30, 2021
3fa10b9
Updated pubspec and changelog.
BeMacized Jun 30, 2021
c1ff8b2
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized Jun 30, 2021
addfe99
Updated platform interface dependency version
BeMacized Jun 30, 2021
6d329e6
Merge branch 'issue/70886' into issue/70886-impl-android-ios
BeMacized Jun 30, 2021
aefff73
Updated changelog and pubspec version
BeMacized Jun 30, 2021
f5a4163
Updated pubspec version and changelog
BeMacized Jun 30, 2021
2c4cd91
Fix analysis issues for deprecations
BeMacized Jul 2, 2021
69969b2
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized Jul 2, 2021
129efcb
Merge branch 'issue/70886' into issue/70886-impl-android-ios
BeMacized Jul 2, 2021
29e0c40
Remove Deprecation tags so we don't break consumers of this package o…
ditman Jul 8, 2021
c74cebb
Merge branch 'master' into issue/70886
ditman Jul 8, 2021
0a082c8
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized Jul 8, 2021
043db42
Merge branch 'issue/70886' into issue/70886-impl-android-ios
BeMacized Jul 8, 2021
4615db1
Temporary platform interface reference dependency
BeMacized Jul 8, 2021
d3662f6
Merge branch 'issue/70886-impl-web' into issue/70886-impl-android-ios
BeMacized Jul 8, 2021
84ee0a2
Temporary dependency update
BeMacized Jul 8, 2021
faa1a99
Implement PR feedback
BeMacized Jul 8, 2021
afa61ab
Merge branch 'issue/70886' into issue/70886-impl-web
BeMacized Jul 8, 2021
b29ec7f
Merge branch 'issue/70886-impl-web' into issue/70886-impl-android-ios
BeMacized Jul 8, 2021
756633b
Update platform interface and web implementation dependency references
BeMacized Jul 13, 2021
c1131d5
Merge branch 'master' into issue/70886-impl-android-ios
BeMacized Jul 13, 2021
c7fd236
Update documentation
BeMacized Jul 13, 2021
8c89c99
Fix merge issues
BeMacized Jul 13, 2021
8073e7a
Fix merge issues
BeMacized Jul 13, 2021
bda48dd
Move tests of deprecated methods to new file, and ignore warnings the…
ditman Jul 14, 2021
a9534fe
Update Changelog to mention the deprecation of the current methods, a…
ditman Jul 14, 2021
e59bb03
Remove unnecessary ignore_for_file from plugin code.
ditman Jul 14, 2021
dc0e7eb
Merge branch 'master' into issue/70886-impl-android-ios
ditman Jul 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[image_picker] migrated web implementation to cross_file
  • Loading branch information
BeMacized committed Jun 22, 2021
commit 44aa4c5531ea063364be99e62e8a5a427b1b4817
5 changes: 5 additions & 0 deletions packages/image_picker/image_picker_for_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 3.0.0

* Breaking change:
* Changed all usages of PickedFile to XFile

# 2.0.0

* Migrate to null safety.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ImagePickerPlugin extends ImagePickerPlatform {
ImagePickerPlatform.instance = ImagePickerPlugin();
}

/// Returns a [PickedFile] with the image that was picked.
/// Returns a [XFile] with the image that was picked.
///
/// The `source` argument controls where the image comes from. This can
/// be either [ImageSource.camera] or [ImageSource.gallery].
Expand All @@ -47,7 +47,7 @@ class ImagePickerPlugin extends ImagePickerPlatform {
///
/// If no images were picked, the return value is null.
@override
Future<PickedFile> pickImage({
Future<XFile> pickImage({
required ImageSource source,
double? maxWidth,
double? maxHeight,
Expand All @@ -58,7 +58,7 @@ class ImagePickerPlugin extends ImagePickerPlatform {
return pickFile(accept: _kAcceptImageMimeType, capture: capture);
}

/// Returns a [PickedFile] containing the video that was picked.
/// Returns a [XFile] containing the video that was picked.
///
/// The [source] argument controls where the video comes from. This can
/// be either [ImageSource.camera] or [ImageSource.gallery].
Expand All @@ -71,7 +71,7 @@ class ImagePickerPlugin extends ImagePickerPlatform {
///
/// If no images were picked, the return value is null.
@override
Future<PickedFile> pickVideo({
Future<XFile> pickVideo({
required ImageSource source,
CameraDevice preferredCameraDevice = CameraDevice.rear,
Duration? maxDuration,
Expand All @@ -81,12 +81,12 @@ class ImagePickerPlugin extends ImagePickerPlatform {
}

/// Injects a file input with the specified accept+capture attributes, and
/// returns the PickedFile that the user selected locally.
/// returns the XFile that the user selected locally.
///
/// `capture` is only supported in mobile browsers.
/// See https://caniuse.com/#feat=html-media-capture
@visibleForTesting
Future<PickedFile> pickFile({
Future<XFile> pickFile({
String? accept,
String? capture,
}) {
Expand Down Expand Up @@ -130,13 +130,13 @@ class ImagePickerPlugin extends ImagePickerPlatform {
}

/// Monitors an <input type="file"> and returns the selected file.
Future<PickedFile> _getSelectedFile(html.FileUploadInputElement input) {
final Completer<PickedFile> _completer = Completer<PickedFile>();
Future<XFile> _getSelectedFile(html.FileUploadInputElement input) {
final Completer<XFile> _completer = Completer<XFile>();
// Observe the input until we can return something
input.onChange.first.then((event) {
final objectUrl = _handleOnChangeEvent(event);
if (!_completer.isCompleted && objectUrl != null) {
_completer.complete(PickedFile(objectUrl));
_completer.complete(XFile(objectUrl));
}
});
input.onError.first.then((event) {
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/image_picker_for_web/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: image_picker_for_web
description: Web platform implementation of image_picker
repository: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker_for_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 2.0.0
version: 3.0.0

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down