数组中的检查值是否存在Flutter dart [英] Check value in array exists Flutter dart

查看:535
本文介绍了数组中的检查值是否存在Flutter dart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试检查条件

if (value in List) {
  exist
} else { 
  not exist
}

但无助于任何有想法的人

but nothing to help anyone having an idea then please share.

My List = _quantityController[];

itemId是整数

我想检查我的项目ID是否存在于我的列表数组中...谢谢!

i want to check my item id exists in my list array or not...Thanks!

推荐答案

list.contains(x);

包含方法

这篇关于数组中的检查值是否存在Flutter dart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆