pixel_color_image 1.3.0 copy "pixel_color_image: ^1.3.0" to clipboard
pixel_color_image: ^1.3.0 copied to clipboard

Pick the pixel color of a image. onHover, onTap, and the Preview widget.

example/main.dart

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

/// Called while Hoverring
void onHover(int x, int y, Color color) async {
  debugPrint('Hover x: $x, y: $y, color: $color');
}

/// Called when tap
void onTap(int x, int y, Color color) async {
  debugPrint('Tap x: $x, y: $y, color: $color');
}

/// Refarence for Preview
final ref = PixelColorRef();

/// main
void main() async {
  // Image
  final pixelColorImage = PixelColor.assetImage(
    path: 'images/xxx.png',
    onHover: onHover,
    onTap: onTap,
    ref: ref,
  );

  //
  // connect preview by "ref"
  //

  // Color Preview
  final pixelColorPreview = PixelColorPreview(
    ref: ref,
  );

  // App
  final app = MaterialApp(
    home: Scaffold(
      body: Column(
        children: [
          pixelColorPreview, // color preview
          pixelColorImage, // image
        ],
      ),
    ),
  );

  // Run App
  runApp(app);
}
8
likes
140
points
213
downloads

Publisher

verified publisherflut.rbdog.biz

Weekly Downloads

Pick the pixel color of a image. onHover, onTap, and the Preview widget.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, image

More

Packages that depend on pixel_color_image