Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Card vs Container Widget

Tags:

flutter

dart

Can somebody please explain to me the difference between the Flutter card widget & the container widget. They both work the same, have the same properties also looks the same? Why should I use card widget for cards over the container widget

like image 298
Yogesh Aggarwal Avatar asked Feb 26 '20 10:02

Yogesh Aggarwal


People also ask

What is the difference between card and container in Flutter?

A Card is a sheet of Material used to represent some related information, for example, an album, a geographical location, a meal, contact details, etc. containers: If you are familiar with HTML, think of containers like divs. The Container Vs Card Flutter was solved using a number of scenarios, as we have seen.

Is card a widget in Flutter?

Card is a build-in widget in flutter which derives its design from Google's Material Design Library. The functionality of this widget on screen is, that it is a bland space or panel with round corners and a slight elevation on the lower side.

Is container a widget in Flutter?

Container class in flutter is a convenience widget that combines common painting, positioning, and sizing of widgets. A Container class can be used to store one or more widgets and position them on the screen according to our convenience. Basically, a container is like a box to store contents.


1 Answers

If you are familiar with HTML, think of containers like divs. They allow you to wrap other content. On the other hand, Card is an implementation of Material Design,

A material design card. A card has slightly rounded corners and a shadow.

A Card is a sheet of Material used to represent some related information, for example, an album, a geographical location, a meal, contact details, etc.

If you want rounded corners and a shadow then you should definitely use a Card.

like image 88
Dishonered Avatar answered Nov 05 '22 03:11

Dishonered