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()

Libraries

photoeditor