Flutter Image Annotation
This library provides an easy-to-use solution for adding image annotation capabilities to Flutter applications. With this library, users can draw shapes, add text, highlight specific areas, and resize annotations within a defined picture zone.
Demo
Features
- Drawing shapes (Line, Rectangle, Oval) on images
- Adding custom text annotations on images
- Highlighting specific areas of an image
- Resizing annotations within the picture zone
- Clearing all or last annotation
Installation
To add this library to your Flutter project, include it in your pubspec.yaml file:
dependencies:
image_annotation: ^latest_version
Then run the following command in your terminal:
flutter pub get image_annotation
Usage
Import the package:
import 'package:image_annotation/image_annotation.dart';
Then, you can use the ImageAnnotation widget in your app. You can specify the type of annotation ('line', 'rectangle', 'oval', 'text') and the image path.
ImageAnnotation(
imagePath: "assets/images/example.png",
annotationType: "rectangle",
)
Quick Example
import 'package:flutter/material.dart';
import 'package:image_annotation/image_annotation.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: ImageAnnotation(
imagePath: 'images/my_image.png',
annotationType: 'line',
),
),
);
}
}
Contact
- Edu email : m.drazdou@innopolis.university
- Telegram : @droz_nik