-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance comparison #34
Comments
This has been a concern for me as well. Would be interesting to to a proper performance test to see the actual difference. I have build a couple bigger projects myself with styled_widget and I haven't noticed a performance issue so far |
There is already an option to apply multiple styled using for example |
Awesome project. Is this library production ready? |
It depends on what you mean on production ready. Feature wise the package is good but it is still subject to change. |
@ReinBentdal that's ok. We can freeze the library on this version. What I'm asking is that if I could use it in production since this package helps write maintainable UI code. |
I see, i would say yes. I would recomend using the newest version 0.2.0, since it has some performance improvements. I would not recomend using the Text and icon extensions heavily since each method has to initiate a new Text widget. For example i would not write this: Text('some text')
.bold()
.fontSize(24)
.padding(all: 24)
.backgroundColor(Colors.red) And instead to something like this: final TextStyle textStyle = TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
);
Text('some text', style: textStyle)
.padding(all: 24)
.backgroundColor(Colors.red) And if you are applying more than one styles originating from the DecoratedBox widget: Text('some text') // do`nt
.backgroundColor(Colors.red)
.borderRadius(all: 24)
Text('some text') // do
.decorated(
color: Colors.red,
borderRadius: BorderRadius.circlular(24)
) What i am saying here can be summed up as: The package is not a replacement of the current way of building widgets with flutter, but a complimentary tool. When used right i think its a very useful. I (or someone else) should probably spend some time improving the documentation to address these things |
The simplicity and usage of this plugin are very effective and I have looked into both the packages, the division and styled_widget. But I am not sure which has more performance as there are method calling for each and every style. Calling methods for each single style may affect performance as compared to plain dart code. Kindly guide me in the right direction. Which way will be more performant/fast executing, the devision way, styled_widget way or plain dart code as provided by the framework itself for a large scale mobile app. If there would be an option to apply multiple styles in single method call then it would be great.
The text was updated successfully, but these errors were encountered: