Skip to content

Are there any performance difference between modifiers? #473

Answered by leoafarias
Maksimka101 asked this question in Q&A
Discussion options

You must be logged in to vote

@Maksimka101 it is the same difference as adding.

Padding(padding...) vs Container(padding: ...)
or SizedBox vs Container(height:...)

The Container widget adds the Padding widget internally, so it just changes the order of the widgets in the tree. So in the case of $with.padding, or $box.mod.padding, they will behave more like a margin than a Container with padding.

Let me know if that makes sense.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Maksimka101
Comment options

@leoafarias
Comment options

Answer selected by tilucasoli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants