diff --git a/.gitignore b/.gitignore index 2e53f0f..56123cc 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,77 @@ example/ios/Flutter/App.framework example/ios/Flutter/Flutter.framework example/ios/Flutter/flutter_assets example/ios/Pods +example/android/gradle/* + +# Miscellaneous +*.class +*.lock +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# Visual Studio Code related +.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java +android/gradle/* + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dd77bc..60ba6c6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.3.0 +* **Breaking change** Migrate to AndroidX on android support library. +If you are using the android support library and you want to use that version, you should migrate to Androidx your project. + +## 0.2.0 +* Added title and description as a parameter + ## 0.1.0 * Add return saved file path * Add save screenshot sample diff --git a/android/build.gradle b/android/build.gradle index 57884a4..ee8015c 100755 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:3.2.0' } } @@ -22,11 +22,11 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 27 + compileSdkVersion 28 defaultConfig { minSdkVersion 16 - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' @@ -34,5 +34,5 @@ android { } dependencies { - api 'com.android.support:appcompat-v7:27.1.0' + api 'androidx.core:core:1.0.0' } diff --git a/android/image_picker_saver.iml b/android/image_picker_saver.iml index 103c3bb..a90ca53 100644 --- a/android/image_picker_saver.iml +++ b/android/image_picker_saver.iml @@ -24,8 +24,8 @@ - - + + @@ -35,13 +35,6 @@ - - - - - - - @@ -49,6 +42,13 @@ + + + + + + + @@ -73,63 +73,43 @@ - - - - - + + + - - - - - - - - - - - + + - + - - - + - - - - - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerDelegate.java b/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerDelegate.java index 94090c6..80bf5f2 100755 --- a/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerDelegate.java +++ b/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerDelegate.java @@ -12,15 +12,15 @@ import android.media.MediaScannerConnection; import android.net.Uri; import android.provider.MediaStore; -import android.support.annotation.VisibleForTesting; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.FileProvider; import java.io.File; import java.io.IOException; import java.util.List; import java.util.UUID; +import androidx.annotation.VisibleForTesting; +import androidx.core.app.ActivityCompat; +import androidx.core.content.FileProvider; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.PluginRegistry; @@ -282,7 +282,11 @@ public void saveImageToGallery(MethodCall methodCall, MethodChannel.Result resul //Bitmap bitmap = BitmapFactory.decodeByteArray(fileData, 0, fileData.length); - String filePath = CapturePhotoUtils.insertImage(activity.getContentResolver(), fileData, "Camera", "123"); + String title = methodCall.argument("title") == null? "Camera": methodCall.argument("title").toString(); + + String desctiption = methodCall.argument("description") == null? "123": methodCall.argument("description").toString(); + + String filePath = CapturePhotoUtils.insertImage(activity.getContentResolver(), fileData, title, desctiption); finishWithSuccess(filePath); diff --git a/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerFileProvider.java b/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerFileProvider.java index dfdba49..cfad993 100755 --- a/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerFileProvider.java +++ b/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerFileProvider.java @@ -1,6 +1,7 @@ package io.flutter.plugins.imagepickersaver; -import android.support.v4.content.FileProvider; + +import androidx.core.content.FileProvider; /** * Providing a custom {@code FileProvider} prevents manifest {@code } name collisions. diff --git a/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerSaverPlugin.java b/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerSaverPlugin.java index d7f16e4..5e4e4ee 100755 --- a/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerSaverPlugin.java +++ b/android/src/main/java/io/flutter/plugins/imagepickersaver/ImagePickerSaverPlugin.java @@ -5,11 +5,11 @@ package io.flutter.plugins.imagepickersaver; import android.os.Environment; -import android.support.annotation.VisibleForTesting; import java.io.File; import java.io.IOException; +import androidx.annotation.VisibleForTesting; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.PluginRegistry; diff --git a/example/android/.idea/libraries/Gradle____local_aars____home_nadia_AndroidStudioProjects_image_picker_saver_example_build_app_intermediates_flutter_flutter_x86_jar_unspecified_jar.xml b/example/android/.idea/libraries/Gradle____local_aars____home_nadia_AndroidStudioProjects_image_picker_saver_example_build_app_intermediates_flutter_flutter_x86_jar_unspecified_jar.xml new file mode 100644 index 0000000..c6a9ab6 --- /dev/null +++ b/example/android/.idea/libraries/Gradle____local_aars____home_nadia_AndroidStudioProjects_image_picker_saver_example_build_app_intermediates_flutter_flutter_x86_jar_unspecified_jar.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle____local_aars____home_nadia_flutter_bin_cache_artifacts_engine_android_arm_flutter_jar_unspecified_jar.xml b/example/android/.idea/libraries/Gradle____local_aars____home_nadia_flutter_bin_cache_artifacts_engine_android_arm_flutter_jar_unspecified_jar.xml new file mode 100644 index 0000000..d21010e --- /dev/null +++ b/example/android/.idea/libraries/Gradle____local_aars____home_nadia_flutter_bin_cache_artifacts_engine_android_arm_flutter_jar_unspecified_jar.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_core_common_1_1_0_jar.xml b/example/android/.idea/libraries/Gradle__android_arch_core_common_1_1_0_jar.xml new file mode 100644 index 0000000..9869803 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_core_common_1_1_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_core_common_1_1_1_jar.xml b/example/android/.idea/libraries/Gradle__android_arch_core_common_1_1_1_jar.xml new file mode 100644 index 0000000..bf16fff --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_core_common_1_1_1_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_core_runtime_1_1_0_aar.xml b/example/android/.idea/libraries/Gradle__android_arch_core_runtime_1_1_0_aar.xml new file mode 100644 index 0000000..e8aeb8a --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_core_runtime_1_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_1_0_jar.xml b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_1_0_jar.xml new file mode 100644 index 0000000..29c0049 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_1_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_1_1_jar.xml b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_1_1_jar.xml new file mode 100644 index 0000000..27b1867 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_common_1_1_1_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_lifecycle_livedata_core_1_1_0_aar.xml b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_livedata_core_1_1_0_aar.xml new file mode 100644 index 0000000..c31cd9d --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_livedata_core_1_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_1_0_aar.xml b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_1_0_aar.xml new file mode 100644 index 0000000..610a8d6 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_1_1_aar.xml b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_1_1_aar.xml new file mode 100644 index 0000000..a6a88ce --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_runtime_1_1_1_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__android_arch_lifecycle_viewmodel_1_1_0_aar.xml b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_viewmodel_1_1_0_aar.xml new file mode 100644 index 0000000..dffe351 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__android_arch_lifecycle_viewmodel_1_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml b/example/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml new file mode 100644 index 0000000..3fea121 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml b/example/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml new file mode 100644 index 0000000..83e1a45 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml b/example/android/.idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml new file mode 100644 index 0000000..2fee65b --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_collection_collection_1_0_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml b/example/android/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml new file mode 100644 index 0000000..d693277 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml b/example/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml new file mode 100644 index 0000000..f2e418b --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml b/example/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml new file mode 100644 index 0000000..3a1ea22 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_0_aar.xml b/example/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_0_aar.xml new file mode 100644 index 0000000..47dcb97 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_0_aar.xml b/example/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_0_aar.xml new file mode 100644 index 0000000..9233339 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_test_monitor_1_1_0_aar.xml b/example/android/.idea/libraries/Gradle__androidx_test_monitor_1_1_0_aar.xml new file mode 100644 index 0000000..eefcb61 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_test_monitor_1_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_test_runner_1_1_0_aar.xml b/example/android/.idea/libraries/Gradle__androidx_test_runner_1_1_0_aar.xml new file mode 100644 index 0000000..5e3bd5b --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_test_runner_1_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml b/example/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml new file mode 100644 index 0000000..fcc3c88 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_animated_vector_drawable_27_1_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_animated_vector_drawable_27_1_0_aar.xml new file mode 100644 index 0000000..dc045e7 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_animated_vector_drawable_27_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_27_1_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_27_1_0_aar.xml new file mode 100644 index 0000000..9d5c7d7 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_appcompat_v7_27_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_collections_28_0_0_jar.xml b/example/android/.idea/libraries/Gradle__com_android_support_collections_28_0_0_jar.xml new file mode 100644 index 0000000..80e4d73 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_collections_28_0_0_jar.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_27_1_0_jar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_27_1_0_jar.xml new file mode 100644 index 0000000..0553925 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_27_1_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_27_1_1_jar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_27_1_1_jar.xml new file mode 100644 index 0000000..1517ad9 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_27_1_1_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_28_0_0_jar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_28_0_0_jar.xml new file mode 100644 index 0000000..0fdecce --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_annotations_28_0_0_jar.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_compat_27_1_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_compat_27_1_0_aar.xml new file mode 100644 index 0000000..daea53a --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_compat_27_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_compat_28_0_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_compat_28_0_0_aar.xml new file mode 100644 index 0000000..49137b3 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_compat_28_0_0_aar.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_core_ui_27_1_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_core_ui_27_1_0_aar.xml new file mode 100644 index 0000000..3246ada --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_core_ui_27_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_core_utils_27_1_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_core_utils_27_1_0_aar.xml new file mode 100644 index 0000000..9a79414 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_core_utils_27_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_fragment_27_1_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_fragment_27_1_0_aar.xml new file mode 100644 index 0000000..3843c2b --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_fragment_27_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_support_vector_drawable_27_1_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_support_vector_drawable_27_1_0_aar.xml new file mode 100644 index 0000000..b3978c4 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_support_vector_drawable_27_1_0_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml new file mode 100644 index 0000000..7096f33 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_core_3_0_2_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml new file mode 100644 index 0000000..494c065 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_test_espresso_espresso_idling_resource_3_0_2_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_test_monitor_1_0_2_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_test_monitor_1_0_2_aar.xml new file mode 100644 index 0000000..38868d1 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_test_monitor_1_0_2_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_test_runner_1_0_2_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_test_runner_1_0_2_aar.xml new file mode 100644 index 0000000..014e011 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_test_runner_1_0_2_aar.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_android_support_versionedparcelable_28_0_0_aar.xml b/example/android/.idea/libraries/Gradle__com_android_support_versionedparcelable_28_0_0_aar.xml new file mode 100644 index 0000000..9db3c99 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_android_support_versionedparcelable_28_0_0_aar.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml b/example/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml new file mode 100644 index 0000000..947e251 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1_jar.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml b/example/android/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml new file mode 100644 index 0000000..5c4dd4e --- /dev/null +++ b/example/android/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml b/example/android/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml new file mode 100644 index 0000000..f9c9a30 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__javax_inject_javax_inject_1_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__junit_junit_4_12_jar.xml b/example/android/.idea/libraries/Gradle__junit_junit_4_12_jar.xml new file mode 100644 index 0000000..f4f25a8 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__junit_junit_4_12_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_1_8_0_jar.xml b/example/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_1_8_0_jar.xml new file mode 100644 index 0000000..e728252 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_1_8_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_agent_1_8_0_jar.xml b/example/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_agent_1_8_0_jar.xml new file mode 100644 index 0000000..01c5f06 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_agent_1_8_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml b/example/android/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml new file mode 100644 index 0000000..5855a29 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml b/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml new file mode 100644 index 0000000..50cf2b9 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml b/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml new file mode 100644 index 0000000..a5eaca5 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml b/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml new file mode 100644 index 0000000..b4dabdc --- /dev/null +++ b/example/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__org_mockito_mockito_core_2_17_0_jar.xml b/example/android/.idea/libraries/Gradle__org_mockito_mockito_core_2_17_0_jar.xml new file mode 100644 index 0000000..0bd8e28 --- /dev/null +++ b/example/android/.idea/libraries/Gradle__org_mockito_mockito_core_2_17_0_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/.idea/libraries/Gradle__org_objenesis_objenesis_2_6_jar.xml b/example/android/.idea/libraries/Gradle__org_objenesis_objenesis_2_6_jar.xml new file mode 100644 index 0000000..c6fc69c --- /dev/null +++ b/example/android/.idea/libraries/Gradle__org_objenesis_objenesis_2_6_jar.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/app/app.iml b/example/android/app/app.iml new file mode 100644 index 0000000..6a07b30 --- /dev/null +++ b/example/android/app/app.iml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index e689c0a..225fa78 100755 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -15,7 +15,7 @@ apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 27 + compileSdkVersion 28 lintOptions { disable 'InvalidPackage' @@ -23,9 +23,9 @@ android { defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 applicationId "io.flutter.plugins.imagepicker.example" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -48,6 +48,6 @@ flutter { dependencies { testImplementation 'junit:junit:4.12' testImplementation 'org.mockito:mockito-core:2.17.0' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + androidTestImplementation 'androidx.test:runner:1.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' } diff --git a/example/android/build.gradle b/example/android/build.gradle index d4225c7..e81b1a1 100755 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.1.2' + classpath 'com.android.tools.build:gradle:3.2.0' } } diff --git a/example/android/gradlew b/example/android/gradlew index 9d82f78..cccdd3d 100755 --- a/example/android/gradlew +++ b/example/android/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -6,20 +6,38 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +48,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,26 +59,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -85,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -150,11 +154,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/example/android/gradlew.bat b/example/android/gradlew.bat index 8a0b282..e95643d 100644 --- a/example/android/gradlew.bat +++ b/example/android/gradlew.bat @@ -1,90 +1,84 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/example/ios/Flutter/Generated.xcconfig b/example/ios/Flutter/Generated.xcconfig index 5019e91..91c7f72 100644 --- a/example/ios/Flutter/Generated.xcconfig +++ b/example/ios/Flutter/Generated.xcconfig @@ -1,9 +1,7 @@ // This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/hefang/development/flutter -FLUTTER_APPLICATION_PATH=/Users/hefang/Documents/workspace/image_picker_saver/example -FLUTTER_TARGET=/Users/hefang/Documents/workspace/image_picker_saver/example/lib/main.dart -FLUTTER_BUILD_MODE=debug +FLUTTER_ROOT=/home/nadia/flutter +FLUTTER_APPLICATION_PATH=/home/nadia/AndroidStudioProjects/image_picker_saver/example +FLUTTER_TARGET=lib/main.dart FLUTTER_BUILD_DIR=build SYMROOT=${SOURCE_ROOT}/../build/ios -FLUTTER_FRAMEWORK_DIR=/Users/hefang/development/flutter/bin/cache/artifacts/engine/ios -PREVIEW_DART_2=true +FLUTTER_FRAMEWORK_DIR=/home/nadia/flutter/bin/cache/artifacts/engine/ios diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 5e6efe5..f49de9c 100755 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -2,9 +2,9 @@ name: image_picker_example description: Demonstrates how to use the image_picker plugin. dependencies: - video_player: "0.5.2" + video_player: ^0.10.0 http: ^0.11.3+15 - path_provider: ^0.4.1 + path_provider: ^0.5.0 flutter: sdk: flutter image_picker_saver: diff --git a/lib/image_picker_saver.dart b/lib/image_picker_saver.dart index b8f347a..60b5479 100755 --- a/lib/image_picker_saver.dart +++ b/lib/image_picker_saver.dart @@ -71,13 +71,15 @@ class ImagePickerSaver { return path == null ? null : new File(path); } - static Future saveFile({@required Uint8List fileData}) async { + static Future saveFile({@required Uint8List fileData, String title, String description}) async { assert(fileData != null); String filePath = await _channel.invokeMethod( 'saveFile', { 'fileData': fileData, + 'title': title, + 'description': description }, ); debugPrint("saved filePath:" + filePath); diff --git a/pubspec.yaml b/pubspec.yaml index 6818630..afad23d 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ authors: - Aaron Ho homepage: https://github.com/cnhefang/image_picker_saver -version: 0.1.0 +version: 0.3.0 flutter: plugin: