image_hotspot 0.1.1 copy "image_hotspot: ^0.1.1" to clipboard
image_hotspot: ^0.1.1 copied to clipboard

Create interactive hotspots on images in Flutter apps. Add clickable regions with custom shapes, tooltips, and actions for engaging user experiences.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:image_hotspot/image_hotspot.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Image Hotspot Example')),
        body: Center(
          child: ImageHotspot(
            imagePath: 'assets/sample_image.jpg',
            imageWidth: 300,
            imageHeight: 200,
            imageFit: BoxFit.cover,
            showTooltip: true,
            hotspots: [
              Hotspot(
                x: 10,
                y: 20,
                onTap: () => print('Hotspot 1 tapped'),
                tooltip: 'This is hotspot 1',
                color: Colors.blue,
                size: 30,
              ),
              Hotspot(
                x: 200,
                y: 150,
                onTap: () => print('Hotspot 2 tapped'),
                // tooltip: 'This is hotspot 2',
                icon: Icon(Icons.star, color: Colors.yellow),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
4
likes
150
points
25
downloads

Publisher

unverified uploader

Weekly Downloads

Create interactive hotspots on images in Flutter apps. Add clickable regions with custom shapes, tooltips, and actions for engaging user experiences.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on image_hotspot