Dart Error:等式表达式不能是另一个等式表达式的操作数

问题描述 投票:0回答:1

在Dart我不能这样做?

if (limit != null | pageby != null) { .. }因为我得到这个错误

An equality expression can't be an operand of another equality expression

那我怎么在Dart做一个if (this or that) { .. }

dart
1个回答
3
投票

逻辑OR是||。所以你应该使用:

if (limit != null || pageby != null) { .. }
© www.soinside.com 2019 - 2024. All rights reserved.