Skip to content
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

Division and const #21

Closed
ReinBentdal opened this issue Jun 24, 2019 · 1 comment
Closed

Division and const #21

ReinBentdal opened this issue Jun 24, 2019 · 1 comment
Labels
performance Performance related issues

Comments

@ReinBentdal
Copy link
Owner

ReinBentdal commented Jun 24, 2019

Since the StyleClass widget add new style using methods, there is no way of making it a const. That is because changes is made through the methods instead of being defined in the constructor. I dont know the exact performance difference, but it may be significant. Everything would have to be defined in the constructor like:

StyleClass(
  width: 100,
  height: 100,
  backgroundColor: ColorClass.hex('f5f5f5'),
  etc
)

or even

Division(
  child: Widget,
  onTap: () {},
  width: 100,
  elevation: Elevation(10),
  etc
)

Dart that could change help:

@ReinBentdal ReinBentdal added the performance Performance related issues label Jun 24, 2019
@MasiaVittorio
Copy link

MasiaVittorio commented Jun 28, 2019

Personally, I'd rather see the new constructor system on styles / gestures separately (not directly on the Division widget) because the separation between styles, gestures and children is what currently makes division cool imho!

Also, I think that the (double) dotted methods could still be cool to use here and there without overdoing so, so maybe they could stay along with the possibility of directly using constructors where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance related issues
Projects
None yet
Development

No branches or pull requests

2 participants