When I change the "Ulke" value from the AsyncSelectInputForm, I call the notifyListeners() method so that the "Il" value is null.
When I do this, the value I entered in the "Adres Başlığı" TextInputForm returns to its initial value.
My widget:
@override
Widget build(BuildContext context) {
var cariAdres = Provider.of<CariAdresProvider>(context);
return Column(
children: [
TextInputForm(
initialValue: cariAdres.cariAdres?.adresBasligi,
label: "Adres Başlığı",
onChanged: (value) {
cariAdres.cariAdresTemp =
cariAdres.cariAdresTemp?.copyWith(
adresBasligi: value,
);
},
),
//todo ulke select
AsyncSelectInputForm(
pageTitle: "Ülke Seç",
label: "Ülke",
initialLabel: cariAdres.cariAdresTemp?.ulkeIdStr,
labelSetter: (item) {
return item.ulkeStr;
},
onChanged: (value, item, context) {
cariAdres.cariAdresTemp =
cariAdres.cariAdresTemp?.copyWith(
ulkeId: value,
ulkeIdStr: item.ulkeStr,
ilId: null,
ilIdStr: null,
);
cariAdres.notifyListeners();
},
fetchPage: //...,
),
//todo il select
AsyncSelectInputForm(
initialValue: cariAdres.cariAdresTemp?.ilId,
//... same code
)
//....