当前位置:网站首页>[error record] the parameter 'can't have a value of' null 'because of its type, but the im
[error record] the parameter 'can't have a value of' null 'because of its type, but the im
2022-07-03 02:52:00 【Programmer community】
One 、 Error message
Opened one written last year Flutter project , Find a direct error ;
The parameter 'icon' can't have a value of 'null' because of its type, but the implicit default value is 'null'. (Documentation) Try adding either an explicit non-'null' default value or the 'required' modifier.
Two 、 Solution
This is because Flutter SDK Version update , The examination of grammar has become more strict , During compilation, null judgment is added to the class in the construction method ;
stay Dart When a member variable of a class is defined , Add... After type ? Symbol , Declare it as nullable type , And Kotlin similar , After modification , Compile no more errors ;
class CommonModel {
final String? icon; final String? title; final String? url; final String? statusBarColor; final bool? hideAppBar; CommonModel({
this.icon, this.title, this.url, this.statusBarColor, this.hideAppBar});}
边栏推荐
- 搭建私有云盘 cloudreve
- 从C到Capable-----利用指针作为函数参数求字符串是否为回文字符
- Hcip137-147 title + analysis
- TCP 三次握手和四次挥手机制,TCP为什么要三次握手和四次挥手,TCP 连接建立失败处理机制
- Change cell color in Excel using C - cell color changing in Excel using C
- Strategy application of Dameng database
- Didi programmers are despised by relatives: an annual salary of 800000 is not as good as two teachers
- Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
- How to change the panet layer in yolov5 to bifpn
- Global and Chinese ammonium dimolybdate market in-depth analysis and prospect risk prediction report 2022 Edition
猜你喜欢
Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!
基于can总线的A2L文件解析(2)
Sqlserver row to column pivot
你真的懂继电器吗?
Classes and objects - initialization and cleanup of objects - constructor call rules
[shutter] banner carousel component (shutter_wiper plug-in | swiper component)
[translation] the background project has joined the CNCF incubator
Practice of traffic recording and playback in vivo
Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
定了,就选它
随机推荐
Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
[fluent] futurebuilder asynchronous programming (futurebuilder construction method | asyncsnapshot asynchronous calculation)
Kubernetes family container housekeeper pod online Q & A?
Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记
Reset or clear NET MemoryStream - Reset or Clear . NET MemoryStream
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)
HTB-Devel
Change cell color in Excel using C - cell color changing in Excel using C
Sqlserver row to column pivot
Apple releases MacOS 11.6.4 update: mainly security fixes
xiaodi-笔记
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
Wechat - developed by wechat official account Net core access
Pytest (6) -fixture (Firmware)
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
2022-2028 global splicing display industry research and trend analysis report
[fluent] JSON model conversion (JSON serialization tool | JSON manual serialization | writing dart model classes according to JSON | online automatic conversion of dart classes according to JSON)
[fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
Practice of traffic recording and playback in vivo
SQL server queries the table structure of the specified table