Arranging icons from cloud firestore in flutter

ajnabz

I have an AlertDialog with icons in that are from cloud firestore. I am struggling to change the layout of the icons so that it looks normal. (1) is what is currently being shown and (2) is what I am wanting to achieve.

(1)enter image description here

(2)enter image description here

This is my code:

Widget _buildPopupDialog(BuildContext context) {
    return Scaffold(
        body: StreamBuilder(
            stream: FirebaseFirestore.instance.collection('icons').snapshots(),
            builder: (context, snapshot) {
              return new AlertDialog(
                content: SingleChildScrollView(
                  child: new Container(
                      height: 500,
                      width: 300,
                      child: new ListView(
                        children: snapshot.data.documents
                            .map<Widget>((DocumentSnapshot document) {
                          return new MoodButton(
                            iconData: (IconData(document.data()['ref'],
                                fontFamily: 'MaterialIcons')),
                            onTap: () => print("Mood"),
                          );
                        }).toList(),
                      )),
                ),
              );
            }));

Any help would be greatly appreciated!

Kennedypz

You should use GridView instead of ListView. Set the crossAxisCount property to 3 and you should get the result you want. If you have any doubts, you can find GridView's doc here

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

FetchData From Cloud FireStore Firebase in flutter (dart)

From Java

Query a single document from Firestore in Flutter (cloud_firestore Plugin)

From Java

FieldValue arrayUnion and Cloud FireStore with Flutter

From Dev

Flutter - Update values of maps and arrays in Cloud firestore

From Dev

Cloud Firestore query to get doc ID, Flutter

From Dev

Arranging data from an array to an object

From Dev

Arranging icons inside a folder on Windows wherever I want

From Dev

Why is Windows 10 auto-arranging my icons so often?

From Java

Import collections from cloud storage to firestore

From Dev

Retrieving Complex Documents from Cloud Firestore

From Dev

Not receiving data from Cloud Firestore but there is the data

From Dev

Flutter cloud_firestore persistence is not working even if it is enabled

From Java

Unable to get data from Firestore using Flutter

From Dev

Flutter: Cannot use Firestore.instance even after importing the package(cloud_firestore)

From Dev

Flutter: Cannot use Firestore.instance even after importing the package(cloud_firestore)

From Java

How to get data from cloud firestore then filter it, map it then return it?

From Java

Not able to set text in edit text from cloud firestore?

From Java

How to import data from cloud firestore to the local emulator?

From Dev

Cloud Firestore - How to get relational data from two collections?

From Dev

How to get data from firestore to google cloud functions?

From Dev

Trying to get values from cloud Firestore using keyvalue (Angular)

From Dev

How to correctly display the date of a list from Cloud Firestore?

From Dev

How to stop a value from a Cloud Firestore database to be printed multiple times?

From Dev

How to copy all documents from one collection to other in Firestore -Flutter?

From Dev

Flutter app keeps disconnecting from firestore after brief time

From Dev

How to get all records from Yesterday's date in Firestore Flutter?

From Dev

how to fetch data from firestore array of a document with flutter?

From Dev

How can i get only my messages from firestore in Flutter

From Dev

Find n nearest locations in flutter: local database (Sqlite) in combination with Cloud Firestore vs Firebase Realtime Database

Related Related

  1. 1

    FetchData From Cloud FireStore Firebase in flutter (dart)

  2. 2

    Query a single document from Firestore in Flutter (cloud_firestore Plugin)

  3. 3

    FieldValue arrayUnion and Cloud FireStore with Flutter

  4. 4

    Flutter - Update values of maps and arrays in Cloud firestore

  5. 5

    Cloud Firestore query to get doc ID, Flutter

  6. 6

    Arranging data from an array to an object

  7. 7

    Arranging icons inside a folder on Windows wherever I want

  8. 8

    Why is Windows 10 auto-arranging my icons so often?

  9. 9

    Import collections from cloud storage to firestore

  10. 10

    Retrieving Complex Documents from Cloud Firestore

  11. 11

    Not receiving data from Cloud Firestore but there is the data

  12. 12

    Flutter cloud_firestore persistence is not working even if it is enabled

  13. 13

    Unable to get data from Firestore using Flutter

  14. 14

    Flutter: Cannot use Firestore.instance even after importing the package(cloud_firestore)

  15. 15

    Flutter: Cannot use Firestore.instance even after importing the package(cloud_firestore)

  16. 16

    How to get data from cloud firestore then filter it, map it then return it?

  17. 17

    Not able to set text in edit text from cloud firestore?

  18. 18

    How to import data from cloud firestore to the local emulator?

  19. 19

    Cloud Firestore - How to get relational data from two collections?

  20. 20

    How to get data from firestore to google cloud functions?

  21. 21

    Trying to get values from cloud Firestore using keyvalue (Angular)

  22. 22

    How to correctly display the date of a list from Cloud Firestore?

  23. 23

    How to stop a value from a Cloud Firestore database to be printed multiple times?

  24. 24

    How to copy all documents from one collection to other in Firestore -Flutter?

  25. 25

    Flutter app keeps disconnecting from firestore after brief time

  26. 26

    How to get all records from Yesterday's date in Firestore Flutter?

  27. 27

    how to fetch data from firestore array of a document with flutter?

  28. 28

    How can i get only my messages from firestore in Flutter

  29. 29

    Find n nearest locations in flutter: local database (Sqlite) in combination with Cloud Firestore vs Firebase Realtime Database

HotTag

Archive