image_palette 0.0.1 copy "image_palette: ^0.0.1" to clipboard
image_palette: ^0.0.1 copied to clipboard

A Flutter package that allows you to generate a color palette from an image and use it in your Flutter app.

example/lib/main.dart

import 'dart:developer';

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

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Image palette & Color picker'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: ImagePalette(
          image: Image.asset('assets/images/991409.jpg'),
          onValueChanged: (Color color) {
            // color
            log('Color = $color');
          },
        ),
      ),
    );
  }
}
0
likes
160
points
18
downloads

Publisher

verified publisherredlinesoft.net

Weekly Downloads

A Flutter package that allows you to generate a color palette from an image and use it in your Flutter app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, palette_generator

More

Packages that depend on image_palette