首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

【错误记录】Flutter 编译报错 ( The parameter ‘‘ can‘t have a value of ‘null‘ because of its type, but the im )

文章目录 一、报错信息 二、解决方案 一、报错信息 ---- 打开了一个去年写的 Flutter 项目 , 发现直接报错 ; The parameter 'icon' can't have a value...of 'null' because of its type, but the implicit default value is 'null'....二、解决方案 ---- 这是由于 Flutter SDK 版本升级 , 对语法的检查变得更加严格 , 在编译过程中对构造方法中的类添加了空判断 ; 在 Dart 类的成员变量定义时 , 在类型后面添加...符号 , 将其声明为可空类型 , 与 Kotlin 类似 , 修改后 , 编译不再报错 ; class CommonModel { final String?...icon; final String? title; final String? url; final String? statusBarColor; final bool?

40020
领券