Skip to content

Instantly share code, notes, and snippets.

@csells
Last active December 8, 2021 17:17
Show Gist options
  • Save csells/d2207d4c9d428776600ade0d367fb6f9 to your computer and use it in GitHub Desktop.
Save csells/d2207d4c9d428776600ade0d367fb6f9 to your computer and use it in GitHub Desktop.
class FirestoreTableStory extends StatelessWidget {
FirestoreTableStory({Key? key}) : super(key: key);
// live Firestore query
final usersCollection = FirebaseFirestore.instance.collection('users');
@override
Widget build(BuildContext context) {
return FirestoreDataTable(
query: usersCollection,
columnLabels: const {
'firstName': Text('First name'),
'lastName': Text('Last name'),
'prefix': Text('Prefix'),
'userName': Text('User name'),
'email': Text('Email'),
'number': Text('Phone number'),
'streetName': Text('Street name'),
'city': Text('City'),
'zipCode': Text('Zip code'),
'country': Text('Country'),
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment