Skip to content

Commit

Permalink
Beta (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpruivo committed Mar 24, 2019
1 parent 43796d2 commit 8f6c488
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.3.3

**Bug fixes**
* Fixes an issue where sometimes a single file path was being returned as a `List` instead of `String`.
* `requestCode` in Android intents are now restricted to 16 bits.

## 1.3.2

**Bug fix:** Returns a `null` value in the `getFile()` when the picker is canceled.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A package that allows you to use a native file explorer to pick single or multip
First, add *file_picker* as a dependency in [your pubspec.yaml file](https://flutter.io/platform-plugins/).

```
file_picker: ^1.3.2
file_picker: ^1.3.3
```
### Android
Add `<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>` to your app `AndroidManifest.xml` file. This is required due to file caching when a path is required from a remote file (eg. Google Drive).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
/** FilePickerPlugin */
public class FilePickerPlugin implements MethodCallHandler {

private static final int REQUEST_CODE = FilePickerPlugin.class.hashCode() + 43;
private static final int PERM_CODE = FilePickerPlugin.class.hashCode() + 50;
private static final int REQUEST_CODE = (FilePickerPlugin.class.hashCode() + 43) & 0x0000ffff;
private static final int PERM_CODE = (FilePickerPlugin.class.hashCode() + 50) & 0x0000ffff;
private static final String TAG = "FilePicker";
private static final String permission = Manifest.permission.WRITE_EXTERNAL_STORAGE;

Expand Down Expand Up @@ -60,7 +60,11 @@ public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
Log.i(TAG, "[MultiFilePick] File #" + currentItem + " - URI: " +currentUri.getPath());
currentItem++;
}
result.success(paths);
if(paths.size() > 1){
result.success(paths);
} else {
result.success(paths.get(0));
}
} else if (data != null) {
Uri uri = data.getData();
Log.i(TAG, "[SingleFilePick] File URI:" +data.getData().toString());
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _FilePickerDemoState extends State<FilePickerDemo> {
),
body: new Center(
child: new Padding(
padding: const EdgeInsets.only(top: 50.0, left: 10.0, right: 10.0),
padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: new SingleChildScrollView(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: file_picker
description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extensions filtering support.
author: Miguel Ruivo <miguelpruivo@outlook.com>
author: Miguel Ruivo <miguel@miguelruivo.com>
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
version: 1.3.2
version: 1.3.3


dependencies:
Expand Down

0 comments on commit 8f6c488

Please sign in to comment.