Search packages, repositories and app categories

floodfill_image cover
Package detailsv0.0.8

floodfill_image

Flutter widget that can use paint bucket functionality on the provided image.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
99
Likes
71
Pub points
140

Install package

flutter pub add floodfill_image

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The floodfill_image package provides a Flutter widget that enables paint bucket functionality on images, allowing users to fill contiguous areas with a selected color. It is ideal for interactive drawing and editing applications where users need to apply color fills within defined boundaries. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, ensuring broad compatibility. It integrates seamlessly into existing Flutter apps and offers a simple API for implementing flood fill operations on image widgets.

Use cases

  • Interactive image coloring apps
  • Digital painting tools
  • Image editing features
  • Educational drawing applications
  • User-driven color filling in graphics

Key features

  • Paint bucket fill functionality
  • Cross-platform support
  • Simple integration with Image widgets
  • Real-time fill updates
  • Supports various image sources

Suitable for

  • App developers building drawing tools
  • Educational software creators
  • Digital artists using Flutter
  • Apps requiring interactive image manipulation
  • Users needing quick color fills in images

Considerations

  • Performance may vary with large or complex images
  • Limited to pixel-based fills without advanced masking
  • Requires careful handling of touch input for precision
  • May need optimization for high-resolution images
  • Not suitable for vector-based image editing

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flood Fill Image

Version GitHub license Support

Overview

Flutter widget that can use paint bucket functionality on the provided image using Queue-Linear Flood Fill Algorithm by J. Dunlap. For more info check out my blog : Flood Fill in Flutter

Kindly like:+1: the package at pub dev or star:star: the repo in github if you find this library useful. :wink:

demo dog gif

Usage

FloodFillImage(
    imageProvider: AssetImage("assets/dog.jpg"),
    fillColor: Colors.amber,
    avoidColor: [Colors.transparent, Colors.black],
)

Parameters

Name Type Description
imageProvider ImageProvider The image to display via ImageProvider.
You can use AssetImage or NetworkImage.
fillColor Color Color use for filling the area.
isFillActive bool Set false if you want to disable on touch fill function.
Default value is true.
avoidColor List<Color> List of color that determines to which Color is/are needed to be avoided upon touch.
Note: Nearest color shade is applied.
tolerance int Set fill value tolerance that ranges from 0 to 100.
Default value is 8.
width int Width of the image. Parent widget width will be prioritize if it's provided and less than the image width.
height int Height of the image. Parent widget height will be prioritize if it's provided and less than the image height.
alignment AlignmentGeometry Alignment of the image.
loadingWidget Widget Widget to show while the image is being processed on initialization.
It uses CircularProgressIndicator by default.
onFloodFillStart Function(Offset position,Image image) Callback function that returns the touch position and an Image from dart:ui when flood fill starts.
Note: Touch coordinate is relative to the image dimension.
onFloodFillEnd Function(Image image) Callback function that returns an Image from dart:ui when flood fill ended.

Coffee

Buy Me A Coffee

License

MIT License, see the LICENSE.md file for details.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.