tengo la siguiente clase
class DrawerItem {
String title;
IconData icon;
int identificador;
DrawerItem(this.title, this.icon, this.identificador);
}
donde lo lleno de esta manera.
final drawerItems = [
new DrawerItem("Inicio", Icons.rss_feed, 0),
new DrawerItem("Somos", Icons.local_pizza, 1),
new DrawerItem("Información", Icons.local_cafe, 2),
new DrawerItem("Contactame", Icons.info, 3),
new DrawerItem("iniciar Secion", Icons.memory, 4),
];
mi pregunta es ..
como puedo saber si en ese list (drawerItems) existe el registro con identificador 4?
puedo eliminar de la siguiente forma ..
drawerItems.removeWhere((item) => item.identificador == 4);
quizás les de alguna idea.