skip to Main Content

Can anyone explain?
When should use which one?
Specialy, I need to use paddings for lingual text and some languages are rtl.

2

Answers


  1. EdgeInsets.symmetric is used to define symmetric padding around all 4 sides of a widget. It takes a single value for the vertical and horizontal padding.

    On the other hand, EdgeInsetsDirectional.symmetric is also used to define symmetric padding around all 4 sides but it takes separate values for the start/end and top/bottom directions. This is useful when dealing with text or widgets in right-to-left or somehow bottom-to-top layout.

    Example reference: https://www.youtube.com/watch?v=bq37eFbRMc0

    Login or Signup to reply.
  2. The EdgeInsetsDirectional and EdgeInsets are same for symmetric. source Official Flutter Documentation.

    It will only differ if you specify different values for either start/left or end/right.

    left insert it in left side of the text where start at beginning of the text (It would right in rtl language),

    right insert it in right side of the text where end at the end of the text (means It would left in rtl language)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search