simple_color_picker 1.0.1 copy "simple_color_picker: ^1.0.1" to clipboard
simple_color_picker: ^1.0.1 copied to clipboard

A simple HSV color picker without any glitz or glamour. Renders a HSV color selection sheet.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Color Picker Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  HSVColor color = HSVColor.fromColor(Colors.cyan);
  void onChanged(HSVColor value) => this.color = value;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Color Picker Example'),
      ),
      body: SafeArea(
          child: Center(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Card(
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.all(Radius.circular(0.0))),
              elevation: 2.0,
              child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Column(
                  mainAxisSize: MainAxisSize.min,
                  children: <Widget>[
                    FloatingActionButton(
                      onPressed: () {},
                      backgroundColor: this.color.toColor(),
                    ),
                    Divider(),
                    SimpleColorPicker(
                      color: this.color,
                      onChanged: (value) =>
                          super.setState(() => this.onChanged(value)),
                    ),
                  ],
                ),
              )),
        ),
      )),
    );
  }
}
8
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A simple HSV color picker without any glitz or glamour. Renders a HSV color selection sheet.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on simple_color_picker