網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
flutter The argument type ‘String?‘ can‘t be assigned to the parameter type ‘String‘.
作者:_花開(kāi)富貴 更新時(shí)間: 2022-03-14 編程語(yǔ)言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.
原文鏈接:https://blog.csdn.net/sinat_42338962/article/details/122330655
相關(guān)推薦
- 2023-08-13 微信小程序底部導(dǎo)航欄最多只能顯示五個(gè),解決辦法
- 2022-08-18 Android新建水平節(jié)點(diǎn)進(jìn)度條示例_Android
- 2022-07-13 Android Canvas - StaticLayout 繪制多行文字
- 2022-03-15 pipe-platform-ops SpringCloudAlibaba日志鏈路追蹤和日志查詢系統(tǒng)
- 2022-04-11 ElasticSearch 8.x 默認(rèn)密碼
- 2022-08-17 windows?server2008?開(kāi)啟端口的實(shí)現(xiàn)方法_win服務(wù)器
- 2022-07-18 CSS浮動(dòng)定位與背景樣式
- 2023-10-09 markdown和富文本編輯器的區(qū)別
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支