当前位置:网站首页>[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});}
边栏推荐
- [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_ am
- Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution
- Reset or clear NET MemoryStream - Reset or Clear . NET MemoryStream
- Your family must be very poor if you fight like this!
- 用docker 連接mysql的過程
- What is the way out for children from poor families?
- MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
- 错误Invalid bound statement (not found): com.ruoyi.stock.mapper.StockDetailMapper.xxxx解决
- Check log4j problems using stain analysis
猜你喜欢
![[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)](/img/04/88ce45d370a2e6052c2fce558aa531.jpg)
[flutter] example of asynchronous programming code between future and futurebuilder (futurebuilder constructor setting | handling flutter Chinese garbled | complete code example)

Add some hard dishes to the interview: how to improve throughput and timeliness in delayed task scenarios!

I2C subsystem (II): I3C spec
![[translation] modern application load balancing with centralized control plane](/img/b0/22e9bf098d580b2af67255ddcdc0d5.jpg)
[translation] modern application load balancing with centralized control plane

Linear rectification function relu and its variants in deep learning activation function

xiaodi-笔记

Add MDF database file to SQL Server database, and the error is reported

Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes
![[hcia]no.15 communication between VLANs](/img/59/a467c5920cbccb72040f39f719d701.jpg)
[hcia]no.15 communication between VLANs

Baidu map - surrounding search
随机推荐
Joking about Domain Driven Design (III) -- Dilemma
Interview stereotyped version
当lambda没有输入时,是何含义?
Gbase 8C trigger (II)
MUX VLAN Foundation
Error when installing MySQL in Linux: starting mysql The server quit without updating PID file ([FAILED]al/mysql/data/l.pid
Deep learning: multi-layer perceptron and XOR problem (pytoch Implementation)
Cron表达式介绍
[fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
MATLAB小技巧(24)RBF,GRNN,PNN-神经网络
Gbase 8C system table PG_ am
Update and return document in mongodb - update and return document in mongodb
Matlab tips (24) RBF, GRNN, PNN neural network
Add automatic model generation function to hade
左值右指解释的比较好的
Tensorflow to pytorch notes; tf. gather_ Nd (x, y) to pytorch
Baidu map - surrounding search
Gbase 8C system table PG_ amproc
I2C subsystem (IV): I2C debug
Segmentation fault occurs during VFORK execution