-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
courses/flutter-firebase/topics-screen/ #717
Comments
This video ends with i'm going to create TopicItem but never showed how or at least the code for the file. |
🙈 should have just watched the next video... |
Independently of the TopicItem Widget or if you are rendering a Text Widget, you will probably face an issue when mapping the topics variable with the error: " The method 'map' isn't defined for the type 'Object' " It means, when setting the var topics, dart could not infer the type of its result. The instructor can correct me, please, that would be much appreciated. I solved that by force casting the result of the data as the same as the getTopics method as below. var topics = snapshot.data! as List; With that you can map topics to the Text or Custom Widget of your preference. topics.map((topic) => Text(topic.title)).toList() |
in case of "failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}", go to firestore rules and set "allow read, write: if true;" |
@tappella I had the same issue, then saw the quick fix (ctrl + ;): add the models file.
Once that file is imported, it will recognize that you defined the result of Topic in models.dart. |
Topics Grid
Use a GridView to display a Firestore collection query
https://fireship.io/courses/flutter-firebase/firestore-data-model/
The text was updated successfully, but these errors were encountered: