Comments (10)
Currently approach above doesn't work because of a bug in library. I'm working on this issue.
from flutter_circle_color_picker.
You can change the color by changing initial color.
class SomeViewState extends State<SomeView> {
Color selectedColor = Colors.red;
Widget build(BuildContext context) {
return Column(
children: [
CircleColorPicker(
initialColor: selectedColor,
onChanged: (color) => this.setState({ selectedColor: color }),
size: const Size(240, 240),
strokeWidth: 4,
thumbSize: 36,
),
TextField(
onChanged: (text) => this.setState({selectedColor: Color(text)})
),
]
);
}
}
from flutter_circle_color_picker.
Your code gives the error "error: The argument type 'Map<Color, Color>' can't be assigned to the parameter type 'void Function()'. (argument_type_not_assignable at ...)" for the setState() lines.
I tried this:
class ColorPickerState extends State<ColorPicker> {
Color _currentColor = Colors.red;
@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
CircleColorPicker(
initialColor: _currentColor,
strokeWidth: 6,
onChanged: (Color color) {
setState(() {
_currentColor = color;
});
},
),
TextField(
onChanged: (text) {
setState(() {
_currentColor = Colors.yellow; // the red value should turn into yellow when entering something into the TextField
});
},
)
],
);
}
}
But it does nothing. When I have a look into your code, the controller values are only set in initState(), am I right? In that case, after creating the widget, the controller never changes its value.
from flutter_circle_color_picker.
Hi,
do have a solution for this? I tried do change your code by myself but I believe, things got even worse with my approach :D
I really would appreciate a solution here, as well. Because without it, I couldn't use your very nice component anyway. I do need to be able to set values from external widgets (so the component becomes both: A color picker and a color viewer :D)
from flutter_circle_color_picker.
Hi :)
Do you have any news here? It would be awesome to get this feature. Currently my feature branch is waiting for this, because I'd love to integrate you widget. Do you have any idea if or when you get it fixed? (for planning purposes ;))
from flutter_circle_color_picker.
Sorry, I was busy last month. I'll fix this until the end of May.
from flutter_circle_color_picker.
+1 on this. I love your work! I'm using it with Hubitat to play with a neopixel. I wanted to pull the current color from the LED on start up/resume of flutter, but I don't see any way to set the color wheel to a value.
from flutter_circle_color_picker.
Great library and looking forward for this new feature!
Will it be ready soon?
from flutter_circle_color_picker.
we need a controller for this widget, can we create one for this :\
from flutter_circle_color_picker.
@S-Man42 Sorry for being very late!
I merged PR #21 which add controller parameter to control picker color from outside.
Thanks.
from flutter_circle_color_picker.
Related Issues (13)
- The color selected does not match the color ring HOT 2
- How to return color value on onChangeEnd? HOT 3
- Cant pan inside scroll view HOT 1
- Make hex code editable HOT 1
- Flutter Web displaying single color for entire ring HOT 2
- Plans for null safety? HOT 1
- Initial Color not being used HOT 2
- Less an issue than a feature request
- Color of thumb circle not equals underlying color HOT 4
- Request: Option for custom text HOT 5
- Flutter Web issue. HOT 2
- pub.dev is still 0.1.1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_circle_color_picker.