getx 特性研究
https://pub.flutter-io.cn/packages/get
很多第三方包还没有 null-safety
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "getx_quick_start",
"request": "launch",
"type": "dart",
"program": "lib/main.dart",
"args": ["--no-sound-null-safety"]
}
]
}
https://dart.dev/tools/diagnostic-messages#unnecessary_non_null_assertion
原来
...
val == null
? Container()
: ListTile(
title: Text("传值 id = " + val["id"].toString()),
),
现在
_buildBackListTileRow(Map? val) {
return val == null
? Container()
: ListTile(
title: Text("传值 id = " + val["id"].toString()),
);
}