0% found this document useful (0 votes)
24 views1 page

Afasfsa

The document describes a StreamBuilder that builds a ListView from a QuerySnapshot. It checks each document's email against the provided email, and if they match, navigates to a different page depending on the document's 'cargo' field.

Uploaded by

Jeremias Torres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Afasfsa

The document describes a StreamBuilder that builds a ListView from a QuerySnapshot. It checks each document's email against the provided email, and if they match, navigates to a different page depending on the document's 'cargo' field.

Uploaded by

Jeremias Torres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

StreamBuilder<QuerySnapshot>(

stream: users,
builder: (BuildContext context,
AsyncSnapshot<QuerySnapshot>
snapshot) {
final data = snapshot.requireData;

return ListView.builder(
itemCount: data.size,
itemBuilder: (context, index) {
print("hola");
print(email);
if (data.docs[index]['email'] ==
email) {
print("llegue");
if (data.docs[index]['cargo'] ==
'Tutor legal') {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
cambios()));
textemailcontroller.clear();
textpasscontroller.clear();
}
if (data.docs[index]['cargo'] ==
'Preseptor/a') {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
InicioPrese()));
textemailcontroller.clear();
textpasscontroller.clear();
}
if (data.docs[index]['cargo'] ==
'Admin') {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const
crearperfiles()));
textemailcontroller.clear();
textpasscontroller.clear();
}
}

return Container();
});
});

You might also like