丛从绿草
2021-11-24 16:04
Warning: Operand of null-aware operation '??' has type 'String' which excludes null.
chapter3/operator_conditional.dart:17
String c = a ?? b;
我这里使用这String c = a?? b; 出现了警告,这是为什么啊?!
String 类型改成 dynamic 动态的
var b;
b; b ??= ;
int a=5; a ??= 10; print(a);
Warning: Operand of null-aware operation '??=' has type 'int' which excludes null.
a ??= 10;
一样报错
Flutter开发第一步-Dart编程语言入门
33620 学习 · 107 问题
相似问题