I want to make expandable listview like below in attached image. How to implement this kind of functionality in Flutter?


Ravi Agrawal

Scalable use cases to implement

How can I achieve this? I tried customizing the ExpansionTile but couldn't get a similar effect on expanding and collapsing. Mainly the size of the prefix icon is larger so the expandable text is not close to the date. Also, the suffix icon for expand/collapse doesn't completely cover the background color.

I've also attached an image of what I've tried. I've used https://pub.dev/packages/expandable#-readme-tab- to similar effect with no luck.enter image description here

I'm really stuck at this place and need any help. Your help will be greatly appreciated. thanks.

Zhao chi

Just implemented, try the following:

ListView.builder(
        itemCount: 20,
        itemBuilder: (context, index) {
          return ExpandableNotifier(
            child: Card(
              elevation: 4,
              child: Expandable(
                collapsed: Container(
                  width: MediaQuery.of(context).size.width,
                  height: 105,
                  child: ExpandableButton(
                    child: Row(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: <Widget>[
                        Padding(
                          padding: EdgeInsets.all(10),
                          child: ClipOval(
                            child: Container(
                              height: 80,
                              width: 80,
                              color: Colors.yellow,
                            ),
                          ),
                        ),
                        Expanded(
                          child: Padding(
                            padding: EdgeInsets.symmetric(vertical: 20),
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: <Widget>[
                                Text(
                                  'Welkom bij Haaer',
                                  style: TextStyle(
                                    fontSize: 14.0,
                                    fontWeight: FontWeight.bold,
                                  ),
                                ),
                                Text(
                                  '2019/06/01 11:04',
                                  style: TextStyle(
                                    color: Colors.grey,
                                    fontSize: 12.0,
                                  ),
                                ),
                                Text(
                                  'blablablablablablablablablablablablablablablablablablablablablabla'
                                  'blablablablablablablablablablablablablablablablablablablablablabla'
                                  'blablablablablablablablablablablablablablablablablablablablablabla',
                                  softWrap: true,
                                  overflow: TextOverflow.ellipsis,
                                  maxLines: 2,
                                ),
                              ],
                            ),
                          ),
                        ),
                        Container(
                          color: Colors.yellow,
                          width: 30,
                          height: 105,
                          child: Icon(
                            Icons.keyboard_arrow_right,
                            color: Colors.white,
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
                expanded: Container(
                  height: 200,
                  child: Row(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      Padding(
                        padding: EdgeInsets.all(10),
                        child: ClipOval(
                          child: Container(
                            height: 80,
                            width: 80,
                            color: Colors.purple,
                          ),
                        ),
                      ),
                      Expanded(
                        child: Padding(
                          padding: EdgeInsets.symmetric(vertical: 20),
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: <Widget>[
                              Text(
                                'Welkom bij Haaer',
                                style: TextStyle(
                                  fontSize: 14.0,
                                  fontWeight: FontWeight.bold,
                                ),
                              ),
                              Text(
                                '2019/06/01 11:04',
                                style: TextStyle(
                                  color: Colors.grey,
                                  fontSize: 12.0,
                                ),
                              ),
                              Text(
                                'blablablablablablablablablablablablablablablablablablablablablabla'
                                'blablablablablablablablablablablablablablablablablablablablablabla'
                                'blablablablablablablablablablablablablablablablablablablablablabla',
                                softWrap: true,
                              ),
                              SizedBox(
                                height: 5,
                              ),
                              Container(
                                width: 80,
                                height: 20,
                                child: RaisedButton(
                                  padding: EdgeInsets.all(0),
                                  color: Colors.purple,
                                  child: Text('show'),
                                  onPressed: () {},
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                      ExpandableButton(
                        child: Container(
                          color: Colors.purple,
                          width: 30,
                          height: 200,
                          child: Icon(
                            Icons.keyboard_arrow_down,
                            color: Colors.white,
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ),
          );
        },
      ),

Related


I want to make border like attached image

username I want to make border like attached image in my app. Please help me as well. The original screen is the same as the code below. I am going to make the first screen image. tell me the changes in the xml. How can I make the border like a scary image? cu

I want to make border like attached image

username I want to make border like attached image in my app. Please help me as well. The original screen is the same as the code below. I am going to make the first screen image. tell me the changes in the xml. How can I make the border like a scary image? cu

I want to create listeview like below image

Yasser Malek I want a listview like an image so I can get an image which is the whole item and has a button on it Saini The image you want to display in the list view, i.e. the items in the list view are nothing but layout. You can design the layout of images

How can i make a menu like below image in android

You can be young: How to create a shortcut pinned like this , so when the app launches the logo, the user taps long to create a shortcut to navigate to a certain activity, eg: 1: Record voice note 2: Type note 3: ... It is better to use java. Alexander Hoffman

How can i make a menu like below image in android

You can be young: How to create a shortcut pinned like this , so when the app launches the logo, the user taps long to create a shortcut to navigate to a certain activity, eg: 1: Record voice note 2: Type note 3: ... It is better to use java. Alexander Hoffman

Like the attached image, how to make a grid in Threejs?

Rameez Raja I want to create an interface like the attached image. But I can't get started. Any help would be greatly appreciated. http://i.stack.imgur.com/DsXbx.png cucumber For the basic grid ( GridHelper ) is your friend.

Like the attached image, how to make a grid in Threejs?

Rameez Raja I want to create an interface like the attached image. But I can't get started. Any help would be greatly appreciated. http://i.stack.imgur.com/DsXbx.png cucumber For the basic grid ( GridHelper ) is your friend.

Like the attached image, how to make a grid in Threejs?

Rameez Raja I want to create an interface like the attached image. But I can't get started. Any help would be greatly appreciated. http://i.stack.imgur.com/DsXbx.png cucumber For the basic grid ( GridHelper ) is your friend.

Like the attached image, how to make a grid in Threejs?

Rameez Raja I want to create an interface like the attached image. But I can't get started. Any help would be greatly appreciated. http://i.stack.imgur.com/DsXbx.png Huyagir For the basic grid ( GridHelper ) is your friend.

Like the attached image, how to make a grid in Threejs?

Rameez Raja I want to create an interface like the attached image. But I can't get started. Any help would be greatly appreciated. http://i.stack.imgur.com/DsXbx.png Huyagir For the basic grid ( GridHelper ) is your friend.

Like the attached image, how to make a grid in Threejs?

Rameez Raja I want to create an interface like the attached image. But I can't get started. Any help would be greatly appreciated. http://i.stack.imgur.com/DsXbx.png cucumber For the basic grid ( GridHelper ) is your friend.

Like the attached image, how to make a grid in Threejs?

Rameez Raja I want to create an interface like the attached image. But I can't get started. Any help would be greatly appreciated. http://i.stack.imgur.com/DsXbx.png cucumber For the basic grid ( GridHelper ) is your friend.

I want to show marker on google map like attached image

Rakesh Kushwaha I want to show my current location marker icon like the attached image. Mohammad Rostami Use it to add your custom markers to the map mGoogleMap.addMarker(new MarkerOptions() .position(LATLONG) .icon(BitmapDescriptorFactory.fromB

How to create Expandable ListView in Flutter

Melvin Abraham How can I make an Expandable ListView using Flutter as shown in the screenshot below? I want to make a scrollable listview that ExpansionTileswhen expanded shows a non-scrollable listview. I tried implementing ExpansionTilesa listview inside and

How to create Expandable ListView in Flutter

Melvin Abraham How can I make an Expandable ListView using Flutter as shown in the screenshot below? I want to make a scrollable listview that ExpansionTileswhen expanded shows a non-scrollable listview. I tried implementing ExpansionTilesa listview inside and

How can I place the image below the listview?

Robin Manoli With this simple design, how can I display the second image under the list view? Actually, the list is fetched from Firebase, where each item is an ExpansionTile, so there is no way to fix the height of the ListView. The column should be scrollabl

How can I place the image below the listview?

Robin Manoli With this simple design, how can I display the second image under the list view? Actually, the list is fetched from Firebase, where each item is an ExpansionTile, so there is no way to fix the height of the ListView. The column should be scrollabl

How can I create a color combination like an attached image?

Knicks 290192 I want to create background in Xcode like attached image. Any suggestions? swift boy The best way is to always use Image as background let navBackgroundImage:UIImage! = UIImage(named: "your_background_image_name_here") If you just want to set th

How to make space between expandable ListView groups

Abid Khan Can someone please tell me how to get blank space between groups of Expandable ListView. I have tried many solutions but whenever I heighten the divider it always increases the height of the child divider as well. I've tried it separately android:div

How to make space between expandable ListView groups

Abid Khan Can someone please tell me how to get blank space between groups of Expandable ListView. I have tried many solutions but whenever I heighten the divider it always increases the height of the child divider as well. I've tried it separately android:div