Giter Site home page Giter Site logo

weta-vn / advance_image_picker Goto Github PK

View Code? Open in Web Editor NEW
107.0 107.0 46.0 9.7 MB

Flutter plugin for selecting multiple images from the Android and iOS image library, taking new pictures with the camera, and edit them before using such as rotating, cropping, adding sticker/filters.

License: BSD 3-Clause "New" or "Revised" License

Dart 98.87% Kotlin 0.07% Ruby 0.80% Swift 0.24% Objective-C 0.02%
android flutter flutter-camera flutter-image-picker flutter-images-picker flutter-multiple-images-picker flutter-package flutter-picker image image-picker ios

advance_image_picker's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

advance_image_picker's Issues

Issue : Denying the authorisation leads to a black screen forever

Hi !

Some of our users have been reporting an unclear situation : when they deny the camera or the gallery picker, they're faced against a black screen content, making the information unclear.
Either asking again for the authorization or display the information clearly would fix this, no idea if this is planned or possible through a way.

Thanks !

(Question): Circular Image crop

Hi,

I was wondering if it will be possible to have a circular cropping area instead of the normal squarish one?

Thanks in advance

Crop

Ios Gallery Album Pick RangeError

I get a "RangeError (index): Invalid value: Valid value range is empty: 0" error when selecting different album.
This only happens on IOS, I didn't have a problem on android.

DIY:
Open the gallery to select a picture.
Click Recents to look at other albums from the top and I get rangeError error.

Any error does not appear in the console.

I think the problem is (await a.getAssetListRange(start: 0, end: 1))
.first
.thumbnailDataWithSize)

This is related to the code block because in android it doesn't come empty while in ios some of them come empty.

IOS VER: 14.4
FLUTTER VER: 3

New ImagePickerConfigs features.

Hi,

I'm submitting a rather large PR #27

Here are its highlights:

  • Fix all remaining linter warnings
  • Dependency updates
  • Add missing document comments and comment updates
  • Several new ImagePickerConfigs configuration options, all none breaking, old behaviour remain as default

Full details below.

Fix remaining linter warnings

  • Lint fix: Missing documentation lint. Comments added, feel free to improve the doc comments. rydmike@e3da02a
  • Lint fix: Lines longer than 80 char. rydmike@7984e63
  • Lint fix: unawaited_futures rydmike@b931233
  • Lint: Enable lint to find prints, replace prints with the log utility rydmike@058d915
  • Lint fix: add late rydmike@c4a81a7
  • Lint fix: remove unnecessary_await_in_return rydmike@412449f
  • Implementation detail: The Filter class can be const for efficiency and have const preset list values. rydmike@3119697
  • Lint fix: avoid_dynamic_calls - give onTapRemove the callback function the specific parameter type it actually uses rydmike@dfda926
  • Lint fix: prefer_null_aware_method_calls rydmike@d6b20de
  • Lint fix: unnecessary_nullable_for_final_variable_declarations rydmike@e49fe38
  • Lint fix: join_return_with_assignment rydmike@db83768
  • Lint fix: ignore prefer_mixin + doc edits. rydmike@fb7086d
  • Lint fix: cast_nullable_to_non_nullable rydmike@4768c02
  • Lint fix: use_build_context_synchronously rydmike@652eb55
  • Lint fix: parameter_assignments rydmike@cfe950e
  • Lint fix: prefer_function_declarations_over_variables rydmike@f23a5f2
  • Implementation detail: Make image filter params static const, getter not needed, a bit more efficient. rydmike@f0754e1
  • Fix my lint edit fix for: use_build_context_synchronously, where I put two } } in wrong place. rydmike@383a579
  • Lint fix: Last lint warning: cast_nullable_to_non_nullable. rydmike@0a10743

Dependency updates

  • Upgrade all dependencies, most notably image_editor to version 1.0.1 that now uses Android embedding V2. rydmike@4a7ded6

Document comments and comment updates

  • ONLY document and comment updates. rydmike@20c518e
    • Improved comments, they can still be further refined.
    • Fixed some typos
    • Added . after each comment/sentence. This is just a style the Flutter/Dart recommends for comments, not so important, but easy enough to follow, it of course matters a bit when they end up in the API docs. It looks nicer when sentences end with a dot when you read it there.
  • Run "flutter format ." to make sure pub.dev is happy. rydmike@46d98e9
  • Update change log and bump package pub.dev version. rydmike@e9be3cf

New features

  • FEATURE: New config: Starting flashMode and add option remove FlashMode button - none breaking. rydmike@b07eec7
  • FEATURE: Add config option to show/hide lens direction button. rydmike@dc93452
  • FEATURE: Only add the text line for textSelectedImagesGuide if it notempty. rydmike@c12d587
  • FEATURE: For label 'textSelectedImagesTitle' only show it, the ":" +space after it, if it is not empty. rydmike@9866959
  • FEATURE: IconButton done option instead of OutlinedButton. Option: Hide done action when nothing selected. rydmike@282d909
  • FEATURE: Optional alert when removing selected images. rydmike@1bd2ee3

Member not found: 'ImageCropper.cropImage'

I have copied and pasted same code which is given in example section. But it is showing the
Error: Member not found: 'ImageCropper.cropImage'.
ImageCropper.cropImage(
^^^^^^^^^

NEW FEATURE: Platform aware confirmation dialogs

Currently advance_image_picker always uses Material style confirmation dialogs. This is not ideal for iPhone/iPad users, since iOS users feel more at home when dialogs use native looking confirmation dialog style.

Add a new feature that by default uses:

  • Cupertino style confirmation dialogs on iOS and macOS.
  • Material style confirmation dialogs on all other platforms.

A configuration option would be provided that offers:

  • dialogStyle: DialogStyle.platform - Platform adaptive. This would be the new default style! Minor style break with past versions!
  • dialogStyle: DialogStyle.materail - Material style. Currently this is always used and the only choice.
  • dialogStyle: DialogStyle.cupertino - Cupertino/iOS style.

This issue is summitted so it can be marked in this issue when it is being worked on. I might work on it myself later.

Black background for edited image

_20211013_000550
_20211013_000609
When I select an image without a background, it appears without a background, but when I edit it, such as cropping or adjusting brightness, it appears with a black background as shown in the image.
How can i fix that???

NEW FEATURE: Alternative locations for the DONE button.

Make it possible to use alternative placement for the DONE button in the advance_image_picker

In addition to AppBar end location it could support:

  • Bottom left/start.
  • Bottom right/end.

The feature would make quick one handed usage of the camera in portrait possible, just snap pics and send them away without reaching for the top of the phone, that is very far away on tall modern phones.

This feature can be added without breaking past configuration that would remain as default.


This issue is summitted so it can be marked in this issue when it is being worked on. I might work on it myself later.

Discussion and suggestion: Add linting to the package

Linting Proposal for advance_image_picker

I suggested in discussions elsewhere that it could be a good idea to add linting to this package to ensure a consistent style and minimize the risk of potential issues and bugs.

So what is Dart linting?

You can read more about it my blog here: https://rydmike.com/blog_flutter_linting
Remi (Provider, Riverpod etc author) also wrote about it here: https://dash-overflow.net/articles/getting_started/

In Dart docs you can read about it here: https://dart.dev/guides/language/analysis-options#enabling-linter-rules

In next release of Flutter a new default set of linting rules will be enabled by default for new packages, read about it here:
https://flutter.dev/docs/release/breaking-changes/flutter-lints-package

Setup for this package?

This package already has a lot of dependencies, so I suggest making your own lint setup that you can control and modify easily as described in my and Remi's articles. Then there is no need for any extra or new default package for it.

I made an example setup in my fork of the package here:
https://github.com/rydmike/advance_image_picker/commits/linting-suggestion

Basically it just adds two new files:

  • all_lint_rules.yaml - That you only edit and add new rules when Dart publishes new rules and add them - there is an automatically generated list of them that I just copy paste them from)
  • analysis_options.yaml - That contains the setup for this project, edit and adjust as needed. This is just my first recommendation and suggestion for your nice package.

I did not make any corrections that would be needed to comply with this linting setup. I just wanted to see what it would result in. As can be seen, with this configuration and rule set, the analyzer detects 110 "errors" and 1 hint. The errors are not necessarily real or bad errors, they just do not comply with the stringent linting rules configured in this example.

image

Next steps?

If you just want to try and see for yourself what happens when you apply these rules, well then just copy the above mentioned files to the root of your project. When you are done looking at it you can just remove the files again, the rules themselves do not make any changes. But you won't be able to build the project with this rule set enabled, since a lot is flagged as errors by it, unless you start making the required fixes until it is all fixed and it builds again.

Naturally I did not make any pull request for this, it is just an example. Adding this rule set and fixing all the lint analysis errors is a fairly big task.

If you are interested in it I could certainly attempt it and do the fixes, and submit a pull request.
However, I think it would probably be better if you take a look at it first yourself. Also when making a change like this, it is better if you don't have any active dev branches that you plan to merge later, as that would be quite problematic.

If you at some point don't have any active dev branches and want help with a migration like this, I could certainly help you with it. I have done it many times before, in much bigger projects than this this too. Yes, it is a bit tedious to migrate, but really nice to have the benefits of all this once it is done. Some of the analyzer issues Dart can also fix automatically with a tool, after you applied the new lint/analyzer rules, but not everything.

Anyway, let me know how you want to proceed and if and when you want any help with it.


Again, I love this package, just want to help make it even better! 😃

BR Mike

Example code not working for camera position

Environment
Mac M1, Flutter 3.0 IOS version target 15

In info.plist
NSCameraUsageDescription is included

When opening dialog for selecting picture from camera, the request permission screen is shown.
Clicking on button leads to an error message. No Dialog opens for confirming camera usage.

Error message
The following _CastError was thrown while handling a gesture:
Null check operator used on a null value

When the exception was thrown, this was the stack:
#0 _ImagePickerState._initCameraController (package:advance_image_picker/widgets/picker/image_picker.dart:281:41)

Line 281:
final cameraController = _controller!;

Landscape photography camera, shows there is a problem.

1, first of all, feel you provided very much so good open source products, like it very much. It's very useful. I are preparing to start a business, such as just need such a small tool, such as entrepreneurial success, I will come back to support you, thank you for your efforts.
2. Problem description: when come across your mobile phone, camera shows that there is a problem
3, advice: if can have skin care function, the effect is better, filter suggested a few more

I/ExifInterface_JNI(10726): Raw image not detected

I got this issue in the pick image screen. Everytime I try to choose an image the debug console returns the issue as the title says hence I cannot display images.

Edit: The issue exists when I used the newest version. The previous one does not seem to have this issue

How can I change the names of title ?

How can I change the names of title ?

final configs = ImagePickerConfigs();
   configs.textAlbumTitle = "";

Where textAlbumTitle is not a setter method.

AppBar color of Image Cropper does not follow theme and is not adjustable

Thanks for this wonderful camera/image picker, best one I have tried. Sure it has a lot of dependencies, but it also solves a bunch of bad UX with most other separate camera and image pickers. Love it! 👍🏻

I noticed a small design issue. The AppBar in the advanced_image_picker follows the active AppBar theme nicely, so that is fine. Eg:

However the image cropper is always using the cropper package's default blue color, which does not look so good if you are not using a blue theme.

I did not find any interface for adjusting the AppBar background of the image cropper in the picker.

Solution Proposal

I think adding a nullable property to ImagePickerConfigs, eg

Color? appBarBackgroundColor;

Would be a nice addition, users can then set it if they want a defined color or leave as null for current AppBar theme based color.

Then you can wherever you now build AppBar's, set their background color to:

backgroundColor: _configs.appBarBackgroundColor??
  Theme.of(context).appBarTheme.backgroundColor ??
  Theme.of(context).primaryColor:

Based on the code there are a few places where the above would be needed.

The image cropper for Android has its own way of setting the AppBar color in its androidUiSettings,

image

but we can use the same concept:

       androidUiSettings: AndroidUiSettings(
          :
          toolbarColor: _configs.appBarBackgroundColor??
            Theme.of(context).appBarTheme.backgroundColor ??
            Theme.of(context).primaryColor,
          toolbarWidgetColor: _configs.appBarTextColor,
          :
        ),

We then get default AppBar's that behave as now, following the Theme, but also the Image Cropper's AppBar does so now too, and we can also set the AppBar background to any specified not theme based color, similar to how Flutter widgets usually behave.

The above implementation would be a none breaking change.

This is just a proposal for a small improvement. If you want, I can also make the fix and submit a pull request.

Black Screen Issue When Spam Finish ( Done ) Button

If you keep pressing ( spamming finish button ) the finish button after selecting images, the app stays on the black screen.

This is because as you keep pressing finish it keeps running in the background and runs navigator.pop every time.

in image_picker.dart
onPressed: (_selectedImages.isNotEmpty)

find this line and replace it with this one.

onPressed: (_selectedImages.isNotEmpty && _isOutputCreating == true)

and I found a temporary solution.

Video

Any plans to support video picking and editing?

Thanks

Issue : using the image picker resets the phone orientation allowed

Hi ! We've found a small issue while using the picker.
Our app is locked in portrait mode, but after using this library and leaving it, the app allows all 4 modes without any restriction.
Is this a normal behavior (allowing picker phone modes will overwrite the app modes) and should we implement a local workaround ? Thanks

Trying to use the crop on a picture make the app instantly crash

Hi ! Whenever I try to use the crop function (button at the bottom left from picture edit), the app goes off instantly.

Tested on 2 different Androids. Kotlin version 1.4.32, Gradle build version 3.5.4 (Testing on higher versions)

Error :
(shown as FATAL by the runtime env)
E/AndroidRuntime(24167): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=69, result=0, data=null} to activity {fr.henoo.henooapp/fr.henoo.henooapp.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(24167): at android.app.ActivityThread.deliverResults(ActivityThread.java:4338)
E/AndroidRuntime(24167): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4381)
E/AndroidRuntime(24167): at android.app.ActivityThread.-wrap22(ActivityThread.java)
E/AndroidRuntime(24167): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1624)
E/AndroidRuntime(24167): at android.os.Handler.dispatchMessage(Handler.java:105)
E/AndroidRuntime(24167): at android.os.Looper.loop(Looper.java:156)
E/AndroidRuntime(24167): at android.app.ActivityThread.main(ActivityThread.java:6577)
E/AndroidRuntime(24167): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(24167): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
E/AndroidRuntime(24167): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
E/AndroidRuntime(24167): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(24167): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:155)
E/AndroidRuntime(24167): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:238)
E/AndroidRuntime(24167): at vn.hunghd.flutter.plugins.imagecropper.ImageCropperDelegate.onActivityResult(ImageCropperDelegate.java:106)
E/AndroidRuntime(24167): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:739)
E/AndroidRuntime(24167): at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:426)
E/AndroidRuntime(24167): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:677)
E/AndroidRuntime(24167): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:624)
E/AndroidRuntime(24167): at android.app.Activity.dispatchActivityResult(Activity.java:7188)
E/AndroidRuntime(24167): at android.app.ActivityThread.deliverResults(ActivityThread.java:4334)
E/AndroidRuntime(24167): ... 9 more

Bug : picture edited on iOS localy not seen edited in the picker !

Hello again !

We found a bug while using the app :
on iOS, when you edit a picture in the iOS image editor, the picture is seen croped etc. in the iOS gallery, but not in the image_picker gallery.

Tell me f you need more info for the troubleshooting.

Thanks again for the lib and your time !

Is possible to hide items?

In the same app I only want to use the camera and not the album in some cases or for example only use the back camera.
Is possible to do that??
I also have to mention very good work!! it is all very complete .

customize the library

hi, do you know if you can put or change the icons?
I have looked in the Configs configuration, but I do not get anything about changing widgets

Improvement : Color customization

Hi !
I'd like to suggest an improvement regarding the color customization. Some of them can be coded in the configuration, while others are obtained through the MaterialApp, and some are hard coded.

Putting each of them in the ImagePickerConfigs would be a great upgrade.

Thanks for the work as always, the lib is awesome !

Suddenly, the project cannot be started. I haven't made any changes. It can be used normally before. The following is the error reported. Thank you for your efforts. I like this plug-in very much!

F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:23: ����: �Ҳ�������
import android.media.EncoderProfiles;
^
����: �� EncoderProfiles
�: ����� android.media
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:935: ����: �Ҳ�������
EncoderProfiles getRecordingProfile() {
^
����: �� EncoderProfiles
�: �� Camera
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:10: ����: �Ҳ�������
import android.media.EncoderProfiles;
^
����: �� EncoderProfiles
�: ����� android.media
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:29: ����: �Ҳ�������
private EncoderProfiles recordingProfile;
^
����: �� EncoderProfiles
�: �� ResolutionFeature
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:63: ����: �Ҳ�������
public EncoderProfiles getRecordingProfile() {
^
����: �� EncoderProfiles
�: �� ResolutionFeature
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:187: ����: �Ҳ�������
public static EncoderProfiles getBestAvailableCamcorderProfileForResolutionPreset(
^
����: �� EncoderProfiles
�: �� ResolutionFeature
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:8: ����: �Ҳ�������
import android.media.EncoderProfiles;
^
����: �� EncoderProfiles
�: ����� android.media
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:24: ����: �Ҳ�������
private final EncoderProfiles encoderProfiles;
^
����: �� EncoderProfiles
�: �� MediaRecorderBuilder
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:36: ����: �Ҳ�������
@nonnull EncoderProfiles encoderProfiles, @nonnull String outputFilePath) {
^
����: �� EncoderProfiles
�: �� MediaRecorderBuilder
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:51: ����: �Ҳ�������
@nonnull EncoderProfiles encoderProfiles,
^
����: �� EncoderProfiles
�: �� MediaRecorderBuilder
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:186: ����: �Ҳ�������
@TargetApi(Build.VERSION_CODES.S)
^
����: ���� S
�: �� VERSION_CODES
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\Camera.java:208: ����: ��MediaRecorderBuilder�����ò���ȷ
mediaRecorderBuilder = new MediaRecorderBuilder(getRecordingProfileLegacy(), outputFilePath);
^
MediaRecorderBuilder �еĹ����� MediaRecorderBuilder(CamcorderProfile,String) �� MediaRecorderBuilder �еĹ����� MediaRecorderBuilder(EncoderProfiles,String) ��ƥ��
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:118: ����: �Ҳ�������
EncoderProfiles profile =
^
����: �� EncoderProfiles
�: �� ResolutionFeature
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:120: ����: �����EncoderProfiles������
List<EncoderProfiles.VideoProfile> videoProfiles = profile.getVideoProfiles();
^
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:121: ����: �����EncoderProfiles������
EncoderProfiles.VideoProfile defaultVideoProfile = videoProfiles.get(0);
^
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:200: ����: �Ҳ�������
return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_HIGH);
^
����: ���� getAll(String,int)
�: �� CamcorderProfile
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:204: ����: �Ҳ�������
return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_2160P);
^
����: ���� getAll(String,int)
�: �� CamcorderProfile
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:208: ����: �Ҳ�������
return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_1080P);
^
����: ���� getAll(String,int)
�: �� CamcorderProfile
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:212: ����: �Ҳ�������
return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_720P);
^
����: ���� getAll(String,int)
�: �� CamcorderProfile
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:216: ����: �Ҳ�������
return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_480P);
^
����: ���� getAll(String,int)
�: �� CamcorderProfile
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:220: ����: �Ҳ�������
return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_QVGA);
^
����: ���� getAll(String,int)
�: �� CamcorderProfile
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:224: ����: �Ҳ�������
return CamcorderProfile.getAll(cameraIdString, CamcorderProfile.QUALITY_LOW);
^
����: ���� getAll(String,int)
�: �� CamcorderProfile
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:241: ����: �����EncoderProfiles������
List<EncoderProfiles.VideoProfile> videoProfiles = recordingProfile.getVideoProfiles();
^
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\features\resolution\ResolutionFeature.java:243: ����: �����EncoderProfiles������
EncoderProfiles.VideoProfile defaultVideoProfile = videoProfiles.get(0);
^
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:32: ����: ��MediaRecorderBuilder�����ò���ȷ
this(camcorderProfile, outputFilePath, new MediaRecorderFactory());
^
MediaRecorderBuilder �еĹ����� MediaRecorderBuilder(CamcorderProfile,String,MediaRecorderFactory) �� MediaRecorderBuilder �еĹ����� MediaRecorderBuilder(EncoderProfiles,String,MediaRecorderFactory) ��ƥ��
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:79: ����: �����EncoderProfiles������
EncoderProfiles.VideoProfile videoProfile = encoderProfiles.getVideoProfiles().get(0);
^
F:\workspase\flutter_windows_2.5.0-stable\flutter.pub-cache\hosted\pub.flutter-io.cn\camera-0.9.4+4\android\src\main\java\io\flutter\plugins\camera\media\MediaRecorderBuilder.java:80: ����: �����EncoderProfiles������
EncoderProfiles.AudioProfile audioProfile = encoderProfiles.getAudioProfiles().get(0);
^
27 ������

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':camera:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 10m 16s
Exception: Gradle task assembleDebug failed with exit code 1

Linters setup fix and lint rules review for Flutter 2.5

Linters and Flutter 2.5

This is a review of linters to prepare for Flutter 2.5. I made a pull request, here (#23) that contains atomic updates, for your review to the linter setup and linter issues discussed below. This should help you with getting the linter working fully and make the code Flutter 2.5 ready as well.

Atomic commits included in the the pull request:

  • Photo manager version upgrade (minor) (rydmike@8d20e47)
  • Remove two lint rules that were put on manually that ARE already on (rydmike@8d20e47), a typo correction (rydmike@c200ac7) together with Dart SDK 2.14 fixes the issues with the linter not being triggered correctly so those extra true rules are no longer needed, they are ON already. The idea with this linter setup is to only have to turn OFF rules in analysis_options.yaml never on, all available rules are put ON by default in all_lint_rules.yaml.
  • Added two new rules to all_lint_rules.yaml released by Dart team. (rydmike@e5df435)
  • Set SDK to 2.14.0 (rydmike@2308cfd)

The above fixes led to that there were a massive 598 linter hints triggered. They should have been triggered already with past lint setup, but due to the issue mentioned above they were not.

image

  • To reduce the lint warnings dart fix --apply was run as well as removing the in Flutter 2.5.0 deprecated AppBar API usage that was still used temporarily via (17cd5c9), but flagged as should be removed in later version, this also removes the deprecated AppBar backwardsCompatibility API usage.

These changes brought the lint errors to "only" 177 remaining.

After this I did a large amount of manual lint fixes as well, they are listed as atomic commits with comments in the pull request. Those fixes were very basic that the IDE could do pretty automatically but dart fix --apply could not.

What is left?

This still leaves 3 warning and 81 lint hints un-resolved. I left them un-fixed on purpose, some are just doc comments for you to simply add (it will improve your doc API percentage in pub.dev ) but others are good to review manually, most of them are straight forward. For the 3 cases of "warning: Don't reassign references to parameters of functions or methods." you may want to add and ignore of the lint for the line where you mutate the parameter value, if that is what you want to do. just put a:

// ignore: parameter_assignments

before the line where you need to do it and the warning goes away and at the same time the ignore is a good way to document that it is intentional. Alternatively rethink the re-assignment of the parameter, make the parameter final and create a local copy of it that you change if so needed.

The rest of the still open fixes are quite simple, but I can certainly advice if you need help.

I did a test build and tested the picker in an app, with all above changes applies. As far as I could see everything still worked as before. 😃

BTW yes the avoid lines longer than 80 chars is very annoying. However, at least not long ago, a package pub.dev score was penalized 10 points if it was not used, since the dartfmt that is used by pub.dev uses 80 chars as max allowed line as the format it check against when giving points for using dartfmt. I have not checked if they have abandoned that part of the dartfmt check yet. I don't think so, but there was some debate about using it raised in issues. Could be good to test if it is still used.

I think that is the format issue I see on pub.dev, might not be related to 80 char length anymore:
image

Definitely worth testing just turning it OFF and see if it affects the score ore not, there is already in analysis_options.yaml a placeholder, just uncomment it.

image

Remaining lint warnings and hints to be corrected:

image

Move and Resize

Hi Folks, please how to perform move and resize after photo selection?
Something like WhatsApp profile image?

NEW FEATURE: Support taking photos in landscape mode

Currently advance_image_picker does not support taking pictures in landscape mode that would be automatically rotated as such after taking the pic. The UI can also not respond correctly to landscape mode.


This issue is summitted so it can be marked in this issue when it is being worked on. I might work on it myself later.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.