【发布时间】:2022-01-11 13:58:37
【问题描述】:
我在我的颤振应用程序上使用Getx 包。我想更新一个双精度值。但它告诉我一个错误。
这是我的 gextController
class CustomWebViewCTRL extends GetxController {
RxDouble progress = 0.0.obs;
onProgress(pro) {
progress = (pro / 100);
}
}
然后我尝试通过Obx(()=>) 和GetBuilder 在我的主屏幕上调用它。没有人为我工作。据说——
"参数类型'RxDouble'不能赋值给参数类型'double?'"
这是一个示例(我想使用的地方):
GetBuilder<CustomWebViewCTRL>(builder: (controller) {
return LinearProgressIndicator(
value: controller.progress,
color: Colors.black,
backgroundColor: Colors.amber,
valueColor: const AlwaysStoppedAnimation<Color>(Colors.green),
);
}),
我该如何解决这个问题?
【问题讨论】:
标签: flutter types arguments double flutter-getx