You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not possible because when I assign ConstColor to the static variable colors in Constants, colors is actually taking the properties of the Type class. Now, my goal is to continue keeping the constants as static properties so as not to load this data at the time of executing the call to Constants but rather to do so from the application load. What options do you recommend, or what other way is recommended to manage constants in an organized way?
Note: I ask the question here because I have been searching in the documentation, forums, etc. and I have not found an answer.
Thanks.
The text was updated successfully, but these errors were encountered:
I think you are asking for nested namespaces.
Dart does not have that.
See #266, #267 and #2272 (just from a quick search for "namespace").
The only way to have an extra namespace inside a class, is to have an object, as @mateusfccp suggests.
That does prevent the names from being accessible as constants.
I think I'll wait for the macros or namespaces to come out for now, since the solution @mateusfccp propose seems more verbose and doesn't meet the objective I'm trying to obtain from the Sealed classes.
In order to organize global constants in a dart project, I am looking to implement the following style, short example:
This is not possible because when I assign ConstColor to the static variable colors in Constants, colors is actually taking the properties of the Type class. Now, my goal is to continue keeping the constants as static properties so as not to load this data at the time of executing the call to Constants but rather to do so from the application load. What options do you recommend, or what other way is recommended to manage constants in an organized way?
Note: I ask the question here because I have been searching in the documentation, forums, etc. and I have not found an answer.
Thanks.
The text was updated successfully, but these errors were encountered: