This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[image_picker_platform_interface] Migrate image_picker to package:cross_file #4072
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4b3c599
Migrate image picker platform interface to cross_file
BeMacized 2de19b4
Merge branch 'master' into issue/70886
BeMacized 68e2ef8
Re-added old methods and marked them as deprecated.
BeMacized a987170
Format & annotate deprecated classes.
BeMacized 3fa10b9
Updated pubspec and changelog.
BeMacized 2c4cd91
Fix analysis issues for deprecations
BeMacized 29e0c40
Remove Deprecation tags so we don't break consumers of this package o…
ditman c74cebb
Merge branch 'master' into issue/70886
ditman faa1a99
Implement PR feedback
BeMacized File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
packages/image_picker/image_picker_platform_interface/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/image_picker/image_picker_platform_interface/lib/src/types/lost_data_response.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| // Copyright 2013 The Flutter 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:cross_file/cross_file.dart'; | ||
| import 'package:flutter/services.dart'; | ||
| import 'package:image_picker_platform_interface/src/types/types.dart'; | ||
|
|
||
| /// The response object of [ImagePicker.getLostData]. | ||
| /// | ||
| /// Only applies to Android. | ||
| /// See also: | ||
| /// * [ImagePicker.getLostData] for more details on retrieving lost data. | ||
| class LostDataResponse { | ||
| /// Creates an instance with the given [file], [exception], and [type]. Any of | ||
| /// the params may be null, but this is never considered to be empty. | ||
| LostDataResponse({this.file, this.exception, this.type}); | ||
|
|
||
| /// Initializes an instance with all member params set to null and considered | ||
| /// to be empty. | ||
| LostDataResponse.empty() | ||
| : file = null, | ||
| exception = null, | ||
| type = null, | ||
| _empty = true; | ||
|
|
||
| /// Whether it is an empty response. | ||
| /// | ||
| /// An empty response should have [file], [exception] and [type] to be null. | ||
| bool get isEmpty => _empty; | ||
|
|
||
| /// The file that was lost in a previous [getImage], [getMultiImage] or [getVideo] call due to MainActivity being destroyed. | ||
| /// | ||
| /// Can be null if [exception] exists. | ||
| final XFile? file; | ||
|
|
||
| /// The exception of the last [getImage], [getMultiImage] or [getVideo]. | ||
| /// | ||
| /// If the last [getImage], [getMultiImage] or [getVideo] threw some exception before the MainActivity destruction, | ||
| /// this variable keeps that exception. | ||
| /// You should handle this exception as if the [getImage], [getMultiImage] or [getVideo] got an exception when | ||
| /// the MainActivity was not destroyed. | ||
| /// | ||
| /// Note that it is not the exception that caused the destruction of the MainActivity. | ||
| final PlatformException? exception; | ||
|
|
||
| /// Can either be [RetrieveType.image] or [RetrieveType.video]; | ||
| /// | ||
| /// If the lost data is empty, this will be null. | ||
| final RetrieveType? type; | ||
|
|
||
| bool _empty = false; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.