日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

flutter The argument type ‘String?‘ can‘t be assigned to the parameter type ‘String‘.

作者:_花開富貴 更新時間: 2022-03-14 編程語言
The argument type 'String?' can't be assigned to the parameter type 'String'.

Change the return type of statusCode to String and provide a default value.

String get statusCode => statusCodes[this] ?? '';

When accessing a map, there is a chance that you will get a null return value if the key does not exist in the map. Simply providing a default value will allow this code to compile. That default value should never be used unless you add something to the enum without adding a value to the map as well.

stackoverflow

原文鏈接:https://blog.csdn.net/sinat_42338962/article/details/122330655

欄目分類
最近更新