Bacancy Technology
Bacancy Technology represents the connected world, offering innovative and customer-centric information technology experiences, enabling Enterprises, Associates and the Society to Rise™.
12+
Countries where we have happy customers
1050+
Agile enabled employees
06
World wide offices
12+
Years of Experience
05
Agile Coaches
14
Certified Scrum Masters
1000+
Clients projects
1458
Happy customers
Artificial Intelligence
Machine Learning
Salesforce
Microsoft
SAP
April 26, 2024
Here’s a basic example of how to get data from Firestore Database:
FutureBuilder<QuerySnapshot>( future: FirebaseFirestore.instance.collection('Users').get(), builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) { if (snapshot.hasError) { return const Text('Something went wrong'); } if (snapshot.connectionState == ConnectionState.waiting) { return const Text("Loading"); } return ListView.builder( itemCount: snapshot.data?.docs.length, itemBuilder: (context, index) { final data = snapshot.data?.docs[index]; return ListTile( title: Text(data?['name'] ?? ''), subtitle: Text(data?['email'] ?? ''), trailing: Text(data?['dob'] ?? ''), ); }, ); }, )
StreamBuilder( stream: FirebaseFirestore.instance.collection('Users').snapshots(), builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.hasError) { return const Text('Something went wrong'); } if (snapshot.connectionState == ConnectionState.waiting) { return const Text("Loading"); } return ListView.builder( itemCount: snapshot.data?.docs.length, itemBuilder: (context, index) { final data = snapshot.data?.docs[index]; return ListTile( title: Text(data?['name'] ?? ''), subtitle: Text(data?['email'] ?? ''), trailing: Text(data?['dob'] ?? ''), ); }, ); }, )