Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically set color? #19

Closed
wiradikusuma opened this issue Dec 19, 2019 · 1 comment
Closed

Programmatically set color? #19

wiradikusuma opened this issue Dec 19, 2019 · 1 comment

Comments

@wiradikusuma
Copy link

Inside AlertDialog I have TypeAheadFormField (from flutter_typeahead) and MaterialColorPicker:

MaterialColorPicker(
	onMainColorChange: (ColorSwatch color) {
		this._myColor = color;
	},
	selectedColor: _myColor,
)
...
onSuggestionSelected: (validColorInt) {
	this._textController.text = 'THE TEXT IS UPDATED';

	setState(() {
		this._myColor = Color(validColorInt); // BUT NOT THE PICKER
	});
}

I want to change the picker's selected color when the user makes a selection. What do I miss?

@Pyozer
Copy link
Owner

Pyozer commented Aug 8, 2021

Hello, sorry for the very late response.

I just tested through the code of the built-in example app, temporarily adding a MaterialColorPicket (without dialog), which ultimately does the same as your example and the color changes well during a setState.

I am closing this ticket, do not hesitate to re-open it if necessary.

@Pyozer Pyozer closed this as completed Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants