Giter Club home page Giter Club logo

flutter_file_dialog's Introduction

flutter_file_dialog

Dialogs for picking and saving files and for picking directories in Android and in iOS.

Features

  • Supports Android (API level 19 or later) and iOS (11.0 or later).
  • Modern plugin implementation based on Kotlin (Android) and Swift (iOS).
  • Pick image files and other documents.
  • Save a file to a selected location.
  • Pick a directory and save files to the picked directory without further dialogs (Android 21 or later, iOS 13 or later).
  • iOS dialog types: document and image.
  • iOS source types: camera, photo library, saved photos album.
  • Allow user to edit the picked image in iOS.
  • Set file extension filter and mime types filter when picking a document.
  • Possibility to limit picking a file from the local device only (Android).

Examples

Pick an image file

  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType.image,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);

Pick a document

  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);

Save a file

final params = SaveFileDialogParams(sourceFilePath: "path_of_file_to_save");
final filePath = await FlutterFileDialog.saveFile(params: params);
print(filePath);

Pick a directory and save a file to the picked directory

if (!await FlutterFileDialog.isPickDirectorySupported()) {
  print("Picking directory not supported");
  return;
}

final pickedDirectory = await FlutterFileDialog.pickDirectory();

if (pickedDirectory != null) {
  final filePath = await FlutterFileDialog.saveFileToDirectory(
    directory: pickedDirectory!,
    data: file.readAsBytesSync(),
    mimeType: "image/jpeg",
    fileName: "fileName.jpeg",
    replace: true,
  );
}

Optimize picked image file using flutter_image_utilities

Use the plugin flutter_image_utilities to optimize a picked image file.

  final params = OpenFileDialogParams(
    dialogType: OpenFileDialogType.image,
    sourceType: SourceType.photoLibrary,
  );
  final filePath = await FlutterFileDialog.pickFile(params: params);
  print(filePath);

  if (filePath != null) {
    final pickedFile = File(filePath)

    // optimize the image file
    final optimizedFile = await FlutterImageUtilities.saveAsJpeg(
      sourceFile: pickedFile,
      quality: 60,
      maxWidth: 1920,
      maxHeight: 1024,
    );
  }

flutter_file_dialog's People

Contributors

allanwolski avatar asaarnak avatar doflatango avatar fauconspartiate avatar hacker1024 avatar hygehyge avatar kinex avatar richardbushnell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_file_dialog's Issues

SaveFileDialogParams : OneDrive directory is not displayed

Hello

When entering SaveFileDialogParams, I can see internal Storage, Downloads, external Storage and Google Drive.

But OneDrive is not displayed.

When I use flutter_file_picker which is another package, OneDrive is displayed.

Can you check why OneDrive is not displayed ?

Thank you.

Fatal Exception: java.lang.IllegalStateException Reply already submitted

Hi team, from our Firebase Crashlytics we always got issue about IllegalStateException from your plugin. I think this crash happen because your plugin send result.error more than one submitted.

Fatal Exception: java.lang.IllegalStateException: Reply already submitted
       at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:35)
       at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:14)
       at com.kineapps.flutter_file_dialog.FileDialog$saveFileOnBackground$1.invokeSuspend(FileDialog.java:142)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:11)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:80)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:233)
       at android.os.Looper.loop(Looper.java:334)
       at android.app.ActivityThread.main(ActivityThread.java:8396)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)

Our Environment:
[✓] Flutter (Channel unknown, 2.8.1, on macOS 12.4 21F79 darwin-arm, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.69.2)

Using specific version

flutter_file_dialog: ^2.3.0

Support for Windows ?

Hello
Flutter_file_dialog is awesome. I use it for my flutter app distributed on Android and iOS.

I would like to release my app on Windows platform.
Do you plan to support Windows ?

Thank you

Saving file with overwrite makes file unreadable by android OS

Dont understand why owner closed #27 and #39
This is the real bug, althought it is not completely from package developer. Anyway, it is fixable.

The problems in setting mime type for /, that makes android set (1) after extension.

Simple workaround is just to fork this plugin and in FIleDialog.kt remove this line in saveFile method
applyMimeTypesFilterToIntent(mimeTypesFilter, intent)

and set your mime type hardcoded:
intent.type = "audio/mpeg

@kinex ideal would be atleast ability to set your mime type directly, and not like you did in applyMimeTypesFilterToIntent.
Or actually investigate this bug and possible better workarounds.

Library is not Compatible with MinSDK < 19

My App MinSDK is set to 16. During compile, i got

Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:flutter_file_dialog] /build/flutter_file_dialog/intermediates/library_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 16

I guess the library is not compatible with SDKs lesser than 19

Unable to build for iOS.

Hi, I'm getting the following error while building for iOS.

flutter_file_dialog does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

Thanks in advance.

build issue in flutter master

C:\Users\sksso\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\flutter_file_dialog-2.3.0\android\src\main\ko
tlin\com\kineapps\flutter_file_dialog\FileDialog.kt: (30, 1): Class 'FileDialog' is not abstract and does
not implement abstract member public abstract fun onActivityResult(p0: Int, p1: Int, p2: Intent): Boolean
defined in io.flutter.plugin.common.PluginRegistry.ActivityResultListener

add option to return original path instead of a cached copy

For our project: https://gitlab.com/elRepo.io

which is a distributed file sharing app based on RetroShare, we need to be able to share existing files on the client instead of copies of them.
Would it be possible to adapt your plugin to include this option? -> return the original file path instead of making a copy. We would use this in conjunction with localOnly: true.

It is an important goal for our project to be able to share the files without using additional storage space and to share them from a non-volatile (not cache) storage because the system is P2P and it depends on the files not being deleted locally by the system when it needs space.

Please let us know if you think this is possible. We could collaborate with some humble funding to work on this feature request.

No implementation found for method saveFile on channel flutter_file_dialog

Hello,
I'm using OpenFileDialogParams pickFile;
It throws error : No implementation found for method saveFile on channel flutter_file_dialog. When not select file with this method and after close page and try savedialog file in another page
My code;
final params = OpenFileDialogParams(
dialogType: OpenFileDialogType.image,
sourceType: SourceType.photoLibrary,
);
result = await FlutterFileDialog.pickFile(params: params);
// Navigator.of(context).pop(true);
if (result != null) if (p.extension(result) != '.png' &&
p.extension(result) != '.jpeg' &&
p.extension(result) != '.jpg') {
AppService.helper.showSnackBar(
TranslateLanguage.of(context).localisedString(
'error_extension', {'ext': '.jpeg,png or jpg'}),
false,
this.context);
} else {
_path = result;
_setImageWidget();
}

Can you help?

GoogleDrive saveFile on iOS returns null filename

/// Displays a dialog for selecting a location where to save the file and
/// saves the file to the selected location.
///
/// Returns path of the saved file or null if operation was cancelled.
/// Throws exception on error.
static Future<String?> saveFile({SaveFileDialogParams? params}) {
  return _channel.invokeMethod('saveFile', params?.toJson());
}

Documentation of saveFile method says that it returns path of the saved file or null if operation was cancelled. However on iOS, saving a file on Google Drive returns null instead of the filename. Can you check it?

Cheers!

How to get the path + filename selected by the user before save the file?

@kineapps
This is making no sense to me: I need to save the file beforehand I open the dialog which allows the user to save the file? What?

//DETERMINE THE INITIAL DIRECTORY
Directory directory;
if (GetPlatform.isAndroid) {
   directory = await getExternalStorageDirectory();
} else if (GetPlatform.isIOS) {
   directory = await getApplicationDocumentsDirectory();
}

var params = SaveFileDialogParams(sourceFilePath: directory.path);
var savedPath = await FlutterFileDialog.saveFile(params: params);

//IF USER DIDN'T CANCEL, SAVE A FILE WHERE HIM CHOOSED WITH THE FILENAME RETURNED
if (savedPath != null) {
  File file = File(savedPath);
  await file.writeAsBytes(value);
}

Throws:

PlatformException (PlatformException(save_file_failed, /storage/emulated/0/Android/data/com.myapp.app/files (Is a directory), java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.myapp.app/files (Is a directory)))

Off course is a directory, I'm passing the directory and expecting the return of FlutterFileDialog.saveFile with the full path including the name of the file which the user choosed.

But then I also tried:

Directory directory;

if (GetPlatform.isAndroid) {
  directory = await getExternalStorageDirectory();
} else if (GetPlatform.isIOS) {
  directory = await getApplicationDocumentsDirectory();
}
//SET A INITIAL FILENAME ATTACHED TO THE INITIAL PATH
var fullPath = join(directory.path, 'bkp.txt');

var params = SaveFileDialogParams(sourceFilePath: fullPath);
var savedPath = await FlutterFileDialog.saveFile(params: params);
if (savedPath != null) {
  File file = File(savedPath);
  await file.writeAsBytes(value);
}

Throws:
PlatformException (PlatformException(file_not_found, Source file is missing, /storage/emulated/0/Android/data/com.myapp.app/files/bkp.txt))

How should I get the path + filename the user selected from the savedialog, when the dialog forces me to create the file beforehand? This is making no sense to me. What am I doing wrong here?

save multiple File

Would like to ask if this package will implement or builds new release that will support save multiple Files like "FlutterFileDialog.saveMultiple". Thanks

fileExtensionsFilter not filtering

version 2.2.1
Android 11

final params = OpenFileDialogParams(
        dialogType: OpenFileDialogType.document,
        allowEditing: false,
        allowedUtiTypes: [
          'json'
        ],
        fileExtensionsFilter: ['json'],
        localOnly: false,
      );
String result = await FlutterFileDialog.pickFile(params: params);

When running the following code, the files in the file-selection dialog do not filter down to just those with extension .json. Effectively, it's as if no filtering is applied. Am I doing something incorrectly with the configuration? Thank you.

How to customise save dialog appearance?

Hi!
Is there a way to customise save dialog appearance? For example I want to show some tip for user like "Please select a directory where you want to save resulted file."

Thanks.

Extra content being saved to end of file sometimes

Flutter version: Channel stable, 2.2.2
Flutter File Dialog Version: 2.1.1

String data = 'DcniWweTDQU=fM23+7wcDyCSjUpIgWf2Xb6EQr6lDj8pg6WxkjnwbJGqnAAn0VtfQk6OGJTiaJ7tCXYN5H8Woofmhjqmfdg8s88YIcbD3+SG3mILaJA18nh7Ermu28LOAoeARC8a7tyT4GjtnxrVw5YMSZfwnwi/k4g3TWAYckDqowRKhs9ZH+9CDZCIkfZ673ZnUlyjo7sn8YxCuKkKnQcT0PU028JOXwQBsvBEMeHpdYdQfrHokWplbTP/wU6SZ8OOD4dUp5O6q/jOpPBI79+O80jxmbVe3JuSTnEJQNgRVEyEjdBLVMZTRt/OSPBUncMmshJY5MxUSNSpbCetgz/8LtqUwuvBK3YAQOKZIT5gt2wRomwztJCb8THke7YaPmpKnXWytJO0cb0r5wj59DZizxloZQN00e+wJuuqDiwC3uKYoal3x/LhMBZ0ilBkXfCd2CMCBiR78XJritJoMYYqQHw5hr54DnL/66/ag/JKU91HUKzOd7xxAFMK+Meep8cClf5wmYjclyAVtARZRMn6kwpWTtaPrH9wAotgVLnki8JDbLiVFcoaxCZVipbhpmoeCD+c0CTJ/+bS2WxQEGLjd+RtQWJgX8roDa5QNgvYBmVXiNFGBJXvc5FgSJJ9jDoD8mRdID34jeRFWqBM11MzqG5jPT7GdI2iOCFPFYZzlt4hpnhWxa0bT2Q5W3KiV4LLjnoWTv4ZB8TL3IcIuUjiaUpFK8hrjQcmDDriPRKqyqUAfgkcLn+UUx6Vrbd65UB7o6POczwf5/VQnyitHqDSU0RMfRBowKGQdFLXYEb7ql+FkPMKBoSmQQSbyIV9zMFXV89tqNMLDJoQQ4OdqyU1wgqinLGbvkzIBUcInOefqGhlxU3l9givXWYSTWLmwhiIU/bR7o4w8FhsO+otLTwqvZUHVgwJAI88hCxEjekt+4s7azmp3z4jNzfzZTh4rVeaa8ye7YY='; // Set to an encrypted string value
final params = SaveFileDialogParams(
          data: encoder.convert(data),
          localOnly: true,
          fileName: "default_filename.json");

In the file selection dialog, I pick the file to save (overwriting existing file in my case) and expect that the data value alone is written to the file. Instead, an extra string is appended to the end:
GQN64bdtv84fFbW17ic6P2uOQTO4pnDz5nrlATkUMVzgbnKR+nDJQAzxhGKW3OGzIyD1JbgIWH4n2R/1IeNxvM2b/M1mZqBmakDBagYFoYK2OS1xGMThYgY=

If data is a different value, but the same length, this happens consistently. However, using a longer value the extra content is not appended. Again, the same code path is being executed on the same output file, but if the data being written is a different size (or maybe because it ends in "="?) it is being appended to with the extra string above. Any idea why?

Wrong return path on not choosing folder

Issue

When I save a file on android and do not chose a folder, but just hit save the return value is:
/document/63 (the number is counted upward)

Code, which uses this package

    String? realDownloadPath;
    if (Platform.isAndroid) {
      final params =
          SaveFileDialogParams(sourceFilePath: file?.path, localOnly: true);
      realDownloadPath =
          (await FlutterFileDialog.saveFile(params: params)) ?? file?.path;
    } 

Visuals

Peek.2021-12-14.15-59.mp4

Versions

  • Android 12
Flutter 2.8.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision cf44000065 (6 days ago) • 2021-12-08 14:06:50 -0800
Engine • revision 40a99c5951
Tools • Dart 2.15.0

DirectoryLocation custom class

Hello,

How can we instantiniate DirectoryLocation object? Because I would like to manually set a location if the user does not select a folder to save to. In this case, I can't seem to find a constructor function for DirectoryLocation and it is not castable from "Directory" class of dart:io

DirectoryLocation? pickedDirectory =
        await FlutterFileDialog.pickDirectory();

    pickedDirectory ??=
        (await getApplicationDocumentsDirectory()) as DirectoryLocation;

The above cast does not work

pub.dev release

@kinex
After the merge of #47, which solves an important breaking bug, a release should be created on pub.dev to publish the latest changes.

When is it supposed to be worked on? Is there any automated CI for it?

More than one file was found with OS independent path 'META-INF/proguard/coroutines.pro'

More than one file was found with OS independent path 'META-INF/proguard/coroutines.pro' error on dependency add and run without additional code.

Temporary fix applied to build.gradle
// Temporary fix
packagingOptions {
exclude 'META-INF/proguard/coroutines.pro'
}

[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.476], locale en-AU)
• Flutter version 1.12.13+hotfix.8 at ...
• Framework revision 0b8abb4724 (10 days ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at ...
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Android Studio (version 3.5)
• Android Studio at ...
• Flutter plugin version 43.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] Connected device (1 available)
• Redmi 6 • 672382f37d26 • android-arm • Android 8.1.0 (API 27)

• No issues found!

Return original path instead of android uri scheme

Hi,

Here from elrepo.io!

We asked for add the option to return absolute file path instead of a cached copy on #12 .

The problem now is that it return the absolute file path in Android URI scheme, like:

content://com.android.providers.media.documents/document/image%3A2355

Could you implement to get the file path in a "unix like" path format in order to don't use another plugin to translate it?

Thanks in advance

[bug][invalid_file_extension] Set file extension filter when picking a document.

When picking the file with filter by extension, it allow to choose any file regardless of the extension. And when you pick the file with unsupported extension, flutter_file_dialog just crashes with platform exception.

Code

        final params = OpenFileDialogParams(
          dialogType: OpenFileDialogType.document,
          sourceType: SourceType.photoLibrary,
          fileExtensionsFilter: [ 'pdf', 'doc', 'docx' ],
        );
        final filePath = await FlutterFileDialog.pickFile(params: params);

Exception

2022-10-01 17:49:39 +0000 [SwiftFlutterFileDialogPlugin.swift:24 handle(_:result:)] pickFile
2022-10-01 17:49:39 +0000 [OpenFileDialog.swift:20 deinit] OpenFileDialog.deinit
[DocumentManager] Failed to associate thumbnails for picked URL file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Desktop/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-09-29%20%D0%B2%2010.48.01.png with the Inbox copy file:///private/var/mobile/Containers/Data/Application/C87255ED-FC01-484D-B95F-AF1BB05FE151/tmp/com.schtandart.online-Inbox/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-09-29%20%D0%B2%2010.48.01.png: Error Domain=QLThumbnailErrorDomain Code=115 "(null)" UserInfo={NSErrorFailingURLKey=file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Desktop/%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202022-09-29%20%D0%B2%2010.48.01.png}
2022-10-01 17:49:44 +0000 [OpenFileDialog.swift:140 documentPicker(_:didPickDocumentsAt:)] didPickDocumentsAt
2022-10-01 17:49:44 +0000 [OpenFileDialog.swift:154 handlePickedFile(_:)] handlePickedFile: /private/var/mobile/Containers/Data/Application/C87255ED-FC01-484D-B95F-AF1BB05FE151/tmp/com.schtandart.online-Inbox/Снимок экрана 2022-09-29 в 10.48.01.png
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(invalid_file_extension, Invalid file type was picked, png, null)
#0      StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:653
#1      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:296
<asynchronous suspension>
#2      _MediaFieldState._takePicture
package:schtd_dealer/…/common/media_field.dart:299

Platform: iOS
Flutter 3.3.3

App crash when I want to save a file

Hello
I tried to use the following method
final params = SaveFileDialogParams(sourceFilePath: "path_of_file_to_save"); final filePath = await FlutterFileDialog.saveFile(params: params); print(filePath);

But it causes my flutter app to crash.
It opens the file dialog plugin, and it lost connexion with device...

Missing file with building for ios

on
Flutter build ipa
i got the following error:

Xcode's output:

Writing result bundle at path:
/var/folders/q0/s5vd_z2x28n4c77dbnr0pmch0000gn/T/flutter_tools.SHhPdk/flutter_ios_build_temp_diro0mndO/temporary_xcresult_bundle

1 error generated.
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order

Result bundle written to path:
    /var/folders/q0/s5vd_z2x28n4c77dbnr0pmch0000gn/T/flutter_tools.SHhPdk/flutter_ios_build_temp_diro0mndO/temporary_xcresult_bundle

Lexical or Preprocessor Issue (Xcode): 'flutter_file_dialog/flutter_file_dialog-Swift.h' file not found
/Users/tobiasschiek/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_file_dialog-2.3.0/ios/Classes/FlutterFileDialogPlugin.m:1:8

Android: path is incomplete after saveFile

The result of saveFile doesn't seems correct.
I get, for example /document/primary:MaCompta.mcae. But when I get the path with pickFile, it's work and the path is content://com.android.externalstorage.documents/document/primary%3AMaCompta.mcae.

Seems related to #15

But I am not sure about what I need to do. I already use the copyFileToCacheDir: false for pickFile but the parameter doesn't exist for save. I only need the path in order to open it (it is a sqlite db) after with sqflite openDatabase who need the path to the file.

In simple, how to get the Android URI with saveFile?

Thanks.

iOS release Flutter 1.7 build error

Hi,

Everything is working great in debug mode but when I build on iOS for release the build keeps failing on this plugin with the following error:
build/ios/Release-iphoneos/flutter_file_dialog/flutter_file_dialog.framework/flutter_file_dialog, building for
iOS-armv7 but attempting to link with file built for iOS-arm64
Undefined symbols for architecture armv7:
"OBJC_CLASS$_FlutterFileDialogPlugin", referenced from:
objc-class-ref in GeneratedPluginRegistrant.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description

I've tried to figure out how to resolve but can't pinpoint the issue.
Your help is greatly appreciated.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E287, locale en-US)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.45.0)

[✓] Connected device (1 available)

! Doctor found issues in 2 categories.
Essential-Healths-MacBook:oil_cabinet_basic oilcabinetapps$ flutter doctor -v
[✓] Flutter (Channel stable, v1.17.0, on Mac OS X 10.15.4 19E287, locale en-US)
• Flutter version 1.17.0 at /Users/oilcabinetapps/flutter
• Framework revision e6b34c2b5c (9 days ago), 2020-05-02 11:39:18 -0700
• Engine revision 540786dd51
• Dart version 2.8.1

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4.1, Build version 11E503a
• CocoaPods version 1.9.1

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.45.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.10.1

[✓] Connected device (1 available)
• iPhone SE (2nd generation) • D7591663-509B-4765-9786-9CFBC23C3B27 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-4 (simulator)

! Doctor found issues in 2 categories.

Saving file does not overwrite existing unless selected

Version 2.1.1

Here is my code to open the Save File Dialog:

final params = SaveFileDialogParams(
          data: encoder.convert(data),
          localOnly: true,
          fileName: "default_backup.json");
      String result = await FlutterFileDialog.saveFile(params: params);

The dialog opens and prepopulates with suggested file name "default_backup.json". The file already exists, so the expected behavior is that I would be prompted to overwrite the existing file, yes or no. However, it actually saves a new file called "default_backup.json (1)".

This is NOT the case if I select the file with the name "default_backup.json" from within the Save File Dialog, though. When the Save File Dialog opens, if I navigate to the "default_backup.json" file and click on it, then hit Save, I am prompted to overwrite the existing file, yes or no. I would expect that the latter behavior would also be default when not clicking on the file to overwrite explicitly.

Implemented get absolute path for Android using PickiT library

Hi,

We were facing a big problem related of how to get the absolute path of a file on Android devices. Actually, there is not a official API method to do that. Finally, we discovered PickiT library, that implement necessary code to get an absolute path from an Uri.

To use it in our project, we forked this repository and implemented necessary methods on this MR (on Gitlab by the moment):

https://gitlab.com/elRepo.io/flutter_file_dialog_pickit/-/merge_requests/1

The related changes are described on the MR description.

I think that for the moment is the only flutter plugin with this capacities, should we merge it here?

Failed building Android

Can't build neither debur nor release app.

`Running Gradle task 'assembleDebug'...
e: C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_file_dialog-2.1.0\android\src\main\kotlin\com\kineapps\flutter_file_dialog\FileDialog.kt: (30, 7): Redeclaration: FileDialog
e: C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_file_dialog-2.1.0\android\src\main\kotlin\com\kineapps\flutter_file_dialog\FlutterFileDialogPlugin.kt: (19, 7): Redeclaration: FlutterFileDialogPlugin
e: C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_file_dialog-2.1.1\android\src\main\kotlin\com\kineapps\flutter_file_dialog\FileDialog.kt: (30, 7): Redeclaration: FileDialog
e: C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_file_dialog-2.1.1\android\src\main\kotlin\com\kineapps\flutter_file_dialog\FlutterFileDialogPlugin.kt: (19, 7): Redeclaration: FlutterFileDialogPlugin
e: C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_file_dialog-2.1.1\android\src\main\kotlin\com\kineapps\flutter_file_dialog\FlutterFileDialogPlugin.kt: (35, 24): Cannot access 'doOnAttachedToEngine': it is private in 'FlutterFileDialogPlugin'
e: C:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_file_dialog-2.1.1\android\src\main\kotlin\com\kineapps\flutter_file_dialog\FlutterFileDialogPlugin.kt: (36, 24): Cannot access 'doOnAttachedToActivity': it is private in 'FlutterFileDialogPlugin'

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':flutter_file_dialog:compileDebugKotlin'.`

But in version 2.1.0 everything works fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.