├── .gitignore
├── README.md
├── __assets__
├── android_crop_circular.png
├── android_crop_demo.gif
├── android_crop_square.png
├── android_picker_sample.gif
├── android_picker_screen.png
├── ios_crop_circular.png
├── ios_crop_demo.gif
├── ios_crop_square.png
├── ios_picker_demo.gif
├── ios_picker_screen.png
├── limited_access_alert.jpg
└── localize_camera.png
├── hl_image_picker
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── example
│ ├── .gitignore
│ ├── .metadata
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android
│ │ ├── .gitignore
│ │ ├── app
│ │ │ ├── build.gradle
│ │ │ └── src
│ │ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ │ ├── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── res
│ │ │ │ │ ├── drawable-v21
│ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── values-night
│ │ │ │ │ └── styles.xml
│ │ │ │ │ └── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ └── gradle-wrapper.properties
│ │ └── settings.gradle
│ ├── ios
│ │ ├── .gitignore
│ │ ├── Flutter
│ │ │ ├── AppFrameworkInfo.plist
│ │ │ ├── Debug.xcconfig
│ │ │ └── Release.xcconfig
│ │ ├── Podfile
│ │ ├── Runner.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ └── xcshareddata
│ │ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ ├── Runner.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ ├── Runner
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── LaunchImage.imageset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── LaunchImage.png
│ │ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ │ └── README.md
│ │ │ ├── Base.lproj
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── Info.plist
│ │ │ └── Runner-Bridging-Header.h
│ │ └── RunnerTests
│ │ │ └── RunnerTests.swift
│ ├── lib
│ │ ├── main.dart
│ │ └── widgets
│ │ │ ├── aspect_ratio_select.dart
│ │ │ ├── custom_switch.dart
│ │ │ ├── increase_decrease.dart
│ │ │ ├── media_preview.dart
│ │ │ └── media_type_select.dart
│ └── pubspec.yaml
├── lib
│ └── hl_image_picker.dart
└── pubspec.yaml
├── hl_image_picker_android
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── src
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── yalantis
│ │ │ │ └── ucrop
│ │ │ │ ├── OkHttpClientStore.java
│ │ │ │ ├── UCrop.java
│ │ │ │ ├── UCropActivity.java
│ │ │ │ ├── UCropDevelopConfig.java
│ │ │ │ ├── UCropFragment.java
│ │ │ │ ├── UCropFragmentCallback.java
│ │ │ │ ├── UCropGalleryAdapter.java
│ │ │ │ ├── UCropImageEngine.java
│ │ │ │ ├── UCropMultipleActivity.java
│ │ │ │ ├── callback
│ │ │ │ ├── BitmapCropCallback.java
│ │ │ │ ├── BitmapLoadCallback.java
│ │ │ │ ├── CropBoundsChangeListener.java
│ │ │ │ └── OverlayViewChangeListener.java
│ │ │ │ ├── decoration
│ │ │ │ └── GridSpacingItemDecoration.java
│ │ │ │ ├── model
│ │ │ │ ├── AspectRatio.java
│ │ │ │ ├── CropParameters.java
│ │ │ │ ├── CustomIntentKey.java
│ │ │ │ ├── ExifInfo.java
│ │ │ │ └── ImageState.java
│ │ │ │ ├── statusbar
│ │ │ │ ├── ImmersiveManager.java
│ │ │ │ ├── LightStatusBarUtils.java
│ │ │ │ └── RomUtils.java
│ │ │ │ ├── task
│ │ │ │ ├── BitmapCropTask.java
│ │ │ │ └── BitmapLoadTask.java
│ │ │ │ ├── util
│ │ │ │ ├── BitmapLoadUtils.java
│ │ │ │ ├── CubicEasing.java
│ │ │ │ ├── DensityUtil.java
│ │ │ │ ├── EglUtils.java
│ │ │ │ ├── FastBitmapDrawable.java
│ │ │ │ ├── FileUtils.java
│ │ │ │ ├── ImageHeaderParser.java
│ │ │ │ ├── RectUtils.java
│ │ │ │ ├── RotationGestureDetector.java
│ │ │ │ └── SelectedStateListDrawable.java
│ │ │ │ └── view
│ │ │ │ ├── CropImageView.java
│ │ │ │ ├── GestureCropImageView.java
│ │ │ │ ├── OverlayView.java
│ │ │ │ ├── TransformImageView.java
│ │ │ │ ├── UCropView.java
│ │ │ │ └── widget
│ │ │ │ ├── AspectRatioTextView.java
│ │ │ │ └── HorizontalProgressWheelView.java
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── howl
│ │ │ │ └── hl_image_picker
│ │ │ │ ├── CustomLoadingDialog.kt
│ │ │ │ ├── GlideEngine.kt
│ │ │ │ ├── HLImagePickerPlugin.kt
│ │ │ │ ├── ImageFileCompressEngine.kt
│ │ │ │ ├── ImageFileCropEngine.kt
│ │ │ │ ├── ImageLoaderUtils.kt
│ │ │ │ └── VideoThumbnailListener.kt
│ │ └── res
│ │ │ ├── anim
│ │ │ ├── ucrop_item_animation_fall_down.xml
│ │ │ ├── ucrop_layout_animation_fall_down.xml
│ │ │ ├── ucrop_loader_circle_path.xml
│ │ │ └── ucrop_loader_circle_scale.xml
│ │ │ ├── color
│ │ │ └── ucrop_scale_text_view_selector.xml
│ │ │ ├── drawable-hdpi
│ │ │ ├── ucrop_ic_angle.png
│ │ │ └── ucrop_ic_done.png
│ │ │ ├── drawable-ldpi
│ │ │ ├── ucrop_ic_angle.png
│ │ │ └── ucrop_ic_done.png
│ │ │ ├── drawable-mdpi
│ │ │ ├── ucrop_ic_angle.png
│ │ │ └── ucrop_ic_done.png
│ │ │ ├── drawable-xhdpi
│ │ │ ├── ucrop_ic_angle.png
│ │ │ └── ucrop_ic_done.png
│ │ │ ├── drawable-xxhdpi
│ │ │ ├── ucrop_ic_angle.png
│ │ │ └── ucrop_ic_done.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ ├── ucrop_ic_angle.png
│ │ │ └── ucrop_ic_done.png
│ │ │ ├── drawable
│ │ │ ├── hl_arrow_down.xml
│ │ │ ├── hl_multiple_selected.xml
│ │ │ ├── hl_multiple_selector.xml
│ │ │ ├── hl_multiple_unselected.xml
│ │ │ ├── hl_preview_selected.xml
│ │ │ ├── hl_preview_selector.xml
│ │ │ ├── hl_single_selected.xml
│ │ │ ├── hl_single_selector.xml
│ │ │ ├── hl_single_unselected.xml
│ │ │ ├── ps_ic_black_back.png
│ │ │ ├── ucrop_crop.xml
│ │ │ ├── ucrop_gallery_bg.xml
│ │ │ ├── ucrop_gallery_current.xml
│ │ │ ├── ucrop_ic_crop.xml
│ │ │ ├── ucrop_ic_crop_unselected.xml
│ │ │ ├── ucrop_ic_cross.xml
│ │ │ ├── ucrop_ic_next.xml
│ │ │ ├── ucrop_ic_reset.xml
│ │ │ ├── ucrop_ic_rotate.xml
│ │ │ ├── ucrop_ic_rotate_unselected.xml
│ │ │ ├── ucrop_ic_scale.xml
│ │ │ ├── ucrop_ic_scale_unselected.xml
│ │ │ ├── ucrop_rotate.xml
│ │ │ ├── ucrop_scale.xml
│ │ │ ├── ucrop_shadow_upside.xml
│ │ │ ├── ucrop_vector_ic_crop.xml
│ │ │ ├── ucrop_vector_loader.xml
│ │ │ ├── ucrop_vector_loader_animated.xml
│ │ │ └── ucrop_wrapper_controls_shape.xml
│ │ │ ├── layout
│ │ │ ├── hl_custom_fragment_selector.xml
│ │ │ ├── loading_dialog.xml
│ │ │ ├── ucrop_activity_multiple.xml
│ │ │ ├── ucrop_activity_photobox.xml
│ │ │ ├── ucrop_aspect_ratio.xml
│ │ │ ├── ucrop_controls.xml
│ │ │ ├── ucrop_fragment_photobox.xml
│ │ │ ├── ucrop_gallery_adapter_item.xml
│ │ │ ├── ucrop_layout_rotate_wheel.xml
│ │ │ ├── ucrop_layout_scale_wheel.xml
│ │ │ └── ucrop_view.xml
│ │ │ ├── menu
│ │ │ └── ucrop_menu_activity.xml
│ │ │ ├── values-en-rUS
│ │ │ └── string.xml
│ │ │ └── values
│ │ │ ├── attrs.xml
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── public.xml
│ │ │ ├── strings.xml
│ │ │ ├── styles.xml
│ │ │ └── values.xml
│ │ └── test
│ │ └── kotlin
│ │ └── com
│ │ └── howl
│ │ └── hl_image_picker
│ │ └── HLImagePickerPluginTest.kt
├── example
│ ├── .gitignore
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android
│ │ ├── .gitignore
│ │ ├── app
│ │ │ ├── build.gradle
│ │ │ └── src
│ │ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ │ ├── main
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── howl
│ │ │ │ │ │ └── hl_image_picker_android_example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── res
│ │ │ │ │ ├── drawable-v21
│ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── values-night
│ │ │ │ │ └── styles.xml
│ │ │ │ │ └── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ ├── build.gradle
│ │ ├── gradle.properties
│ │ ├── gradle
│ │ │ └── wrapper
│ │ │ │ └── gradle-wrapper.properties
│ │ └── settings.gradle
│ ├── lib
│ │ ├── main.dart
│ │ └── widgets
│ │ │ ├── aspect_ratio_select.dart
│ │ │ ├── custom_switch.dart
│ │ │ ├── increase_decrease.dart
│ │ │ ├── media_preview.dart
│ │ │ └── media_type_select.dart
│ └── pubspec.yaml
├── lib
│ └── hl_image_picker_android.dart
└── pubspec.yaml
├── hl_image_picker_ios
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── example
│ ├── .gitignore
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── ios
│ │ ├── .gitignore
│ │ ├── Flutter
│ │ │ ├── AppFrameworkInfo.plist
│ │ │ ├── Debug.xcconfig
│ │ │ └── Release.xcconfig
│ │ ├── Podfile
│ │ ├── Runner.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ │ ├── contents.xcworkspacedata
│ │ │ │ └── xcshareddata
│ │ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ │ └── WorkspaceSettings.xcsettings
│ │ │ └── xcshareddata
│ │ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ ├── Runner.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ │ └── WorkspaceSettings.xcsettings
│ │ ├── Runner
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ │ ├── AppIcon.appiconset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── LaunchImage.imageset
│ │ │ │ │ ├── Contents.json
│ │ │ │ │ ├── LaunchImage.png
│ │ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ │ └── README.md
│ │ │ ├── Base.lproj
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── Info.plist
│ │ │ └── Runner-Bridging-Header.h
│ │ └── RunnerTests
│ │ │ └── RunnerTests.swift
│ ├── lib
│ │ ├── main.dart
│ │ └── widgets
│ │ │ ├── aspect_ratio_select.dart
│ │ │ ├── custom_switch.dart
│ │ │ ├── increase_decrease.dart
│ │ │ ├── media_preview.dart
│ │ │ └── media_type_select.dart
│ └── pubspec.yaml
├── ios
│ ├── .gitignore
│ ├── Assets
│ │ └── .gitkeep
│ ├── Classes
│ │ ├── HLImagePickerPlugin.swift
│ │ └── HLImagePickerUtils.swift
│ └── hl_image_picker_ios.podspec
├── lib
│ └── hl_image_picker_ios.dart
└── pubspec.yaml
└── hl_image_picker_platform_interface
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── lib
├── hl_image_picker_platform_interface.dart
└── src
│ ├── camera_options.dart
│ ├── constants.dart
│ ├── crop_options.dart
│ ├── method_channel
│ └── method_channel_hl_image_picker.dart
│ ├── picker_item.dart
│ ├── picker_localized.dart
│ ├── picker_options.dart
│ └── platform_interface
│ └── platform_interface_hl_image_picker.dart
└── pubspec.yaml
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26 | **/pubspec.lock
27 | **/Podfile.lock
28 | **/doc/api/
29 | .dart_tool/
30 | .packages
31 | build/
32 | scripts/
33 | .vscode/
--------------------------------------------------------------------------------
/__assets__/android_crop_circular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/android_crop_circular.png
--------------------------------------------------------------------------------
/__assets__/android_crop_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/android_crop_demo.gif
--------------------------------------------------------------------------------
/__assets__/android_crop_square.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/android_crop_square.png
--------------------------------------------------------------------------------
/__assets__/android_picker_sample.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/android_picker_sample.gif
--------------------------------------------------------------------------------
/__assets__/android_picker_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/android_picker_screen.png
--------------------------------------------------------------------------------
/__assets__/ios_crop_circular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/ios_crop_circular.png
--------------------------------------------------------------------------------
/__assets__/ios_crop_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/ios_crop_demo.gif
--------------------------------------------------------------------------------
/__assets__/ios_crop_square.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/ios_crop_square.png
--------------------------------------------------------------------------------
/__assets__/ios_picker_demo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/ios_picker_demo.gif
--------------------------------------------------------------------------------
/__assets__/ios_picker_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/ios_picker_screen.png
--------------------------------------------------------------------------------
/__assets__/limited_access_alert.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/limited_access_alert.jpg
--------------------------------------------------------------------------------
/__assets__/localize_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/__assets__/localize_camera.png
--------------------------------------------------------------------------------
/hl_image_picker/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: plugin
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
18 |
19 | # User provided section
20 |
21 | # List of Local paths (relative to this file) that should be
22 | # ignored by the migrate tool.
23 | #
24 | # Files that are not part of the templates will be ignored by default.
25 | unmanaged_files:
26 | - 'lib/main.dart'
27 | - 'ios/Runner.xcodeproj/project.pbxproj'
28 |
--------------------------------------------------------------------------------
/hl_image_picker/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.2.16
2 |
3 | * can't interact with the screen when onPress backHandler #31
4 |
5 | ## 1.2.15
6 |
7 | * can't interact with the screen when onPress backHandler #31
8 |
9 | ## 1.2.14
10 |
11 | * Decode/Encode the media path
12 | * Fix issue of not returning image when picker is canceled
13 |
14 | ## 1.2.13
15 |
16 | * Set default language to English (Android)
17 | * Add ucrop to hl_image_picker to support rotate image (Android)
18 | * Fix issue of not returning image when cropper screen is closed. (iOS)
19 | * Added the ability to change the toolbar title (Android)
20 | * Fix Android 10 storage access issue
21 |
22 | ## 1.2.12
23 |
24 | * Support crop multiple images
25 |
26 | ## 1.2.11
27 |
28 | * Deprecate `recordVideoMaxSecond` in HLImagePickerOptions
29 | * Remove default value for `recordVideoMaxSecond` in HLCameraOptions
30 | * Change exportPreset to `AVAssetExportPresetPassthrough`
31 | * Upgrade PickerSelector to 3.11.2
32 |
33 | ## 1.2.10
34 |
35 | * Update dependencies version
36 |
37 | ## 1.2.9
38 |
39 | * Android Gradle Plugin 8 support
40 | * fix: not possible preselect compressed photos
41 |
42 | ## 1.2.8
43 |
44 | * Support quality compression for selected images
45 | * Can set maxSizeOutput (maxWidth and maxHeight) for selected images
46 |
47 | ## 1.2.7
48 |
49 | - feat: support gif selection
50 | - fix: maxFileSize and minFileSize are not working (iOS)
51 |
52 | ## 1.2.6
53 |
54 | - Fix the issue of not returning image when cropper screen is closed. (iOS)
55 |
56 | ## 1.2.5
57 |
58 | - Dismiss camera preview before open cropper (iOS)
59 |
60 | ## 1.2.4
61 |
62 | - Update README.md
63 |
64 | ## 1.2.2
65 |
66 | - Fix deselecting all previously selected images (Android only)
67 |
68 | ## 1.2.1
69 |
70 | - Fix duplicate alert when album permission is denied (iOS only)
71 |
72 | ## 1.2.0
73 |
74 | - Update documentation
75 |
76 | ## 1.1.2
77 |
78 | - Update SDK constraints: ">=2.18.0 <4.0.0"
79 |
80 | ## 1.1.1
81 |
82 | - Update podspec version
83 |
84 | ## 1.1.0
85 |
86 | - Update UI
87 |
88 | ## 1.0.2
89 |
90 | - Fix error when open iOS camera - (UINavigationController.delegate must be used from main thread only)
91 |
92 | ## 1.0.1
93 |
94 | - Add custom text for crop image UI
95 |
96 | ## 1.0.0
97 |
98 | - Initial release.
99 |
--------------------------------------------------------------------------------
/hl_image_picker/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 howljs
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
--------------------------------------------------------------------------------
/hl_image_picker/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | # Additional information about this file can be found at
4 | # https://dart.dev/guides/language/analysis-options
5 |
--------------------------------------------------------------------------------
/hl_image_picker/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/hl_image_picker/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
18 | - platform: android
19 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
20 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/hl_image_picker/example/README.md:
--------------------------------------------------------------------------------
1 | # hl_image_picker_example
2 |
3 | Demonstrates how to use the hl_image_picker plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/hl_image_picker/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | namespace "com.example.example"
30 | compileSdkVersion flutter.compileSdkVersion
31 | ndkVersion flutter.ndkVersion
32 |
33 | compileOptions {
34 | sourceCompatibility JavaVersion.VERSION_1_8
35 | targetCompatibility JavaVersion.VERSION_1_8
36 | }
37 |
38 | kotlinOptions {
39 | jvmTarget = '1.8'
40 | }
41 |
42 | sourceSets {
43 | main.java.srcDirs += 'src/main/kotlin'
44 | }
45 |
46 | defaultConfig {
47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
48 | applicationId "com.example.example"
49 | // You can update the following values to match your application needs.
50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
51 | minSdkVersion 21
52 | targetSdkVersion flutter.targetSdkVersion
53 | versionCode flutterVersionCode.toInteger()
54 | versionName flutterVersionName
55 | }
56 |
57 | buildTypes {
58 | release {
59 | // TODO: Add your own signing config for the release build.
60 | // Signing with the debug keys for now, so `flutter run --release` works.
61 | signingConfig signingConfigs.debug
62 | }
63 | }
64 | }
65 |
66 | flutter {
67 | source '../..'
68 | }
69 |
70 | dependencies {
71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72 | }
73 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
26 |
30 |
34 |
35 |
36 |
37 |
38 |
39 |
41 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.3.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/hl_image_picker/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '11.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | target 'RunnerTests' do
36 | inherit! :search_paths
37 | end
38 | end
39 |
40 | post_install do |installer|
41 | installer.pods_project.targets.each do |target|
42 | flutter_additional_ios_build_settings(target)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CADisableMinimumFrameDurationOnPhone
6 |
7 | CFBundleDevelopmentRegion
8 | $(DEVELOPMENT_LANGUAGE)
9 | CFBundleDisplayName
10 | Example
11 | CFBundleExecutable
12 | $(EXECUTABLE_NAME)
13 | CFBundleIdentifier
14 | $(PRODUCT_BUNDLE_IDENTIFIER)
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | example
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | $(FLUTTER_BUILD_NAME)
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | $(FLUTTER_BUILD_NUMBER)
27 | LSRequiresIPhoneOS
28 |
29 | NSCameraUsageDescription
30 | NSCameraUsageDescription
31 | NSMicrophoneUsageDescription
32 | NSMicrophoneUsageDescription
33 | NSPhotoLibraryUsageDescription
34 | NSPhotoLibraryUsageDescription
35 | PHPhotoLibraryPreventAutomaticLimitedAccessAlert
36 |
37 | UIApplicationSupportsIndirectInputEvents
38 |
39 | UILaunchStoryboardName
40 | LaunchScreen
41 | UIMainStoryboardFile
42 | Main
43 | UISupportedInterfaceOrientations
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 | UISupportedInterfaceOrientations~ipad
50 |
51 | UIInterfaceOrientationPortrait
52 | UIInterfaceOrientationPortraitUpsideDown
53 | UIInterfaceOrientationLandscapeLeft
54 | UIInterfaceOrientationLandscapeRight
55 |
56 | UIViewControllerBasedStatusBarAppearance
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/hl_image_picker/example/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/hl_image_picker/example/lib/widgets/custom_switch.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | class CustomSwitch extends StatelessWidget {
4 | const CustomSwitch(
5 | {super.key, required this.label, required this.value, this.onChanged});
6 |
7 | final String label;
8 | final bool value;
9 | final ValueChanged? onChanged;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Padding(
14 | padding: const EdgeInsets.only(top: 16.0),
15 | child: Row(
16 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
17 | children: [
18 | Text(label),
19 | const SizedBox(width: 16),
20 | CupertinoSwitch(
21 | value: value,
22 | onChanged: onChanged,
23 | )
24 | ],
25 | ),
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/hl_image_picker/example/lib/widgets/increase_decrease.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class IncreaseAndDecrease extends StatelessWidget {
4 | const IncreaseAndDecrease(
5 | {super.key,
6 | required this.value,
7 | required this.onChanged,
8 | required this.label});
9 |
10 | final String label;
11 | final int value;
12 | final Function(int value) onChanged;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Padding(
17 | padding: const EdgeInsets.only(top: 16.0),
18 | child: Row(
19 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
20 | children: [
21 | Text(label),
22 | const SizedBox(width: 16),
23 | Row(
24 | children: [
25 | Material(
26 | color: value == 1 ? Colors.grey[300] : Colors.blue,
27 | borderRadius: BorderRadius.circular(4),
28 | child: InkWell(
29 | onTap: value == 1 ? null : () => onChanged(value - 1),
30 | child: Container(
31 | width: 24,
32 | height: 24,
33 | alignment: Alignment.center,
34 | child: const Text(
35 | '-',
36 | style: TextStyle(
37 | fontSize: 16,
38 | fontWeight: FontWeight.bold,
39 | color: Colors.white),
40 | ),
41 | ),
42 | ),
43 | ),
44 | SizedBox(
45 | width: 40,
46 | child: Text(
47 | value.toString(),
48 | textAlign: TextAlign.center,
49 | )),
50 | Material(
51 | color: Colors.blue,
52 | borderRadius: BorderRadius.circular(4),
53 | child: InkWell(
54 | onTap: () => onChanged(value + 1),
55 | child: Container(
56 | width: 24,
57 | height: 24,
58 | alignment: Alignment.center,
59 | child: const Text(
60 | '+',
61 | style: TextStyle(
62 | fontSize: 16,
63 | fontWeight: FontWeight.bold,
64 | color: Colors.white),
65 | ),
66 | ),
67 | ),
68 | ),
69 | ],
70 | )
71 | ],
72 | ),
73 | );
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/hl_image_picker/example/lib/widgets/media_preview.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:hl_image_picker/hl_image_picker.dart';
5 |
6 | class MediaPreview extends StatelessWidget {
7 | const MediaPreview({
8 | super.key,
9 | required this.items,
10 | });
11 |
12 | final List items;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | if (items.isEmpty) {
17 | return Container(
18 | height: 240,
19 | color: Colors.grey[300],
20 | child: const Center(
21 | child: Text('Empty'),
22 | ),
23 | );
24 | }
25 |
26 | return SizedBox(
27 | height: 240,
28 | width: double.infinity,
29 | child: ListView.separated(
30 | padding: const EdgeInsets.all(8),
31 | physics: const AlwaysScrollableScrollPhysics(),
32 | scrollDirection: Axis.horizontal,
33 | itemCount: items.length,
34 | itemBuilder: (_, index) {
35 | File? imageFile = File(items[index].path);
36 | if (items[index].type == "video") {
37 | imageFile = items[index].thumbnail != null
38 | ? File(items[index].thumbnail!)
39 | : null;
40 | }
41 | return imageFile != null
42 | ? InkWell(
43 | onTap: items[index].type == "video" ? () {} : null,
44 | child: Image.file(imageFile))
45 | : Container(
46 | decoration: BoxDecoration(
47 | color: Colors.grey[300],
48 | borderRadius: BorderRadius.circular(4),
49 | ),
50 | alignment: Alignment.center,
51 | width: 320,
52 | height: double.infinity,
53 | child: const Text('No thumbnail'));
54 | },
55 | separatorBuilder: (BuildContext context, int index) =>
56 | const SizedBox(width: 8.0),
57 | ),
58 | );
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/hl_image_picker/example/lib/widgets/media_type_select.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:hl_image_picker/hl_image_picker.dart';
3 |
4 | class MediaTypeSelect extends StatelessWidget {
5 | const MediaTypeSelect({super.key, required this.value, this.onChanged});
6 |
7 | final MediaType value;
8 |
9 | final void Function(MediaType? type)? onChanged;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Row(
14 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
15 | children: [
16 | const Text('Media type'),
17 | const SizedBox(width: 16),
18 | DropdownButton(
19 | items: const [
20 | DropdownMenuItem(
21 | value: MediaType.all,
22 | child: Text('All'),
23 | ),
24 | DropdownMenuItem(
25 | value: MediaType.image,
26 | child: Text('Image'),
27 | ),
28 | DropdownMenuItem(
29 | value: MediaType.video,
30 | child: Text('Video'),
31 | ),
32 | ],
33 | value: value,
34 | onChanged: onChanged,
35 | )
36 | ],
37 | );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/hl_image_picker/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: hl_image_picker
2 | description: Choose images/videos from the library, crop images, and capture new photos/videos with ease.
3 | repository: https://github.com/howljs/hl_image_picker/tree/main/hl_image_picker
4 | issue_tracker: https://github.com/howljs/hl_image_picker/issues
5 |
6 | version: 1.2.16
7 |
8 | environment:
9 | sdk: ">=2.18.0 <4.0.0"
10 | flutter: ">=3.3.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 | hl_image_picker_platform_interface: ^1.2.4
16 | hl_image_picker_ios: ^1.2.10
17 | hl_image_picker_android: ^1.2.11
18 |
19 | dev_dependencies:
20 | flutter_test:
21 | sdk: flutter
22 | flutter_lints: ^2.0.0
23 | plugin_platform_interface: ^2.0.2
24 |
25 | flutter:
26 | plugin:
27 | platforms:
28 | android:
29 | default_package: hl_image_picker_android
30 | ios:
31 | default_package: hl_image_picker_ios
32 |
--------------------------------------------------------------------------------
/hl_image_picker_android/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: plugin
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
18 | - platform: android
19 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
20 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/hl_image_picker_android/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.2.11
2 |
3 | * can't interact with the screen when onPress backHandler #31
4 |
5 | ## 1.2.10
6 |
7 | * can't interact with the screen when onPress backHandler #31
8 |
9 | ## 1.2.9
10 |
11 | * Encode the path when opening the cropper
12 | * Fix issue of not returning image when picker is canceled
13 |
14 | ## 1.2.8
15 | * Set default language to English
16 | * Add ucrop to hl_image_picker to support rotate image
17 | * Added the ability to change the toolbar title
18 | * Fix Android 10 storage access issue
19 |
20 | ## 1.2.7
21 |
22 | * Support crop multiple images
23 |
24 | ## 1.2.6
25 |
26 | * Deprecate `recordVideoMaxSecond` in HLImagePickerOptions
27 | * Remove default value for `recordVideoMaxSecond` in HLCameraOptions
28 |
29 | ## 1.2.5
30 |
31 | * Upgrade PickerSelector to 3.11.2
32 | * Import com.luck.picture.lib.R
33 |
34 | ## 1.2.4
35 |
36 | * Android Gradle Plugin 8 support
37 |
38 | ## 1.2.3
39 |
40 | * Support quality compression for selected images
41 | * Can set maxSizeOutput (maxWidth and maxHeight) for selected images
42 |
43 | ## 1.2.2
44 |
45 | - Support gif selection
46 |
47 | ## 1.2.1
48 |
49 | - Fix deselecting all previously selected images
50 |
51 | ## 1.2.0
52 |
53 | - Update documentation
54 |
55 | ## 1.1.2
56 |
57 | - Update SDK constraints: ">=2.18.0 <4.0.0"
58 |
59 | ## 1.1.1
60 |
61 | - Update podspec version
62 |
63 | ## 1.1.0
64 |
65 | - Update UI
66 |
67 | ## 1.0.1
68 |
69 | - Add custom text for crop image UI
70 |
71 | ## 1.0.0
72 |
73 | - Initial release.
74 |
--------------------------------------------------------------------------------
/hl_image_picker_android/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 howljs
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
--------------------------------------------------------------------------------
/hl_image_picker_android/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | # Additional information about this file can be found at
4 | # https://dart.dev/guides/language/analysis-options
5 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .cxx
10 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.howl.hl_image_picker'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | ext.kotlin_version = '1.7.10'
6 | repositories {
7 | google()
8 | mavenCentral()
9 | }
10 |
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:7.3.0'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | mavenCentral()
21 | }
22 | }
23 |
24 | apply plugin: 'com.android.library'
25 | apply plugin: 'kotlin-android'
26 |
27 | android {
28 | if (project.android.hasProperty("namespace")) {
29 | namespace 'com.howl.hl_image_picker'
30 | }
31 |
32 | compileSdkVersion 31
33 |
34 | compileOptions {
35 | sourceCompatibility JavaVersion.VERSION_1_8
36 | targetCompatibility JavaVersion.VERSION_1_8
37 | }
38 |
39 | kotlinOptions {
40 | jvmTarget = '1.8'
41 | }
42 |
43 | sourceSets {
44 | main.java.srcDirs += 'src/main/kotlin'
45 | test.java.srcDirs += 'src/test/kotlin'
46 | }
47 |
48 | defaultConfig {
49 | minSdkVersion 16
50 | }
51 |
52 | dependencies {
53 | implementation 'io.github.lucksiege:pictureselector:v3.11.2'
54 | implementation 'com.github.bumptech.glide:glide:4.15.1'
55 |
56 | // Ucrop
57 | implementation "androidx.appcompat:appcompat:1.3.1"
58 | implementation "androidx.exifinterface:exifinterface:1.3.3"
59 | implementation "androidx.transition:transition:1.4.1"
60 | implementation "com.squareup.okhttp3:okhttp:3.12.13"
61 | implementation "androidx.recyclerview:recyclerview:1.2.1"
62 | implementation "com.google.code.gson:gson:2.8.6"
63 | // End Ucrop
64 |
65 | testImplementation 'org.jetbrains.kotlin:kotlin-test'
66 | testImplementation 'org.mockito:mockito-core:5.0.0'
67 | }
68 |
69 | testOptions {
70 | unitTests.all {
71 | useJUnitPlatform()
72 |
73 | testLogging {
74 | events "passed", "skipped", "failed", "standardOut", "standardError"
75 | outputs.upToDateWhen {false}
76 | showStandardStreams = true
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/hl_image_picker_android/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'hl_image_picker'
2 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/OkHttpClientStore.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | import okhttp3.OkHttpClient;
6 |
7 | public class OkHttpClientStore {
8 |
9 | private OkHttpClientStore() {}
10 |
11 | public final static OkHttpClientStore INSTANCE = new OkHttpClientStore();
12 |
13 | private OkHttpClient client;
14 |
15 | /**
16 | * @return stored OkHttpClient if it was already set,
17 | * or just an instance created via empty constructor
18 | * and store it
19 | */
20 | @NonNull
21 | public OkHttpClient getClient() {
22 | if (client == null) {
23 | client = new OkHttpClient();
24 | }
25 | return client;
26 | }
27 |
28 | /**
29 | * @param client OkHttpClient for downloading bitmap form remote Uri,
30 | * it may contain any preferences you need
31 | */
32 | void setClient(@NonNull OkHttpClient client) {
33 | this.client = client;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/UCropDevelopConfig.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop;
2 |
3 | /**
4 | * @author:luck
5 | * @date:2021/12/2 10:23 上午
6 | * @describe:UCropDevelopConfig
7 | */
8 | public final class UCropDevelopConfig {
9 | /**
10 | * 图片加载引擎
11 | */
12 | public static UCropImageEngine imageEngine;
13 |
14 | /**
15 | * 释放监听器
16 | */
17 | public static void destroy() {
18 | UCropDevelopConfig.imageEngine = null;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/UCropFragmentCallback.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop;
2 |
3 | public interface UCropFragmentCallback {
4 |
5 | /**
6 | * Return loader status
7 | * @param showLoader
8 | */
9 | void loadingProgress(boolean showLoader);
10 |
11 | /**
12 | * Return cropping result or error
13 | * @param result
14 | */
15 | void onCropFinish(UCropFragment.UCropResult result);
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/UCropImageEngine.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.net.Uri;
6 | import android.widget.ImageView;
7 |
8 | /**
9 | * @author:luck
10 | * @date:2021/12/1 9:53 下午
11 | * @describe:UCropImageEngine
12 | */
13 | public interface UCropImageEngine {
14 | /**
15 | * load image source
16 | *
17 | * @param context
18 | * @param url
19 | * @param imageView
20 | */
21 | void loadImage(Context context, String url, ImageView imageView);
22 |
23 | /**
24 | * load image source
25 | *
26 | * @param context
27 | * @param url
28 | * @param maxWidth
29 | * @param maxHeight
30 | * @param call
31 | */
32 | void loadImage(Context context, Uri url, int maxWidth, int maxHeight, OnCallbackListener call);
33 |
34 |
35 | interface OnCallbackListener {
36 | /**
37 | * @param data
38 | */
39 | void onCall(T data);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/callback/BitmapCropCallback.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.callback;
2 |
3 | import android.net.Uri;
4 |
5 | import androidx.annotation.NonNull;
6 |
7 | public interface BitmapCropCallback {
8 |
9 | void onBitmapCropped(@NonNull Uri resultUri, int offsetX, int offsetY, int imageWidth, int imageHeight);
10 |
11 | void onCropFailure(@NonNull Throwable t);
12 |
13 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/callback/BitmapLoadCallback.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.callback;
2 |
3 | import android.graphics.Bitmap;
4 | import android.net.Uri;
5 |
6 | import androidx.annotation.NonNull;
7 | import androidx.annotation.Nullable;
8 |
9 | import com.yalantis.ucrop.model.ExifInfo;
10 |
11 | public interface BitmapLoadCallback {
12 |
13 | void onBitmapLoaded(@NonNull Bitmap bitmap, @NonNull ExifInfo exifInfo, @NonNull Uri imageInputUri, @Nullable Uri imageOutputUri);
14 |
15 | void onFailure(@NonNull Exception bitmapWorkerException);
16 |
17 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/callback/CropBoundsChangeListener.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.callback;
2 |
3 | /**
4 | * Interface for crop bound change notifying.
5 | */
6 | public interface CropBoundsChangeListener {
7 |
8 | void onCropAspectRatioChanged(float cropRatio);
9 |
10 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/callback/OverlayViewChangeListener.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.callback;
2 |
3 | import android.graphics.RectF;
4 |
5 | /**
6 | * Created by Oleksii Shliama.
7 | */
8 | public interface OverlayViewChangeListener {
9 |
10 | void onCropRectUpdated(RectF cropRect);
11 |
12 | void postTranslate(float deltaX, float deltaY);
13 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/decoration/GridSpacingItemDecoration.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.decoration;
2 |
3 | import android.graphics.Rect;
4 | import android.view.View;
5 |
6 | import androidx.annotation.NonNull;
7 | import androidx.recyclerview.widget.RecyclerView;
8 |
9 | /**
10 | * @author:luck
11 | * @data:2016/12/27 下午23:50
12 | * @describe:GridSpacingItemDecoration
13 | */
14 | public class GridSpacingItemDecoration extends RecyclerView.ItemDecoration {
15 |
16 | private final int spanCount;
17 | private final int spacing;
18 | private final boolean includeEdge;
19 |
20 | public GridSpacingItemDecoration(int spanCount, int spacing, boolean includeEdge) {
21 | this.spanCount = spanCount;
22 | this.spacing = spacing;
23 | this.includeEdge = includeEdge;
24 | }
25 |
26 | @Override
27 | public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, RecyclerView parent, @NonNull RecyclerView.State state) {
28 | int position = parent.getChildAdapterPosition(view);
29 | int column = position % spanCount;
30 | if (includeEdge) {
31 | outRect.left = spacing - column * spacing / spanCount;
32 | outRect.right = (column + 1) * spacing / spanCount;
33 | } else {
34 | outRect.left = column * spacing / spanCount;
35 | outRect.right = spacing - (column + 1) * spacing / spanCount;
36 | }
37 | if (position < spanCount) {
38 | outRect.top = spacing;
39 | }
40 | outRect.bottom = spacing;
41 | }
42 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/model/AspectRatio.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.model;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | import androidx.annotation.Nullable;
7 |
8 | /**
9 | * Created by Oleksii Shliama [https://github.com/shliama] on 6/24/16.
10 | */
11 | public class AspectRatio implements Parcelable {
12 |
13 | @Nullable
14 | private final String mAspectRatioTitle;
15 | private final float mAspectRatioX;
16 | private final float mAspectRatioY;
17 |
18 | public AspectRatio(@Nullable String aspectRatioTitle, float aspectRatioX, float aspectRatioY) {
19 | mAspectRatioTitle = aspectRatioTitle;
20 | mAspectRatioX = aspectRatioX;
21 | mAspectRatioY = aspectRatioY;
22 | }
23 |
24 | protected AspectRatio(Parcel in) {
25 | mAspectRatioTitle = in.readString();
26 | mAspectRatioX = in.readFloat();
27 | mAspectRatioY = in.readFloat();
28 | }
29 |
30 | @Override
31 | public void writeToParcel(Parcel dest, int flags) {
32 | dest.writeString(mAspectRatioTitle);
33 | dest.writeFloat(mAspectRatioX);
34 | dest.writeFloat(mAspectRatioY);
35 | }
36 |
37 | @Override
38 | public int describeContents() {
39 | return 0;
40 | }
41 |
42 | public static final Creator CREATOR = new Creator() {
43 | @Override
44 | public AspectRatio createFromParcel(Parcel in) {
45 | return new AspectRatio(in);
46 | }
47 |
48 | @Override
49 | public AspectRatio[] newArray(int size) {
50 | return new AspectRatio[size];
51 | }
52 | };
53 |
54 | @Nullable
55 | public String getAspectRatioTitle() {
56 | return mAspectRatioTitle;
57 | }
58 |
59 | public float getAspectRatioX() {
60 | return mAspectRatioX;
61 | }
62 |
63 | public float getAspectRatioY() {
64 | return mAspectRatioY;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/model/CropParameters.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.model;
2 |
3 | import android.graphics.Bitmap;
4 | import android.net.Uri;
5 |
6 | /**
7 | * Created by Oleksii Shliama [https://github.com/shliama] on 6/21/16.
8 | */
9 | public class CropParameters {
10 |
11 | private int mMaxResultImageSizeX, mMaxResultImageSizeY;
12 |
13 | private Bitmap.CompressFormat mCompressFormat;
14 | private int mCompressQuality;
15 | private String mImageInputPath, mImageOutputPath;
16 | private ExifInfo mExifInfo;
17 |
18 | private Uri mContentImageInputUri, mContentImageOutputUri;
19 |
20 |
21 | public CropParameters(int maxResultImageSizeX, int maxResultImageSizeY,
22 | Bitmap.CompressFormat compressFormat, int compressQuality,
23 | String imageInputPath, String imageOutputPath, ExifInfo exifInfo) {
24 | mMaxResultImageSizeX = maxResultImageSizeX;
25 | mMaxResultImageSizeY = maxResultImageSizeY;
26 | mCompressFormat = compressFormat;
27 | mCompressQuality = compressQuality;
28 | mImageInputPath = imageInputPath;
29 | mImageOutputPath = imageOutputPath;
30 | mExifInfo = exifInfo;
31 | }
32 |
33 | public int getMaxResultImageSizeX() {
34 | return mMaxResultImageSizeX;
35 | }
36 |
37 | public int getMaxResultImageSizeY() {
38 | return mMaxResultImageSizeY;
39 | }
40 |
41 | public Bitmap.CompressFormat getCompressFormat() {
42 | return mCompressFormat;
43 | }
44 |
45 | public int getCompressQuality() {
46 | return mCompressQuality;
47 | }
48 |
49 | public String getImageInputPath() {
50 | return mImageInputPath;
51 | }
52 |
53 | public String getImageOutputPath() {
54 | return mImageOutputPath;
55 | }
56 |
57 | public ExifInfo getExifInfo() {
58 | return mExifInfo;
59 | }
60 |
61 | public Uri getContentImageInputUri() {
62 | return mContentImageInputUri;
63 | }
64 |
65 | public void setContentImageInputUri(Uri mContentImageInputUri) {
66 | this.mContentImageInputUri = mContentImageInputUri;
67 | }
68 |
69 | public Uri getContentImageOutputUri() {
70 | return mContentImageOutputUri;
71 | }
72 |
73 | public void setContentImageOutputUri(Uri mContentImageOutputUri) {
74 | this.mContentImageOutputUri = mContentImageOutputUri;
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/model/CustomIntentKey.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.model;
2 |
3 | /**
4 | * @author:luck
5 | * @date:2021/12/1 6:49 下午
6 | * @describe:CustomIntentKey
7 | */
8 | public class CustomIntentKey {
9 | /**
10 | * 输出的路径
11 | */
12 | public static final String EXTRA_OUT_PUT_PATH = "outPutPath";
13 | /**
14 | * 图片宽度
15 | */
16 | public static final String EXTRA_IMAGE_WIDTH = "imageWidth";
17 | /**
18 | * 图片高度
19 | */
20 | public static final String EXTRA_IMAGE_HEIGHT = "imageHeight";
21 | /**
22 | * 图片X轴偏移量
23 | */
24 | public static final String EXTRA_OFFSET_X = "offsetX";
25 | /**
26 | * 图片Y轴偏移量
27 | */
28 | public static final String EXTRA_OFFSET_Y = "offsetY";
29 | /**
30 | * 图片旋转比例
31 | */
32 | public static final String EXTRA_ASPECT_RATIO = "aspectRatio";
33 | }
34 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/model/ExifInfo.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.model;
2 |
3 | /**
4 | * Created by Oleksii Shliama [https://github.com/shliama] on 6/21/16.
5 | */
6 | public class ExifInfo {
7 |
8 | private int mExifOrientation;
9 | private int mExifDegrees;
10 | private int mExifTranslation;
11 |
12 | public ExifInfo(int exifOrientation, int exifDegrees, int exifTranslation) {
13 | mExifOrientation = exifOrientation;
14 | mExifDegrees = exifDegrees;
15 | mExifTranslation = exifTranslation;
16 | }
17 |
18 | public int getExifOrientation() {
19 | return mExifOrientation;
20 | }
21 |
22 | public int getExifDegrees() {
23 | return mExifDegrees;
24 | }
25 |
26 | public int getExifTranslation() {
27 | return mExifTranslation;
28 | }
29 |
30 | public void setExifOrientation(int exifOrientation) {
31 | mExifOrientation = exifOrientation;
32 | }
33 |
34 | public void setExifDegrees(int exifDegrees) {
35 | mExifDegrees = exifDegrees;
36 | }
37 |
38 | public void setExifTranslation(int exifTranslation) {
39 | mExifTranslation = exifTranslation;
40 | }
41 |
42 | @Override
43 | public boolean equals(Object o) {
44 | if (this == o) return true;
45 | if (o == null || getClass() != o.getClass()) return false;
46 |
47 | ExifInfo exifInfo = (ExifInfo) o;
48 |
49 | if (mExifOrientation != exifInfo.mExifOrientation) return false;
50 | if (mExifDegrees != exifInfo.mExifDegrees) return false;
51 | return mExifTranslation == exifInfo.mExifTranslation;
52 |
53 | }
54 |
55 | @Override
56 | public int hashCode() {
57 | int result = mExifOrientation;
58 | result = 31 * result + mExifDegrees;
59 | result = 31 * result + mExifTranslation;
60 | return result;
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/model/ImageState.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.model;
2 |
3 | import android.graphics.RectF;
4 |
5 | /**
6 | * Created by Oleksii Shliama [https://github.com/shliama] on 6/21/16.
7 | */
8 | public class ImageState {
9 |
10 | private RectF mCropRect;
11 | private RectF mCurrentImageRect;
12 |
13 | private float mCurrentScale, mCurrentAngle;
14 |
15 | public ImageState(RectF cropRect, RectF currentImageRect, float currentScale, float currentAngle) {
16 | mCropRect = cropRect;
17 | mCurrentImageRect = currentImageRect;
18 | mCurrentScale = currentScale;
19 | mCurrentAngle = currentAngle;
20 | }
21 |
22 | public RectF getCropRect() {
23 | return mCropRect;
24 | }
25 |
26 | public RectF getCurrentImageRect() {
27 | return mCurrentImageRect;
28 | }
29 |
30 | public float getCurrentScale() {
31 | return mCurrentScale;
32 | }
33 |
34 | public float getCurrentAngle() {
35 | return mCurrentAngle;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/util/CubicEasing.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.util;
2 |
3 | public final class CubicEasing {
4 |
5 | public static float easeOut(float time, float start, float end, float duration) {
6 | return end * ((time = time / duration - 1.0f) * time * time + 1.0f) + start;
7 | }
8 |
9 | public static float easeIn(float time, float start, float end, float duration) {
10 | return end * (time /= duration) * time * time + start;
11 | }
12 |
13 | public static float easeInOut(float time, float start, float end, float duration) {
14 | return (time /= duration / 2.0f) < 1.0f ? end / 2.0f * time * time * time + start : end / 2.0f * ((time -= 2.0f) * time * time + 2.0f) + start;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/util/DensityUtil.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.util;
2 |
3 | import android.content.Context;
4 | import android.content.res.Resources;
5 |
6 | /**
7 | * @author:luck
8 | * @date:2021/11/17 11:48 上午
9 | * @describe:DensityUtil
10 | */
11 | public class DensityUtil {
12 | /**
13 | * dp2px
14 | */
15 | public static int dip2px(Context context, float dpValue) {
16 | final float scale = context.getApplicationContext().getResources().getDisplayMetrics().density;
17 | return (int) (dpValue * scale + 0.5f);
18 | }
19 |
20 | /**
21 | * 获取状态栏高度
22 | */
23 | public static int getStatusBarHeight(Context context) {
24 | int result = 0;
25 | int resourceId = Resources.getSystem().getIdentifier("status_bar_height", "dimen", "android");
26 | if (resourceId > 0) {
27 | result = context.getResources().getDimensionPixelSize(resourceId);
28 | }
29 | return result == 0 ? dip2px(context, 26) : result;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/java/com/yalantis/ucrop/util/SelectedStateListDrawable.java:
--------------------------------------------------------------------------------
1 | package com.yalantis.ucrop.util;
2 |
3 | import android.graphics.PorterDuff;
4 | import android.graphics.drawable.Drawable;
5 | import android.graphics.drawable.StateListDrawable;
6 |
7 | /**
8 | * Hack class to properly support state drawable back to Android 1.6
9 | */
10 | public class SelectedStateListDrawable extends StateListDrawable {
11 |
12 | private int mSelectionColor;
13 |
14 | public SelectedStateListDrawable(Drawable drawable, int selectionColor) {
15 | super();
16 | this.mSelectionColor = selectionColor;
17 | addState(new int[]{android.R.attr.state_selected}, drawable);
18 | addState(new int[]{}, drawable);
19 | }
20 |
21 | @Override
22 | protected boolean onStateChange(int[] states) {
23 | boolean isStatePressedInArray = false;
24 | for (int state : states) {
25 | if (state == android.R.attr.state_selected) {
26 | isStatePressedInArray = true;
27 | }
28 | }
29 | if (isStatePressedInArray) {
30 | super.setColorFilter(mSelectionColor, PorterDuff.Mode.SRC_ATOP);
31 | } else {
32 | super.clearColorFilter();
33 | }
34 | return super.onStateChange(states);
35 | }
36 |
37 | @Override
38 | public boolean isStateful() {
39 | return true;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/kotlin/com/howl/hl_image_picker/CustomLoadingDialog.kt:
--------------------------------------------------------------------------------
1 | package com.howl.hl_image_picker
2 |
3 | import android.app.Dialog
4 | import android.content.Context
5 | import android.os.Bundle
6 | import android.view.Gravity
7 | import android.view.ViewGroup
8 | import android.widget.TextView
9 | import com.luck.picture.lib.R as PictureSelectorR
10 |
11 | class CustomLoadingDialog(context: Context, private val message: String?) : Dialog(context, PictureSelectorR.style.Picture_Theme_AlertDialog) {
12 |
13 | override fun onCreate(savedInstanceState: Bundle?) {
14 | super.onCreate(savedInstanceState)
15 | setContentView(R.layout.loading_dialog)
16 | setDialogSize()
17 | val loadingTextView = findViewById(R.id.loading_text)
18 | loadingTextView.text = message ?: "Loading"
19 | setCancelable(false)
20 | setCanceledOnTouchOutside(false)
21 | }
22 |
23 | private fun setDialogSize() {
24 | val params = window!!.attributes
25 | params.width = ViewGroup.LayoutParams.WRAP_CONTENT
26 | params.height = ViewGroup.LayoutParams.WRAP_CONTENT
27 | params.gravity = Gravity.CENTER
28 | window!!.setWindowAnimations(PictureSelectorR.style.PictureThemeDialogWindowStyle)
29 | window!!.attributes = params
30 | }
31 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/kotlin/com/howl/hl_image_picker/ImageFileCropEngine.kt:
--------------------------------------------------------------------------------
1 | package com.howl.hl_image_picker
2 |
3 | import android.content.Context
4 | import android.graphics.Bitmap
5 | import android.graphics.drawable.Drawable
6 | import android.net.Uri
7 | import android.widget.ImageView
8 | import androidx.fragment.app.Fragment
9 | import com.bumptech.glide.Glide
10 | import com.bumptech.glide.request.target.CustomTarget
11 | import com.bumptech.glide.request.transition.Transition
12 | import com.luck.picture.lib.engine.CropFileEngine
13 | import com.yalantis.ucrop.UCrop
14 | import com.yalantis.ucrop.UCropImageEngine
15 |
16 | class ImageFileCropEngine(private val uCropOptions: UCrop.Options, private val width: Int?, private val height: Int?) : CropFileEngine {
17 | override fun onStartCrop(fragment: Fragment, srcUri: Uri, destinationUri: Uri, dataSource: ArrayList, requestCode: Int) {
18 | val uCrop: UCrop = UCrop.of(srcUri, destinationUri, dataSource)
19 | uCrop.withOptions(uCropOptions)
20 | if(width != null && height != null) {
21 | uCrop.withMaxResultSize(width, height)
22 | }
23 | uCrop.setImageEngine(object : UCropImageEngine {
24 | override fun loadImage(context: Context, url: String, imageView: ImageView) {
25 | if (!ImageLoaderUtils.assertValidRequest(context)) {
26 | return
27 | }
28 | Glide.with(context).load(url).override(180, 180).into(imageView)
29 | }
30 |
31 | override fun loadImage(context: Context, url: Uri?, maxWidth: Int, maxHeight: Int, call: UCropImageEngine.OnCallbackListener?) {
32 | Glide.with(context).asBitmap().load(url).override(maxWidth, maxHeight).into(object : CustomTarget() {
33 | override fun onResourceReady(resource: Bitmap, transition: Transition?) {
34 | call?.onCall(resource)
35 | }
36 |
37 | override fun onLoadCleared(placeholder: Drawable?) {
38 | call?.onCall(null)
39 | }
40 | })
41 | }
42 | })
43 | uCrop.start(fragment.requireActivity(), fragment, requestCode)
44 | }
45 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/kotlin/com/howl/hl_image_picker/ImageLoaderUtils.kt:
--------------------------------------------------------------------------------
1 | package com.howl.hl_image_picker
2 |
3 | import android.app.Activity
4 | import android.content.Context
5 | import android.content.ContextWrapper
6 | import com.luck.picture.lib.utils.ActivityCompatHelper.isDestroy
7 |
8 | object ImageLoaderUtils {
9 | fun assertValidRequest(context: Context): Boolean {
10 | if (context is Activity) {
11 | val activity = context as Activity
12 | return !isDestroy(activity)
13 | } else if (context is ContextWrapper) {
14 | val contextWrapper = context as ContextWrapper
15 | if (contextWrapper.baseContext is Activity) {
16 | val activity = contextWrapper.baseContext as Activity
17 | return !isDestroy(activity)
18 | }
19 | }
20 | return true
21 | }
22 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/kotlin/com/howl/hl_image_picker/VideoThumbnailListener.kt:
--------------------------------------------------------------------------------
1 | package com.howl.hl_image_picker
2 |
3 | import android.content.Context
4 | import android.graphics.Bitmap
5 | import android.graphics.drawable.Drawable
6 | import com.bumptech.glide.Glide
7 | import com.bumptech.glide.request.target.CustomTarget
8 | import com.bumptech.glide.request.transition.Transition
9 | import com.luck.picture.lib.interfaces.OnKeyValueResultCallbackListener
10 | import com.luck.picture.lib.interfaces.OnVideoThumbnailEventListener
11 | import com.luck.picture.lib.utils.PictureFileUtils
12 | import java.io.ByteArrayOutputStream
13 | import java.io.File
14 | import java.io.FileOutputStream
15 | import java.io.IOException
16 |
17 | class VideoThumbnailEventListener(private val targetPath: String, private val compressQuality: Int, private val compressFormat: Bitmap.CompressFormat) : OnVideoThumbnailEventListener {
18 | override fun onVideoThumbnail(context: Context, videoPath: String, call: OnKeyValueResultCallbackListener) {
19 | Glide.with(context)
20 | .asBitmap()
21 | .sizeMultiplier(0.6F)
22 | .load(videoPath)
23 | .into(object : CustomTarget() {
24 | override fun onResourceReady(resource: Bitmap, transition: Transition?) {
25 | val stream = ByteArrayOutputStream()
26 | resource.compress(compressFormat, compressQuality, stream)
27 | var fos: FileOutputStream? = null
28 | var result: String? = null
29 | try {
30 | val targetFile = File(targetPath, "media_picker_" + System.currentTimeMillis() + ".jpg")
31 | fos = FileOutputStream(targetFile)
32 | fos.write(stream.toByteArray())
33 | fos.flush()
34 | result = targetFile.absolutePath
35 | } catch (e: IOException) {
36 | e.printStackTrace()
37 | } finally {
38 | PictureFileUtils.close(fos)
39 | PictureFileUtils.close(stream)
40 | }
41 | call.onCallback(videoPath, result)
42 | }
43 |
44 | override fun onLoadCleared(placeholder: Drawable?) {
45 | call.onCallback(videoPath, "")
46 | }
47 | })
48 | }
49 | }
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/anim/ucrop_item_animation_fall_down.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
11 |
19 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/anim/ucrop_layout_animation_fall_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/anim/ucrop_loader_circle_path.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
19 |
20 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/anim/ucrop_loader_circle_scale.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
19 |
20 |
27 |
28 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/color/ucrop_scale_text_view_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-hdpi/ucrop_ic_angle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-hdpi/ucrop_ic_angle.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-hdpi/ucrop_ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-hdpi/ucrop_ic_done.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-ldpi/ucrop_ic_angle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-ldpi/ucrop_ic_angle.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-ldpi/ucrop_ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-ldpi/ucrop_ic_done.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-mdpi/ucrop_ic_angle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-mdpi/ucrop_ic_angle.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-mdpi/ucrop_ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-mdpi/ucrop_ic_done.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-xhdpi/ucrop_ic_angle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-xhdpi/ucrop_ic_angle.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-xhdpi/ucrop_ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-xhdpi/ucrop_ic_done.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-xxhdpi/ucrop_ic_angle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-xxhdpi/ucrop_ic_angle.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-xxhdpi/ucrop_ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-xxhdpi/ucrop_ic_done.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-xxxhdpi/ucrop_ic_angle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-xxxhdpi/ucrop_ic_angle.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable-xxxhdpi/ucrop_ic_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable-xxxhdpi/ucrop_ic_done.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_arrow_down.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_multiple_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_multiple_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_multiple_unselected.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_preview_selected.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_preview_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_single_selected.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_single_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/hl_single_unselected.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ps_ic_black_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/android/src/main/res/drawable/ps_ic_black_back.png
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_crop.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_gallery_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
7 |
8 |
9 |
12 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_gallery_current.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_crop.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_crop_unselected.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_cross.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_next.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_reset.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_rotate.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_rotate_unselected.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_scale.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_ic_scale_unselected.xml:
--------------------------------------------------------------------------------
1 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_rotate.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_scale.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_shadow_upside.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_vector_ic_crop.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_vector_loader.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_vector_loader_animated.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/drawable/ucrop_wrapper_controls_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/loading_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
26 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_activity_multiple.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
24 |
25 |
26 |
27 |
33 |
34 |
39 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_activity_photobox.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 |
16 |
25 |
26 |
27 |
28 |
35 |
36 |
44 |
45 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_aspect_ratio.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_fragment_photobox.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_gallery_adapter_item.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
10 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_layout_rotate_wheel.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
25 |
26 |
31 |
32 |
35 |
36 |
37 |
38 |
45 |
46 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_layout_scale_wheel.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
19 |
20 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/layout/ucrop_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
13 |
14 |
19 |
20 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/menu/ucrop_menu_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #000000
6 | #FF6300
7 | #20242F
8 | #B3BECE
9 | #FFFFFF
10 |
11 |
12 | @color/ucrop_color_white
13 | #f5f5f5
14 | @color/ucrop_color_black
15 | @color/ucrop_color_black
16 | @color/ucrop_color_white
17 | @color/ucrop_color_blaze_orange
18 | @color/ucrop_color_heather
19 | @color/ucrop_color_blaze_orange
20 | @color/ucrop_color_ebony_clay
21 | @color/ucrop_color_blaze_orange
22 | @color/ucrop_color_ebony_clay
23 | @color/ucrop_color_ebony_clay
24 | @color/ucrop_color_blaze_orange
25 | @color/ucrop_color_ebony_clay
26 | @color/ucrop_color_black
27 | #666666
28 | #80000000
29 | #20000000
30 |
31 | #80ffffff
32 | #ffffff
33 | #8c000000
34 | #4f212121
35 |
36 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 8dp
6 | 20dp
7 | 2dp
8 | 4dp
9 | 10dp
10 | 64dp
11 | 72dp
12 | 3dp
13 | 13sp
14 | 11sp
15 | 10dp
16 | 4dp
17 | 50dp
18 | 40dp
19 | 30dp
20 |
21 |
22 | 200dp
23 | 1dp
24 | 1dp
25 | 30dp
26 | 100dp
27 | 10dp
28 |
29 |
30 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/values/public.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/main/res/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1500
4 |
--------------------------------------------------------------------------------
/hl_image_picker_android/android/src/test/kotlin/com/howl/hl_image_picker/HLImagePickerPluginTest.kt:
--------------------------------------------------------------------------------
1 | package com.howl.hl_image_picker
2 |
3 | import io.flutter.plugin.common.MethodCall
4 | import io.flutter.plugin.common.MethodChannel
5 | import kotlin.test.Test
6 | import org.mockito.Mockito
7 |
8 | /*
9 | * This demonstrates a simple unit test of the Kotlin portion of this plugin's implementation.
10 | *
11 | * Once you have built the plugin's example app, you can run these tests from the command
12 | * line by running `./gradlew testDebugUnitTest` in the `example/android/` directory, or
13 | * you can run them directly from IDEs that support JUnit such as Android Studio.
14 | */
15 |
16 | internal class HLImagePickerPluginTest {
17 | @Test
18 | fun onMethodCall_getPlatformVersion_returnsExpectedValue() {
19 | val plugin = HLImagePickerPlugin()
20 |
21 | val call = MethodCall("getPlatformVersion", null)
22 | val mockResult: MethodChannel.Result = Mockito.mock(MethodChannel.Result::class.java)
23 | plugin.onMethodCall(call, mockResult)
24 |
25 | Mockito.verify(mockResult).success("Android " + android.os.Build.VERSION.RELEASE)
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/README.md:
--------------------------------------------------------------------------------
1 | # hl_image_picker_android_example
2 |
3 | Demonstrates how to use the hl_image_picker_android plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | namespace "com.howl.hl_image_picker_android_example"
30 | compileSdkVersion flutter.compileSdkVersion
31 | ndkVersion flutter.ndkVersion
32 |
33 | compileOptions {
34 | sourceCompatibility JavaVersion.VERSION_1_8
35 | targetCompatibility JavaVersion.VERSION_1_8
36 | }
37 |
38 | kotlinOptions {
39 | jvmTarget = '1.8'
40 | }
41 |
42 | sourceSets {
43 | main.java.srcDirs += 'src/main/kotlin'
44 | }
45 |
46 | defaultConfig {
47 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
48 | applicationId "com.howl.hl_image_picker_android_example"
49 | // You can update the following values to match your application needs.
50 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
51 | minSdkVersion 21
52 | targetSdkVersion flutter.targetSdkVersion
53 | versionCode flutterVersionCode.toInteger()
54 | versionName flutterVersionName
55 | }
56 |
57 | buildTypes {
58 | release {
59 | // TODO: Add your own signing config for the release build.
60 | // Signing with the debug keys for now, so `flutter run --release` works.
61 | signingConfig signingConfigs.debug
62 | }
63 | }
64 | }
65 |
66 | flutter {
67 | source '../..'
68 | }
69 |
70 | dependencies {
71 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72 | }
73 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
26 |
30 |
34 |
35 |
36 |
37 |
38 |
39 |
41 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/kotlin/com/howl/hl_image_picker_android_example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.howl.hl_image_picker_android_example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_android/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.4.2'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | tasks.register("clean", Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/lib/widgets/custom_switch.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | class CustomSwitch extends StatelessWidget {
4 | const CustomSwitch(
5 | {super.key, required this.label, required this.value, this.onChanged});
6 |
7 | final String label;
8 | final bool value;
9 | final ValueChanged? onChanged;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Padding(
14 | padding: const EdgeInsets.only(top: 16.0),
15 | child: Row(
16 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
17 | children: [
18 | Text(label),
19 | const SizedBox(width: 16),
20 | CupertinoSwitch(
21 | value: value,
22 | onChanged: onChanged,
23 | )
24 | ],
25 | ),
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/lib/widgets/increase_decrease.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class IncreaseAndDecrease extends StatelessWidget {
4 | const IncreaseAndDecrease(
5 | {super.key,
6 | required this.value,
7 | required this.onChanged,
8 | required this.label});
9 |
10 | final String label;
11 | final int value;
12 | final Function(int value) onChanged;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | return Padding(
17 | padding: const EdgeInsets.only(top: 16.0),
18 | child: Row(
19 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
20 | children: [
21 | Text(label),
22 | const SizedBox(width: 16),
23 | Row(
24 | children: [
25 | Material(
26 | color: value == 1 ? Colors.grey[300] : Colors.blue,
27 | borderRadius: BorderRadius.circular(4),
28 | child: InkWell(
29 | onTap: value == 1 ? null : () => onChanged(value - 1),
30 | child: Container(
31 | width: 24,
32 | height: 24,
33 | alignment: Alignment.center,
34 | child: const Text(
35 | '-',
36 | style: TextStyle(
37 | fontSize: 16,
38 | fontWeight: FontWeight.bold,
39 | color: Colors.white),
40 | ),
41 | ),
42 | ),
43 | ),
44 | SizedBox(
45 | width: 40,
46 | child: Text(
47 | value.toString(),
48 | textAlign: TextAlign.center,
49 | )),
50 | Material(
51 | color: Colors.blue,
52 | borderRadius: BorderRadius.circular(4),
53 | child: InkWell(
54 | onTap: () => onChanged(value + 1),
55 | child: Container(
56 | width: 24,
57 | height: 24,
58 | alignment: Alignment.center,
59 | child: const Text(
60 | '+',
61 | style: TextStyle(
62 | fontSize: 16,
63 | fontWeight: FontWeight.bold,
64 | color: Colors.white),
65 | ),
66 | ),
67 | ),
68 | ),
69 | ],
70 | )
71 | ],
72 | ),
73 | );
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/lib/widgets/media_preview.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:hl_image_picker_android/hl_image_picker_android.dart';
5 |
6 | class MediaPreview extends StatelessWidget {
7 | const MediaPreview({
8 | super.key,
9 | required this.items,
10 | });
11 |
12 | final List items;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | if (items.isEmpty) {
17 | return Container(
18 | height: 240,
19 | color: Colors.grey[300],
20 | child: const Center(
21 | child: Text('Empty'),
22 | ),
23 | );
24 | }
25 |
26 | return SizedBox(
27 | height: 240,
28 | width: double.infinity,
29 | child: ListView.separated(
30 | padding: const EdgeInsets.all(8),
31 | physics: const AlwaysScrollableScrollPhysics(),
32 | scrollDirection: Axis.horizontal,
33 | itemCount: items.length,
34 | itemBuilder: (_, index) {
35 | File? imageFile = File(items[index].path);
36 | if (items[index].type == "video") {
37 | imageFile = items[index].thumbnail != null
38 | ? File(items[index].thumbnail!)
39 | : null;
40 | }
41 | return imageFile != null
42 | ? InkWell(
43 | onTap: items[index].type == "video" ? () {} : null,
44 | child: Image.file(imageFile))
45 | : Container(
46 | decoration: BoxDecoration(
47 | color: Colors.grey[300],
48 | borderRadius: BorderRadius.circular(4),
49 | ),
50 | alignment: Alignment.center,
51 | width: 320,
52 | height: double.infinity,
53 | child: const Text('No thumbnail'));
54 | },
55 | separatorBuilder: (BuildContext context, int index) =>
56 | const SizedBox(width: 8.0),
57 | ),
58 | );
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/hl_image_picker_android/example/lib/widgets/media_type_select.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:hl_image_picker_android/hl_image_picker_android.dart';
3 |
4 | class MediaTypeSelect extends StatelessWidget {
5 | const MediaTypeSelect({super.key, required this.value, this.onChanged});
6 |
7 | final MediaType value;
8 |
9 | final void Function(MediaType? type)? onChanged;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Row(
14 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
15 | children: [
16 | const Text('Media type'),
17 | const SizedBox(width: 16),
18 | DropdownButton(
19 | items: const [
20 | DropdownMenuItem(
21 | value: MediaType.all,
22 | child: Text('All'),
23 | ),
24 | DropdownMenuItem(
25 | value: MediaType.image,
26 | child: Text('Image'),
27 | ),
28 | DropdownMenuItem(
29 | value: MediaType.video,
30 | child: Text('Video'),
31 | ),
32 | ],
33 | value: value,
34 | onChanged: onChanged,
35 | )
36 | ],
37 | );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/hl_image_picker_android/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: hl_image_picker_android
2 | description: Android implementation of the hl_image_picker plugin.
3 | repository: https://github.com/howljs/hl_image_picker/tree/main/hl_image_picker_android
4 | issue_tracker: https://github.com/howljs/hl_image_picker/issues
5 |
6 | version: 1.2.11
7 |
8 | environment:
9 | sdk: ">=2.18.0 <4.0.0"
10 | flutter: ">=3.3.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 | hl_image_picker_platform_interface: ^1.2.4
16 |
17 | dev_dependencies:
18 | flutter_test:
19 | sdk: flutter
20 | flutter_lints: ^2.0.0
21 | plugin_platform_interface: ^2.0.2
22 |
23 | flutter:
24 | plugin:
25 | platforms:
26 | android:
27 | package: com.howl.hl_image_picker
28 | pluginClass: HLImagePickerPlugin
29 | dartPluginClass: HLImagePickerAndroid
30 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: plugin
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
18 | - platform: ios
19 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
20 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.2.10
2 |
3 | * Encode the path when opening the cropper
4 |
5 | ## 1.2.9
6 |
7 | * Fix issue of not returning image when cropper screen is closed
8 |
9 | ## 1.2.8
10 |
11 | * Support crop multiple images
12 |
13 | ## 1.2.7
14 |
15 | * Deprecate `recordVideoMaxSecond` in HLImagePickerOptions
16 | * Remove default value for `recordVideoMaxSecond` in HLCameraOptions
17 | * Change exportPreset to `AVAssetExportPresetPassthrough`
18 |
19 | ## 1.2.6
20 |
21 | * fix: not possible preselect compressed photos
22 |
23 | ## 1.2.5
24 |
25 | * Support quality compression for selected images
26 | * Can set maxSizeOutput (maxWidth and maxHeight) for selected images
27 |
28 | ## 1.2.4
29 |
30 | - fix: maxFileSize and minFileSize are not working
31 | - feat: support gif selection
32 |
33 | ## 1.2.3
34 |
35 | - Fix the issue of not returning image when cropper screen is closed.
36 |
37 | ## 1.2.2
38 |
39 | - Dismiss camera preview before open cropper
40 |
41 | - ## 1.2.1
42 |
43 | - Fix duplicate alert when album permission is denied
44 |
45 | - ## 1.2.0
46 |
47 | - Update documentation
48 |
49 | ## 1.1.2
50 |
51 | - Update SDK constraints: ">=2.18.0 <4.0.0"
52 |
53 | ## 1.1.1
54 |
55 | - Update podspec version
56 |
57 | ## 1.1.0
58 |
59 | - Update UI
60 |
61 | ## 1.0.2
62 |
63 | - Fix error when open iOS camera - (UINavigationController.delegate must be used from main thread only)
64 |
65 | ## 1.0.1
66 |
67 | - Add custom text for crop image UI
68 |
69 | ## 1.0.0
70 |
71 | - Initial release.
72 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 howljs
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
--------------------------------------------------------------------------------
/hl_image_picker_ios/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | # Additional information about this file can be found at
4 | # https://dart.dev/guides/language/analysis-options
5 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .packages
31 | .pub-cache/
32 | .pub/
33 | /build/
34 |
35 | # Symbolication related
36 | app.*.symbols
37 |
38 | # Obfuscation related
39 | app.*.map.json
40 |
41 | # Android Studio will place build artifacts here
42 | /android/app/debug
43 | /android/app/profile
44 | /android/app/release
45 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/README.md:
--------------------------------------------------------------------------------
1 | # hl_image_picker_ios_example
2 |
3 | Demonstrates how to use the hl_image_picker_ios plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 11.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '11.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | target 'RunnerTests' do
36 | inherit! :search_paths
37 | end
38 | end
39 |
40 | post_install do |installer|
41 | installer.pods_project.targets.each do |target|
42 | flutter_additional_ios_build_settings(target)
43 | end
44 | end
45 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | HL Image Picker Ios
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | hl_image_picker_ios_example
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 | CADisableMinimumFrameDurationOnPhone
47 |
48 | UIApplicationSupportsIndirectInputEvents
49 |
50 | NSCameraUsageDescription
51 | NSCameraUsageDescription
52 | NSMicrophoneUsageDescription
53 | NSMicrophoneUsageDescription
54 | NSPhotoLibraryUsageDescription
55 | NSPhotoLibraryUsageDescription
56 | PHPhotoLibraryPreventAutomaticLimitedAccessAlert
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | @testable import hl_image_picker_ios
6 |
7 | // This demonstrates a simple unit test of the Swift portion of this plugin's implementation.
8 | //
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 |
11 | class RunnerTests: XCTestCase {
12 |
13 | func testGetPlatformVersion() {
14 | let plugin = HLImagePickerIosPlugin()
15 |
16 | let call = FlutterMethodCall(methodName: "getPlatformVersion", arguments: [])
17 |
18 | let resultExpectation = expectation(description: "result block must be called.")
19 | plugin.handle(call) { result in
20 | XCTAssertEqual(result as! String, "iOS " + UIDevice.current.systemVersion)
21 | resultExpectation.fulfill()
22 | }
23 | waitForExpectations(timeout: 1)
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/lib/widgets/custom_switch.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | class CustomSwitch extends StatelessWidget {
4 | const CustomSwitch(
5 | {super.key, required this.label, required this.value, this.onChanged});
6 |
7 | final String label;
8 | final bool value;
9 | final ValueChanged? onChanged;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Padding(
14 | padding: const EdgeInsets.only(top: 16.0),
15 | child: Row(
16 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
17 | children: [
18 | Text(label),
19 | const SizedBox(width: 16),
20 | CupertinoSwitch(
21 | value: value,
22 | onChanged: onChanged,
23 | )
24 | ],
25 | ),
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/lib/widgets/media_preview.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:hl_image_picker_ios/hl_image_picker_ios.dart';
5 |
6 | class MediaPreview extends StatelessWidget {
7 | const MediaPreview({
8 | super.key,
9 | required this.items,
10 | });
11 |
12 | final List items;
13 |
14 | @override
15 | Widget build(BuildContext context) {
16 | if (items.isEmpty) {
17 | return Container(
18 | height: 240,
19 | color: Colors.grey[300],
20 | child: const Center(
21 | child: Text('Empty'),
22 | ),
23 | );
24 | }
25 |
26 | return SizedBox(
27 | height: 240,
28 | width: double.infinity,
29 | child: ListView.separated(
30 | padding: const EdgeInsets.all(8),
31 | physics: const AlwaysScrollableScrollPhysics(),
32 | scrollDirection: Axis.horizontal,
33 | itemCount: items.length,
34 | itemBuilder: (_, index) {
35 | File? imageFile = File(items[index].path);
36 | if (items[index].type == "video") {
37 | imageFile = items[index].thumbnail != null
38 | ? File(items[index].thumbnail!)
39 | : null;
40 | }
41 | return imageFile != null
42 | ? InkWell(
43 | onTap: items[index].type == "video" ? () {} : null,
44 | child: Image.file(imageFile))
45 | : Container(
46 | decoration: BoxDecoration(
47 | color: Colors.grey[300],
48 | borderRadius: BorderRadius.circular(4),
49 | ),
50 | alignment: Alignment.center,
51 | width: 320,
52 | height: double.infinity,
53 | child: const Text('No thumbnail'));
54 | },
55 | separatorBuilder: (BuildContext context, int index) =>
56 | const SizedBox(width: 8.0),
57 | ),
58 | );
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/example/lib/widgets/media_type_select.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:hl_image_picker_ios/hl_image_picker_ios.dart';
3 |
4 | class MediaTypeSelect extends StatelessWidget {
5 | const MediaTypeSelect({super.key, required this.value, this.onChanged});
6 |
7 | final MediaType value;
8 |
9 | final void Function(MediaType? type)? onChanged;
10 |
11 | @override
12 | Widget build(BuildContext context) {
13 | return Row(
14 | mainAxisAlignment: MainAxisAlignment.spaceBetween,
15 | children: [
16 | const Text('Media type'),
17 | const SizedBox(width: 16),
18 | DropdownButton(
19 | items: const [
20 | DropdownMenuItem(
21 | value: MediaType.all,
22 | child: Text('All'),
23 | ),
24 | DropdownMenuItem(
25 | value: MediaType.image,
26 | child: Text('Image'),
27 | ),
28 | DropdownMenuItem(
29 | value: MediaType.video,
30 | child: Text('Video'),
31 | ),
32 | ],
33 | value: value,
34 | onChanged: onChanged,
35 | )
36 | ],
37 | );
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 | /Flutter/ephemeral/
38 | /Flutter/flutter_export_environment.sh
--------------------------------------------------------------------------------
/hl_image_picker_ios/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/howljs/hl_image_picker/f55d0bfc20400fe6f9e652a73c8aa4b8f3cd8f27/hl_image_picker_ios/ios/Assets/.gitkeep
--------------------------------------------------------------------------------
/hl_image_picker_ios/ios/hl_image_picker_ios.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
3 | # Run `pod lib lint hl_image_picker_ios.podspec` to validate before publishing.
4 | #
5 | Pod::Spec.new do |s|
6 | s.name = 'hl_image_picker_ios'
7 | s.version = '1.2.3'
8 | s.summary = 'Choose images/videos from the library, crop images, and capture new photos/videos with ease.'
9 | s.description = <<-DESC
10 | Choose images/videos from the library, crop images, and capture new photos/videos with ease.
11 | DESC
12 | s.homepage = 'https://github.com/howljs/hl_image_picker/tree/main/hl_image_picker_ios'
13 | s.license = { :file => '../LICENSE' }
14 | s.author = { 'Howl' => 'lehau.dev@gmail.com' }
15 | s.source = { :path => '.' }
16 | s.source_files = 'Classes/**/*'
17 | s.dependency 'Flutter'
18 | s.dependency 'TLPhotoPicker'
19 | s.dependency 'CropViewController'
20 | s.platform = :ios, '11.0'
21 |
22 | # Flutter.framework does not contain a i386 slice.
23 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
24 | s.swift_version = '5.0'
25 | end
26 |
--------------------------------------------------------------------------------
/hl_image_picker_ios/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: hl_image_picker_ios
2 | description: iOS implementation of the hl_image_picker plugin.
3 | repository: https://github.com/howljs/hl_image_picker/tree/main/hl_image_picker_ios
4 | issue_tracker: https://github.com/howljs/hl_image_picker/issues
5 |
6 | version: 1.2.10
7 |
8 | environment:
9 | sdk: ">=2.18.0 <4.0.0"
10 | flutter: ">=3.3.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 | hl_image_picker_platform_interface: ^1.2.4
16 |
17 | dev_dependencies:
18 | flutter_test:
19 | sdk: flutter
20 | flutter_lints: ^2.0.0
21 | plugin_platform_interface: ^2.0.2
22 |
23 | flutter:
24 | plugin:
25 | platforms:
26 | ios:
27 | dartPluginClass: HLImagePickerIOS
28 | pluginClass: HLImagePickerPlugin
29 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled.
5 |
6 | version:
7 | revision: 796c8ef79279f9c774545b3771238c3098dbefab
8 | channel: stable
9 |
10 | project_type: plugin
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 796c8ef79279f9c774545b3771238c3098dbefab
17 | base_revision: 796c8ef79279f9c774545b3771238c3098dbefab
18 |
19 | # User provided section
20 |
21 | # List of Local paths (relative to this file) that should be
22 | # ignored by the migrate tool.
23 | #
24 | # Files that are not part of the templates will be ignored by default.
25 | unmanaged_files:
26 | - 'lib/main.dart'
27 | - 'ios/Runner.xcodeproj/project.pbxproj'
28 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## 1.2.4
2 |
3 | * Add decode path
4 |
5 | ## 1.2.3
6 |
7 | * Deprecate `recordVideoMaxSecond` in HLImagePickerOptions
8 | * Remove default value for `recordVideoMaxSecond` in HLCameraOptions
9 |
10 | ## 1.2.2
11 |
12 | * Support quality compression for selected images
13 | * Can set maxSizeOutput (maxWidth and maxHeight) for selected images
14 |
15 | ## 1.2.1
16 |
17 | * Change data type of maxFileSize and minFileSize from int to double
18 | * Support gif selection
19 |
20 | ## 1.2.0
21 |
22 | * Update documentation
23 |
24 | ## 1.1.2
25 |
26 | * Update SDK constraints: ">=2.18.0 <4.0.0"
27 |
28 | ## 1.1.1
29 |
30 | * Update podspec version
31 |
32 | ## 1.1.0
33 |
34 | * Update UI
35 |
36 | ## 1.0.1
37 |
38 | * Add custom text for crop image UI
39 |
40 | ## 1.0.0
41 |
42 | * Initial release.
43 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 howljs
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/README.md:
--------------------------------------------------------------------------------
1 | # hl_image_picker_platform_interface
2 |
3 | A common platform interface for the [hl_image_picker](https://pub.dev/packages/hl_image_picker) plugin.
4 |
5 | ## Usage
6 |
7 | To implement a new platform-specific implementation of `hl_image_picker`,
8 | 1. Extend **HLImagePickerPlatform** with an implementation that performs the platform-specific behavior.
9 | 2. When you register your plugin, set the default HLImagePickerPlatform by calling HLImagePickerPlatform.instance = HLImagePickerPlatform().
10 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:flutter_lints/flutter.yaml
2 |
3 | # Additional information about this file can be found at
4 | # https://dart.dev/guides/language/analysis-options
5 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/lib/hl_image_picker_platform_interface.dart:
--------------------------------------------------------------------------------
1 | library hl_image_picker_platform_interface;
2 |
3 | export 'src/camera_options.dart';
4 | export 'src/constants.dart';
5 | export 'src/crop_options.dart';
6 | export 'src/picker_item.dart';
7 | export 'src/picker_options.dart';
8 | export 'src/platform_interface/platform_interface_hl_image_picker.dart';
9 | export 'src/picker_localized.dart';
10 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/lib/src/camera_options.dart:
--------------------------------------------------------------------------------
1 | import 'package:hl_image_picker_platform_interface/hl_image_picker_platform_interface.dart';
2 |
3 | class HLCameraOptions {
4 | const HLCameraOptions({
5 | this.cameraType,
6 | this.recordVideoMaxSecond,
7 | this.isExportThumbnail,
8 | this.compressQuality,
9 | this.compressFormat,
10 | this.thumbnailCompressQuality,
11 | this.thumbnailCompressFormat,
12 | this.maxSizeOutput,
13 | });
14 |
15 | /// Specifies the type of camera to be used: [CameraType.video], [CameraType.image]
16 | ///
17 | /// Default: [CameraType.image]
18 | final CameraType? cameraType;
19 |
20 | /// The maximum duration (in seconds) for recorded video.
21 | final int? recordVideoMaxSecond;
22 |
23 | /// Determines whether to export thumbnail for recorded video.
24 | final bool? isExportThumbnail;
25 |
26 | /// The compression quality for selected image.
27 | final double? compressQuality;
28 |
29 | /// The image format for selected image: [CompressFormat.jpg], [CompressFormat.png].
30 | ///
31 | /// Default: [CompressFormat.jpg]
32 | final CompressFormat? compressFormat;
33 |
34 | /// The compression quality for exported thumbnail.
35 | ///
36 | /// Min: `0.1` - Max: `1`
37 | ///
38 | /// Default: `0.9`
39 | final double? thumbnailCompressQuality;
40 |
41 | /// The image format for exported thumbnail: [CompressFormat.jpg], [CompressFormat.png].
42 | ///
43 | /// Default: [CompressFormat.jpg]
44 | final CompressFormat? thumbnailCompressFormat;
45 |
46 | final MaxSizeOutput? maxSizeOutput;
47 |
48 | Map toMap() {
49 | final result = {};
50 | result['cameraType'] = cameraType?.name;
51 | result['recordVideoMaxSecond'] = recordVideoMaxSecond;
52 | result['isExportThumbnail'] = isExportThumbnail;
53 | result['thumbnailCompressQuality'] = thumbnailCompressQuality;
54 | result['thumbnailCompressFormat'] = thumbnailCompressFormat;
55 | result['cameraCompressQuality'] = compressQuality;
56 | result['cameraCompressFormat'] = compressFormat;
57 | result['cameraMaxSizeOutput'] = maxSizeOutput?.toMap();
58 | return result;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/lib/src/constants.dart:
--------------------------------------------------------------------------------
1 | enum CroppingStyle { normal, circular }
2 |
3 | enum MediaType { image, video, all }
4 |
5 | enum CameraType { image, video }
6 |
7 | enum CompressFormat { png, jpg }
8 |
9 | enum CropAspectRatioPreset {
10 | original,
11 | square,
12 | ratio3x2,
13 | ratio4x3,
14 | ratio5x3,
15 | ratio5x4,
16 | ratio16x9,
17 | }
18 |
19 | extension CropAspectRatioPresetX on CropAspectRatioPreset {
20 | String get value {
21 | switch (this) {
22 | case CropAspectRatioPreset.square:
23 | return 'square';
24 | case CropAspectRatioPreset.ratio3x2:
25 | return '3x2';
26 | case CropAspectRatioPreset.ratio4x3:
27 | return '4x3';
28 | case CropAspectRatioPreset.ratio5x3:
29 | return '5x3';
30 | case CropAspectRatioPreset.ratio5x4:
31 | return '5x4';
32 | case CropAspectRatioPreset.ratio16x9:
33 | return '16x9';
34 | default:
35 | return 'original';
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/lib/src/method_channel/method_channel_hl_image_picker.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/services.dart';
3 |
4 | import '../platform_interface/platform_interface_hl_image_picker.dart';
5 |
6 | /// An implementation of [HLImagePickerPlatform] that uses method channels.
7 | class MethodChannelHLImagePicker extends HLImagePickerPlatform {
8 | /// The method channel used to interact with the native platform.
9 | @visibleForTesting
10 | final methodChannel = const MethodChannel('com.howl.plugin/hl_image_picker');
11 | }
12 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/lib/src/picker_item.dart:
--------------------------------------------------------------------------------
1 | class HLPickerItem {
2 | const HLPickerItem({
3 | required this.path,
4 | required this.id,
5 | required this.name,
6 | required this.mimeType,
7 | required this.size,
8 | required this.width,
9 | required this.height,
10 | required this.type,
11 | this.duration,
12 | this.thumbnail,
13 | });
14 |
15 | final String path;
16 | final String id;
17 | final String name;
18 | final String mimeType;
19 | final int size;
20 | final int width;
21 | final int height;
22 | final String type;
23 | final double? duration;
24 | final String? thumbnail;
25 |
26 | factory HLPickerItem.fromMap(Map json) => HLPickerItem(
27 | path: Uri.decodeFull(json['path']),
28 | id: json['id'],
29 | name: json['name'],
30 | mimeType: json['mimeType'],
31 | size: json['size'],
32 | width: json['width'],
33 | height: json['height'],
34 | duration: json['duration'],
35 | thumbnail: json['thumbnail'],
36 | type: json['type'],
37 | );
38 |
39 | Map toMap() {
40 | final data = {};
41 | data['path'] = path;
42 | data['id'] = id;
43 | data['name'] = name;
44 | data['mimeType'] = mimeType;
45 | data['size'] = size;
46 | data['width'] = width;
47 | data['height'] = height;
48 | data['duration'] = duration;
49 | data['thumbnail'] = thumbnail;
50 | data['type'] = type;
51 | return data;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/lib/src/platform_interface/platform_interface_hl_image_picker.dart:
--------------------------------------------------------------------------------
1 | import 'package:plugin_platform_interface/plugin_platform_interface.dart';
2 |
3 | import '../camera_options.dart';
4 | import '../crop_options.dart';
5 | import '../method_channel/method_channel_hl_image_picker.dart';
6 | import '../picker_item.dart';
7 | import '../picker_options.dart';
8 | import '../picker_localized.dart';
9 |
10 | abstract class HLImagePickerPlatform extends PlatformInterface {
11 | /// Constructs a HLImagePickerPlatform.
12 | HLImagePickerPlatform() : super(token: _token);
13 |
14 | static final Object _token = Object();
15 |
16 | static HLImagePickerPlatform _instance = MethodChannelHLImagePicker();
17 |
18 | /// The default instance of [HLImagePickerPlatform] to use.
19 | ///
20 | /// Defaults to [MethodChannelHLImagePicker].
21 | static HLImagePickerPlatform get instance => _instance;
22 |
23 | /// Platform-specific implementations should set this with their own
24 | /// platform-specific class that extends [HLImagePickerPlatform] when
25 | /// they register themselves.
26 | static set instance(HLImagePickerPlatform instance) {
27 | PlatformInterface.verifyToken(instance, _token);
28 | _instance = instance;
29 | }
30 |
31 | Future> openPicker({
32 | List? selectedIds,
33 | HLPickerOptions? pickerOptions,
34 | bool? cropping,
35 | HLCropOptions? cropOptions,
36 | LocalizedImagePicker? localized,
37 | }) {
38 | throw UnimplementedError('openPicker() has not been implemented.');
39 | }
40 |
41 | Future openCamera({
42 | HLCameraOptions? cameraOptions,
43 | bool? cropping,
44 | HLCropOptions? cropOptions,
45 | LocalizedImageCropper? localized,
46 | }) {
47 | throw UnimplementedError('openCamera() has not been implemented.');
48 | }
49 |
50 | Future openCropper(
51 | String imagePath, {
52 | HLCropOptions? cropOptions,
53 | LocalizedImageCropper? localized,
54 | }) {
55 | throw UnimplementedError('openCropper() has not been implemented.');
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/hl_image_picker_platform_interface/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: hl_image_picker_platform_interface
2 | description: A common platform interface for the hl_image_picker plugin.
3 | repository: https://github.com/howljs/hl_image_picker/tree/main/hl_image_picker_platform_interface
4 | issue_tracker: https://github.com/howljs/hl_image_picker/issues
5 |
6 | version: 1.2.4
7 |
8 | environment:
9 | sdk: ">=2.18.0 <4.0.0"
10 | flutter: ">=3.3.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 | plugin_platform_interface: ^2.0.2
16 |
17 | dev_dependencies:
18 | flutter_test:
19 | sdk: flutter
20 | flutter_lints: ^2.0.0
--------------------------------------------------------------------------------