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

flutter flutter logo photo filters

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

installation

first, add photo filters 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

photo filters
photo filters

sample presets

   
no filter no filteraddictiveblue addictiveblueaddictivered addictivered
amaro amaroashby ashbybrannan brannan
charmes charmesclarendon clarendoncrema crema
earlybird earlybird1977 1977gingham gingham
hefe hefehelena helenahudson hudson
juno junokelvin kelvinlark lark
ludwig ludwigmaven mavenmayfair mayfair
nashville nashvilleperpetua perpetuareyes reyes
sierra sierraskyline skylineslumber slumber
sutro sutrotoaster toastervalencia valencia
walden waldenwillow willowx-pro ii x-pro ii

download the full project for this post from the following button

this source is fully free for all time

download as zip


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.