Reputation: 13
dears,
I'm traying to catch value of TextEditingController to send it like this :-
final firstName = TextEditingController();
var data2 = {
"shipping": {
"address_1": firstName, // problem here don't accept this value ??
}
};
as json
updateUser() async {
user = await wooCommerce.updateCustomer(id: 2, data: data2); //id (int) , data (Map<dynamic,dynamic>)
setState(() {});
}
"address_1": firstName, given error to me with message (X) the instance member can't be accessed in an initializer
so how to catch this value of text ?
Upvotes: 0
Views: 417
Reputation: 8393
You probably want to use firstnameController.text
:
final firstnameController = TextEditingController();
...
var data2 = {
"shipping": {
"address_1": firstnameController.text, // problem here don't accept this value ??
}
};
Upvotes: 0