design a complex card in the flutter - flutter

What is the best way to design the following card?
I do not know use card or design it with (container/row/column/....)
How can I achieve that?

I think the information is too rough to give the advice. Though Card Widget is easy to use but lots of properties are not able to change (like border, shadow of the card). I suggest
you can study the Card widget first and define a custom card widget if it is not fit your layout.
For custom widget, I think container/row/column can do most of the layout. Only the avatar may need to use BoxDecoration(also in Container) or ClipOval. Setting can use Stack widget (need to overlay).

Related

Is there a way to calculate a dynamically sized widget?

I'd like to add a custom showMore widget if the skills widget which has a dynamic size(width) exceeds the screen width. On clicking the showMore widget it should show all the skills in a wrap .else show less.
In flutter
Constraints go down and sizes go up
See this documentation.
Flutter uses a single pass algorithm to render your application. This is a technical choice to ensure performance but it comes with limitations.
One of them is that, when you are building the widget tree, you only have access to the constraints of the parent, and not any size of any widget (since they are not rendered yet).
So a short answer to your question is:
No, you cannot do what you are trying to do (displaying something if some widgets are not fitting on the screen) since you don't have access to any sizes in the build method.
An alternative solution would be to use Wrap to wrap your chips or use a ListView on the horizontal axis to make the list of chips horizontally scrollable.
Anyway, if you really want to do this, you can hardcode the sizes of your chip and access the device size with MediaQuery.of(context).size or by using the LayoutBuilder and using contraints.maxWidth as the parent's width. Then you can check whether or not numberOfChips * chipSize <= maxWidth. But I wouldn't recommend it as the design wouldn't be responsive:
All the chips will have the same size, so you'll end up with a big chip for "c" and maybe a long name like "python" won't fit in and you'll end up with overflow issues.
What if the user changes the font size of his device? You will also end up with overflow issues.

Is there any deafult widget like in image or if I need to do it how could that be implemented?

So I am not looking for filters but I am looking for scroll widget. I have tried generating listview items abd getting position of listview to give items ratio but I wasn't able to get any functionality while in certain index position. Any help would be helpfull. Naming of the widget or special widgets that can make me do this etc.
You can use ListView or ListView.builder to do that, but with circle-shaped widgets as the children.
You can check out this tutorial to do the horizontal list. And you can check out this StackOverflow question, to create a circle button. Or instead of a button, you want to use the CircleAvatar (to add an image in it), you can check out this official doc.

cupertino option tiles ,ios settings page style

I'm wondering which or how can design settings page like that
1-every option has a own value in right if it's has
2-hit under tile option
3- the divider not full width
is it by ListTile !! or there is another widget ?
There are multiple widgets uses in the above design you can not create it with single widget
Widgets You can use
Text,Containers,ListTile,CupertinoButtons and more
Try yourself and Best of luck

How can i make a Row display like this without making a new class?

Im trying to make an new app, and i want to display a row like this
i dont understand the concept behind it, like how can he divide the box into two type of colors, and how can the shape of the box looks like that. anyone that can teach me i will appriciated it.
This is not exactly a simple UI layout to create if you are just starting out with Flutter.
Simply put, you have to have a Row containing copies of a widget you create yourself as a stateless widget. The widget tree would look something like this.
Row
CustomWidget
CustomWidget
...
The CustomWidget is the complex part, this is a simplified example of how the Widget tree of this widget could look. Create a stateless widget and try to create it yourself.
Card
Column
Container
Row
Icon
Text
Container
Align
Text
Note you will have to set the color property of the Card and Container widgets, and add some padding certain places in the widget tree. Plus, the last container will need a width property as well.
If you need more help - show what you have attempted with code (edit your question)
Hope this helps!

Flutter padding, margin and alginment best practices

What is the best practice in flutter for padding,margin etc.
example:
I made a simple drawer in flutter. To make everything to position in places I want. I used padding extensively.
Now the issue is when I test it on different phone of different size. the positions are inconsistent across different devices.
From the Flutter Docs:
Design discussion Why use a Padding widget rather than a Container
with a Container.padding property? There isn't really any difference
between the two. If you supply a Container.padding argument, Container
simply builds a Padding widget for you.
Container doesn't implement its properties directly. Instead,
Container combines a number of simpler widgets together into a
convenient package. For example, the Container.padding property causes
the container to build a Padding widget and the Container.decoration
property causes the container to build a DecoratedBox widget. If you
find Container convenient, feel free to use it. If not, feel free to
build these simpler widgets in whatever combination meets your needs.
In fact, the majority of widgets in Flutter are simply combinations of
other simpler widgets. Composition, rather than inheritance, is the
primary mechanism for building up widgets.
So, no worries about padding widgets.
A good practice to get some spaces inside a Column() or Row() is using SizedBox(). Then you add an extra space setting up width or height.