我正在制作一个CheckUpdate部件,它是在网络上检查最新版本(Json),并试图进行比较。它解析JSON并将其转换为字符串。然后尝试与appBuildNumber进行比较。但是它给了我错误的Failed Assertion: Boolean expression must not be null。对这个问题有什么想法吗?P.S.版本检查服务器为https://raw.githubusercontent.com/TanzenT/LiteCalculator/master/version.json代码 class CalculatorPageHolder extends StatefulW
我的代码的问题是,布尔型表达式在屏幕构建完成后返回,并抛出失败的断言: boolean _isFavorite不能为空。 在这种情况下,我如何改进我的代码并使其按预期工作?catchError((error) => print('Feild to remove favorite item: $error'));
} 然后,我有一个检查产品是否已经在收藏夹中的函数,并为按钮返回一个布尔值favorite for this u
捕获的 ========异常引发构建StreamBuilder(脏、状态:_StreamBuilderBaseState<DocumentSnapshot、AsyncSnapshot>#cfcf8)的断言:失败断言:布尔表达式不能为null
class DataState extends AppState {
final CollectionReference dataCollection
我有一个AlertDialog,它会在转到新屏幕时立即出现。它有BACK and GO按钮。仅当用户按下GO时,当我关闭AlertDialog时,我需要留在此屏幕中。如果用户按下后退按钮或后退Android按钮,我需要转到上一个屏幕,而不是停留在当前屏幕。当我关闭AlertDialog时,我在OK的情况下使用Navigator.pop(context,false),在BACK的情况下使用Navigator.pop(context,true),如果返回到上一个屏幕,则对第二个Navigator.pop(co