color_pick 0.0.9

  • Readme
  • Changelog
  • Installing
  • 46

color_pick #

This Dart package offers developers a select color view library of Flutter widgets. When you need a color wheel or a ring color selector, it is your best choice. For example, you can control the color of the light bulb and you need to choose the color.

Getting Started #

Installation #

Add this to your pubspec.yaml (or create it):

dependencies: color_pick: ^0.0.8

Then run the flutter tooling: #

flutter packages get

example #

import 'package:color_pick/ring_color_pick.dart';
 import 'package:flutter/material.dart';
 
 import 'color_pick.dart';
 
 class CirclePage extends StatefulWidget {
   @override
   State<StatefulWidget> createState() {
     // TODO: implement createState
     return CirclePageState();
   }
 }
 
 class CirclePageState extends State<CirclePage> {
   Color currentColor = Color(0xff0000ff);
 
   @override
   Widget build(BuildContext context) {
     // TODO: implement build
     return Scaffold(
       appBar: AppBar(
         centerTitle: true,
         title: Text("色盘选择器"),
       ),
       body: Center(
           child: Column(
         children: <Widget>[
           ColorPickView(
             selectColor: Color(0xff00eaff),
             selectRadius: 30,
             padding: 100,
             selectRingColor: Colors.black,
             selectColorCallBack: (color) {
               setState(() {
                 currentColor = color;
               });
             },
           ),
           Container(
             color: currentColor,
             height: 50,
             width: 50,
             child: SizedBox(),
           )
         ],
       )),
     );
   }
 }

Result #

image

Details in example/lib/circle_page.dart.

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

[0.0.1] - TODO: Add release date.

  • Initial release.

[0.0.2]

  • Update example

[0.0.3]

  • Update example

[0.0.4]

  • Update example

[0.0.5]

  • Update example

[0.0.6]

  • Update example

[0.0.9]

  • Optimization code

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  color_pick: ^0.0.9

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:color_pick/color_pick.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/color_pick.dart.

Run flutter format to format lib/color_pick.dart.

Format lib/ring_color_pick.dart.

Run flutter format to format lib/ring_color_pick.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and color_pick.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test