当前位置:网站首页>[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});}
边栏推荐
- Practice of traffic recording and playback in vivo
- Summary of interview project technology stack
- The process of connecting MySQL with docker
- tensorflow转pytorch笔记;tf.gather_nd(x,y)转pytorch
- Yiwen takes you to know ZigBee
- I2C 子系統(四):I2C debug
- 用docker 連接mysql的過程
- HTB-Devel
- [fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
- 【翻译】Flux安全。通过模糊处理获得更多信心
猜你喜欢
Check log4j problems using stain analysis
Classes and objects - initialization and cleanup of objects - constructor call rules
I2C 子系统(三):I2C Driver
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
I2C 子系统(二):I3C spec
I2C 子系统(四):I2C debug
sql server数据库添加 mdf数据库文件,遇到的报错
Deep Reinforcement Learning for Intelligent Transportation Systems: A Survey 论文阅读笔记
I2C 子系统(一):I2C spec
【Flutter】shared_ Preferences local storage (introduction | install the shared_preferences plug-in | use the shared_preferences process)
随机推荐
[translation] modern application load balancing with centralized control plane
Check log4j problems using stain analysis
错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
用docker 连接mysql的过程
The core idea of performance optimization, dry goods sharing
Sqlserver row to column pivot
Your family must be very poor if you fight like this!
SQL server queries the table structure of the specified table
How to change the panet layer in yolov5 to bifpn
"Analysis of 43 cases of MATLAB neural network": Chapter 43 efficient programming skills of neural network -- Discussion Based on the characteristics of the new version of MATLAB r2012b
JMeter performance test JDBC request (query database to obtain database data) use "suggestions collection"
What does it mean when lambda is not entered?
[translation] flux is safe. Gain more confidence through fuzzy processing
【翻译】后台项目加入了CNCF孵化器
[shutter] bottom navigation bar page frame (bottomnavigationbar bottom navigation bar | pageview sliding page | bottom navigation and sliding page associated operation)
Gbase 8C system table PG_ auth_ members
SQL Server Query spécifie la structure de la table
xiaodi-笔记
2022-2028 global splicing display industry research and trend analysis report
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)