padding and margin in flutter arabic

Sec it Developers
Sec it Developers
1 هزار بار بازدید - 3 سال پیش - هنشرح النهارده ال padding و
هنشرح النهارده ال padding و ال margin في فلاتر
When passing layout constraints to its child, padding shrinks the constraints by the given padding, causing the child to layout at a smaller size. Padding then sizes itself to its child's size, inflated by the padding, effectively creating empty space around the child.
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.

See also:

AnimatedPadding, which animates changes in padding over a given duration.
EdgeInsets, the class that is used to describe the padding dimensions.
The catalog of layout widgets.

link
Sample

#sec_it_developers
#flutter_course_in_arabic
our community
facebook page : https://bit.ly/3vtKu2h
facebook group : https://bit.ly/3vtKIGF
facebook profile : https://bit.ly/3x2PkF2
telegram channel : https://bit.ly/2TJBlVO
3 سال پیش در تاریخ 1400/04/11 منتشر شده است.
1,018 بـار بازدید شده
... بیشتر