https://github.com/garlen-javier/floodfill_image
Flutter widget that can use paint bucket functionality on the provided image.
https://github.com/garlen-javier/floodfill_image
dart flood-fill flood-fill-algorithm flutter flutter-package
Last synced: 4 months ago
JSON representation
Flutter widget that can use paint bucket functionality on the provided image.
- Host: GitHub
- URL: https://github.com/garlen-javier/floodfill_image
- Owner: garlen-javier
- License: mit
- Created: 2021-01-30T18:58:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-09-05T05:36:00.000Z (almost 4 years ago)
- Last Synced: 2025-10-23T04:53:00.514Z (8 months ago)
- Topics: dart, flood-fill, flood-fill-algorithm, flutter, flutter-package
- Language: Dart
- Homepage:
- Size: 106 KB
- Stars: 28
- Watchers: 1
- Forks: 20
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Flood Fill Image
[](https://pub.dev/packages/floodfill_image)  [](https://ko-fi.com/garlen)
## 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](https://www.meekcode.com/blog/flood-fill-in-flutter)
Kindly like:+1: the package at [pub dev](https://pub.dev/packages/floodfill_image) or star:star: the repo in [github](https://github.com/garlen-javier/FloodFill_Image) if you find this library useful. :wink:
## Usage
```dart
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\ | 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
## License
MIT License, see the [LICENSE.md](https://github.com/garlen-javier/FloodFill_Image/blob/main/LICENSE) file for details.
