Home > Enterprise >  How can i have multiple gridview inside singlechildscrollview?
How can i have multiple gridview inside singlechildscrollview?

Time:06-16

I want to achieve UI like Windows File Explorer windows file explorer

CodePudding user response:

Build one list as start and inside it a list of items and the item contains a title and a list of items

CodePudding user response:

The image you attached looks like it could be replicated with a ListView.builder returning an ExpansionTile containing a GridView.

SizedBox(
                height: 40,
                width: 300,
                child: ListView.builder(
                  itemBuilder: (context, index) {
                    return ExpansionTile(
                      title: const Text('title'),
                      children: [
                        SizedBox(
                          height: 100,
                          width: 200,
                          child: GridView.count(
                            crossAxisCount: 3,
                            children: List.generate(
                              3,
                              (index) {
                                return SizedBox(
                                  height: MediaQuery.of(context).size.height / 1.8,
                                  child: const Icon(Icons.folder),
                                );
                              },
                            ),
                          ),
                        ),
                      ],
                    );
                  },
                ),
              );

This builds several expansion tiles each containing 3 folder icons. You may consider adding a little bit more to your question as it is a little vague, but I hope this helps!

  • Related