Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageEditor

Image Editor Plugin with simple, easy support for image editing using Paints, Text, Filters, Emoji and Sticker like stories.

To start with this, we need to simply add the dependencies in the gradle file of our app module like this

Installation

First, add image_editor_pro: as a dependency in your pubspec.yaml file.

Import

import 'package:image_editor_pro/image_editor_pro.dart';

iOS

Add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

  • NSPhotoLibraryUsageDescription - describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.
  • NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor.
  • NSMicrophoneUsageDescription - describe why your app needs access to the microphone, if you intend to record videos. This is called Privacy - Microphone Usage Description in the visual editor.

Or in text format add the key:

<key>NSPhotoLibraryUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSCameraUsageDescription</key>
<string>Used to demonstrate image picker plugin</string>
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture audio for image picker plugin</string>

Android

No configuration required - the plugin should work out of the box.

Example - Language translation

// before using image editor
ImageEditor.i18n({
'Remove': '제거',
'Save': '저장',
'Slider Filter Color': '슬라이더 필터 색상',
});

Example - Full Editor

final editedImage = await Navigator.push(
    context,
    MaterialPageRoute(
        builder: (context) => ImageEditor(
            image: data, // <-- Uint8List of image
            appBarColor: Colors.blue,
            bottomBarColor: Colors.blue,
        ),
    ),
);

Example - Image Crop Only

final editedImage = await Navigator.push(
    context,
    MaterialPageRoute(
        builder: (context) => ImageCropper(
            image: data, // <-- Uint8List of image
        ),
    ),
);

Example - Image Convert

import 'package:image_editor_pro/utils.dart';

// to jpeg
final convertedImage = await ImageUtils.convert(
    image: data, // <-- Uint8List/path of image
    format: 'jpg',
    quality: 80,
);

// to heic
final convertedImage = await ImageUtils.convert(
    image: data, // <-- Uint8List/path of image
    format: 'heic',
    quality: 80,
);

// to png
final convertedImage = await ImageUtils.convert(
    image: data, // <-- Uint8List/path of image
    format: 'png',
);

// to webp
final convertedImage = await ImageUtils.convert(
    image: data, // <-- Uint8List/path of image
    format: 'webp',
    quality: 80,
);

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages