![](/img/trans.png)
[英]Dart Flutter Future Void _CastError (type 'Null' is not a subtype of type 'List<String?>' in type cast) Error
[英]Flutter app simple login page , iam getting this error after selecting acc "'Future<dynamic>' is not a subtype of type '() => void'"
問題是(我認為)登錄后會發生什么,您的代碼繼續返回loggedInUi 函數的結果。 它有一個構建樹,其中包含 onPressed 中的 ActionChip,您在那里提供一個函數,但您直接調用它(它返回一個 Future,這就是為什么您的錯誤說明了它所說的)
相反,在 onPressed 供應中是這樣的:
() {
yourFunctionCall(Parameters);
}
這將提供一個僅調用您的函數的 void 函數
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.