【发布时间】:2021-10-07 05:30:08
【问题描述】:
我收到了这个错误。我在检查是否一个接一个时遇到此错误。我不确定我编写的代码是如何工作的。我想咨询你是否有效。谁能帮忙解决这个问题?
return Obx(() => _languageController.isLang == ''
? LanguageView()
: controller.getCurrentUser == null
? LoginView()
: _countryController.isLanguage == false
? CountryView()
: HomeView());
[Get] the improper use of a GetX has been detected.
You should only use GetX or Obx for the specific widget that will be updated.
If you are seeing this error, you probably did not insert any observable variables into
GetX/Obx
or insert them outside the scope that GetX considers suitable for an update
(example: GetX => HeavyWidget => variableObservable).
If you need to update a parent widget and a child widget, wrap each one in an Obx/GetX.
【问题讨论】:
标签: flutter flutter-getx