I have just started my coding journey in Flutter(Dart). I am trying to design a UI and I have succeeded a little bit but not to my inner peace 😛
So, actually I am trying to design a card like structure in which when I click/tap on it, it should expand and show more data and a button.
Eventually I succeeded using a boolean variable named isExpanded to make changes in height when clicked. But when I tap the container again (Inkwell feature) it shows render flex problem.
So, I want some help from you people, I am just newbie in this, when I get good knowledge, I promise that I will help others too.
So, I need these designs
The design which I have somehow created lol 😛
Please, give some suggestions or even the code for the required layout, I will be glad for your help
Thank you
2
Answers
SizedBox is mainly used to give size between widges
Container widgets are mainly used as a parent widges where you can implement differnt propertys like color, border radius,… for the child widgets
What you have to do is:-
This can be achived in many ways like using animations and all…
But, I Prefer you to check is ExpansionPanel
Here, you can expand your card when on tap.
So, you can make a list of ExpansionPanel.
Try this code:-
You will get some idea
Thank you
Okay you can achieve your goal using ExpandablePanel widget. I have used this package. I have tried something like this. These buildCollapsed(), buildExpanded(), expandedColumn() are custom made function according to your need.
For better understanding, go through the package doc and let me know if you have any question.