likk_picker 1.1.5+1 copy "likk_picker: ^1.1.5+1" to clipboard
likk_picker: ^1.1.5+1 copied to clipboard

Camera and Gallery picker asset from Photo Manager. Custom view from Facebook Messenger. (Image Picker, Camera, Gallery Reader)

Likk Picker

Platform Pub Package likes Forks


A flutter package which is clone of facebook messenger gallery picker and camera, combined as single component. Gallery view and Camera view can also be use as Flutter widget. Under the hood likk picker used Photo Manager and Camera.


Table of contents #


Installing #

1. Add dependency #

Add this to your package's pubspec.yaml file:

dependencies:
  likk_picker: ^latest_version
copied to clipboard

2. Install it #

You can install packages from the command line:

with pub:

$ pub get
copied to clipboard

with Flutter:

$ flutter pub get
copied to clipboard

3. Import it #

Now in your Dart code, you can use:

import 'package:likk_picker/likk_picker.dart';
copied to clipboard

Platform Setup #

For more details (if needed) you can go through Photo Manager and Camera readme section as well.

Android #

Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

minSdkVersion 21
copied to clipboard

Required permissions: INTERNET, READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE, ACCESS_MEDIA_LOCATION. If you don't need the ACCESS_MEDIA_LOCATION permission, see Disable ACCESS_MEDIA_LOCATION permission.

glide #

Android native use glide to create image thumb bytes, version is 4.11.0.

If your other android library use the library, and version is not same, then you need edit your android project's build.gradle.

rootProject.allprojects {

    subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.github.bumptech.glide'
                        && details.requested.name.contains('glide')) {
                    details.useVersion '4.11.0'
                }
            }
        }
    }
}
copied to clipboard

And, if you want to use ProGuard, you can see the ProGuard of Glide.

Remove Media Location permission #

Android contains ACCESS_MEDIA_LOCATION permission by default.

This permission is introduced in Android Q. If your app doesn't need this permission, you need to add the following node to the Android manifest in your app.

<uses-permission
  android:name="android.permission.ACCESS_MEDIA_LOCATION"
  tools:node="remove"
  />
copied to clipboard

If you found some warning logs with Glide appearing, then the main project needs an implementation of AppGlideModule. See Generated API.

IOS #

Add following content to info.plist.

<key>NSPhotoLibraryUsageDescription</key>
<string>Replace with your permission description..</string>
<key>NSCameraUsageDescription</key>
<string>Replace with your permission description..</string>
<key>NSMicrophoneUsageDescription</key>
<string>Replace with your permission description..</string>
copied to clipboard

Gallery #

  1. Use GalleryViewWrapper to make gallery view collapsible otherwise ignore it.
class PickerDemo extends StatelessWidget {
 late final GalleryController controller;
 
 ...

 @override
 Widget build(BuildContext context) {
   return GalleryViewWrapper(
     controller: controller,
     child: Scaffold(
       body: ...
     ),
   );
 }
}
copied to clipboard
  1. GalleryController can be used for extra setting and picking media.
  • Using pick() function on controller to pick media.
class PickerDemo extends StatelessWidget {
  late final GalleryController controller;

  @override
  void initState() {
    super.initState();
    controller = GalleryController(
      gallerySetting: const GallerySetting(
        albumSubtitle: 'Collapsable',
        enableCamera: true,
        maximum: 10,
        requestType: RequestType.all,
      ),
      panelSetting: const PanelSetting(topMargin: 24.0),
    );
  }

  ...

  onPressed : () async {
    final entities = await controller.pick();
  }

  ...
}
copied to clipboard
  1. Using GalleryViewField similarly as flutter TextField to pick media.
  • onChanged – triggered every time user select/unselect media

  • onSubmitted – triggered when user done with selection

GalleryViewField(
  selectedEntities: [],
  onChanged: (entity, isRemoved) {
     ...
  },
  onSubmitted: (list) {
     ...
  }
  child: const Icon(Icons.camera),
),
copied to clipboard
  1. You can also use GalleryView as a Widget.

Camera #

  1. Using pick() function on CameraView to pick media.
  ...
  onPressed : () async {
    final entity = await CameraView.pick();
  }
  ...
copied to clipboard
  1. Using CameraViewField similarly as flutter TextField to pick media.
  • onCapture – triggered when photo/video capture completed
GalleryViewField(
  onCapture: (entity) {
     ...
  },
  child: const Icon(Icons.camera),
),
copied to clipboard
  1. You can also use CameraView as a Widget.

Bugs or Requests #

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.


Maintainers #

Donate #

60
likes
70
points
59
downloads

Publisher

verified publishertranhuongk.xyz

Weekly Downloads

2024.09.21 - 2025.04.05

Camera and Gallery picker asset from Photo Manager. Custom view from Facebook Messenger. (Image Picker, Camera, Gallery Reader)

Repository (GitHub)

Documentation

API reference

License

unknown (license)

Dependencies

camera, flutter, image_cropper, path, photo_manager, uuid

More

Packages that depend on likk_picker