Check Mobile App
Read now
Start a Project

Expandable ListView in Flutter

Save

In this blog, We are going to learn how we can create an expandable listview in our flutter applications. Expandable ListView is a type of list view that is used to show multiple types of data based on category and subcategory. Expandable list view is used to expand or collapse the view in list items In a flutter app. We can easily make our own Expandable ListView using the ExpansionTile widget.

Expansions Tile Widget :

ExpansionTiles is used to produce two-level or multi-level lists in the app. ExpansionTiles widget is a detailed tile. It is like a ListTile widget which will expand by tapping the tile. We can display some detailed information on the list with ExpansionTiles.

Properties of the Expansions Tile :

Code For Expandable listview:

Here’s the complete code ->

main.dart file

datamodel.dart file ->

Outputs:

Conclusion:

In this blog, we have discussed how we can create an expandable listview on our App screen.

I hope it will help you out in understanding and getting a brief idea about it.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


2 comments

  • Safaa
    Thanks for this tutorial. However, it needs
    import ‘package:expanded_listview_demo/subCategory.dart’;

    which is not available in the tutorial. Could You please provide it.

    • Mohit Kumar (Moderator)
      Hi Safaa,This is a simple widget to show the details of a subcategory.
      import ‘package:flutter/material.dart’;
      class SubCategory extends StatelessWidget {
        String? name;
        SubCategory(this.name,{Key? key}) : super(key: key);
        @override
        Widget build(BuildContext context) {
          return Scaffold(
            appBar: AppBar(title: Text(name ??”),),
            body: Center(child: Text(
              “This is $name category screen”
            ),)
          );
        }
      }
       
  • css.php

    Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.

    Stathis Plakidas

    Stathis Plakidas

    Talk to Sales

    Global

    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home