Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

photo filters

a photo filters package is for ios and android for applying filter to an image. a set of preset filters are also available. you can create your own filters too.

installation

first, add photofilters and image as a dependency in your pubspec.yaml file.

ios

no configuration required – the plugin should work out of the box.

android

no configuration required – the plugin should work out of the box.

example

import 'package:flutter/material.dart';
import 'package:path/path.dart';
import 'package:photofilters/photofilters.dart';
import 'package:image/image.dart' as imagelib;
import 'package:image_picker/image_picker.dart';

void main() => runapp(new materialapp(home: myapp()));

class myapp extends statefulwidget {
  @override
  _myappstate createstate() => new _myappstate();
}

class _myappstate extends state<myapp> {
  imagelib.image _image;
  string filename;
  filter _filter;
  list<filter> filters = presetfiterslist;

  future getimage() async {
    var imagefile = await imagepicker.pickimage(source: imagesource.gallery);
    filename = basename(imagefile.path);
    var image = imagelib.decodeimage(imagefile.readasbytessync());
    image = imagelib.copyresize(image, 600);
    setstate(() {
      _image = image;
    });
  }

  @override
  widget build(buildcontext context) {
    return new scaffold(
      appbar: new appbar(
        title: new text('photo filter example'),
      ),
      body: new container(
        alignment: alignment(0.0, 0.0),
        child: _image == null
            ? new text('no image selected.')
            : new photofilterselector(
                image: _image,
                filters: presetfiterslist,
                filename: filename,
                loader: center(child: circularprogressindicator()),
              ),
      ),
      floatingactionbutton: new floatingactionbutton(
        onpressed: getimage,
        tooltip: 'pick image',
        child: new icon(icons.add_a_photo),
      ),
    );
  }
}

ui screen shots

sample images of filters

no filter no filter addictiveblue photo filters addictiveblue addictivered addictivered
amaro amaro ashby ashby brannan brannan
charmes charmes clarendon clarendon crema crema
earlybird earlybird 1977 1977 gingham gingham
hefe hefe helena helena hudson hudson
juno juno kelvin kelvin lark lark
ludwig ludwig maven maven mayfair mayfair
nashville nashville perpetua perpetua reyes reyes
sierra sierra skyline skyline slumber slumber
sutro sutro toaster toaster valencia valencia
walden walden willow willow x-pro ii x-pro ii

Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.