color_pick 0.0.3 color_pick: ^0.0.3 copied to clipboard
a select color view package
color_pick #
a select color view package. When you need a color wheel or a ring color selector, it is your best choice.
Getting Started #
###Installation Add this to your pubspec.yaml (or create it):
dependencies: color_pick: ^0.0.1
###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(),
)
],
)),
);
}
}
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. ###Result
Details in example.