내 프로젝트에서 공급자 라이브러리를 사용하고 싶습니다. 내 페이지에는 아이콘 그리드 목록이 있으며 사용자가 각 아이콘을 클릭하면 대화 상자가 표시됩니다.
내 대화 상자에는 텍스트 필드와 버튼 위젯이 있습니다. 사용자가 텍스트 필드를 채우고 버튼을 클릭하면 내 웹 서비스에서 일부 데이터를 가져오고 가져온 후 내 페이지의 다른 경고 대화 상자에 이러한 데이터를 다시 표시하고 싶습니다.
공급자가 이러한 상황을 어떻게 처리 할 수 있습니까?
showDialog(
context: context,
builder: (context) {
return myCustomNumberDialog(
headerTitle: :"Send Data",
buttonTitle: "Search Data",
onConfirmClicked: (input) { //a button action when user tap on it, It send request to api
// when data fetched from service show other dialog
},
);
});
}
시험
onConfirmClicked: (input) {
Provider.of<Model>(context, listen: false)
.callMethod().then((response) {
// Based on the the response coming from Provider, decide functionaliy.
Navigator.of(context).pop(); // pop current dialog
// show new dialog from here.
}),
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다