photoeditor 1.1.0

  • Readme
  • Changelog
  • Installing
  • 76

PHOTO EDITOR #

A library that lets you apply filters and effects to photos from your device's gallery or camera (android and iOS).

How to use? #

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

dependencies:
  photoeditor: ^1.1.0
  get: ^1.3.2

And import it:

import 'package:photoeditor/photoeditor.dart';

Add GetKey to your MaterialApp and enjoy:

MaterialApp(
    navigatorKey: Get.key, // ADD THIS !!!!
  )

Uses PhotoEditor.getImage() to take your pic with filters and enjoy!!!

Example usage: #

void main() => runApp(MaterialApp(
      home: MyApp(),
      navigatorKey: Get.key,
    ));

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  var photo;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Photo Editor Example'),
      ),
      body: Center(
          child: (photo != null) ? Image.file(photo) : Text("No pic to show")),
      floatingActionButton: FloatingActionButton(
        onPressed: () async {
          var _photo = await PhotoEditor.getImage();
          setState(() {
            photo = _photo;
          });
        },
        child: Icon(Icons.add_a_photo),
      ),
    );
  }
}

##Documentation:

You can define max height, max width, quality, loading, title and fit from image.

  • double maxHeight || Max Height from photo,
  • double maxWidth || Max Width from photo,
  • bool fromCamera || define if the photo is from camera or gallery. The default is false,
  • int quality || Define the quality from photo. It's allow values from 1 to 100,
  • String title || Title showed on appBar
  • fit || fit from image. The default is BoxFit.contain,
  • loader || Your loader. The default is CircularProgressIndicator()

[1.0.0] #

  • initial release.

[1.0.1] #

  • Bugs fix

[1.0.2] #

  • Bugs fix

[1.1.0] #

  • Added compression, maxWidth and maxHeight values

Use this package as a library

1. Depend on it

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


dependencies:
  photoeditor: ^1.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:photoeditor/photoeditor.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
57
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/src/utils/utils.dart. (-0.50 points)

Analysis of lib/src/utils/utils.dart reported 1 hint:

line 19 col 7: Equality operator == invocation with references of unrelated types.

Format lib/photoeditor.dart.

Run flutter format to format lib/photoeditor.dart.

Format lib/src/app/photoeditor_init.dart.

Run flutter format to format lib/src/app/photoeditor_init.dart.

Format lib/src/widgets/photo_filter.dart.

Run flutter format to format lib/src/widgets/photo_filter.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and photoeditor.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
get ^1.3.2 1.10.5
image ^2.1.4 2.1.12
image_picker ^0.6.2+1 0.6.3+4
path ^1.6.4 1.6.4
path_provider ^1.4.4 1.6.1
Transitive dependencies
archive 2.0.13
args 1.5.2
charcode 1.1.3
collection 1.14.11 1.14.12
convert 2.1.1
crypto 2.1.4
flutter_plugin_android_lifecycle 1.0.6
meta 1.1.8
petitparser 3.0.1
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
xml 3.7.0
Dev dependencies
flutter_test