-
Notifications
You must be signed in to change notification settings - Fork 21
upgrade to null safety #13
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
base: master
Are you sure you want to change the base?
Conversation
|
@mendieta any plans on merging and publishing the null safety version? |
|
Sorry, I'll merge during this week. Cheers |
|
Cool. Need this. |
|
@mendieta any updates here? Would be great to get the null safety release :D |
|
Sorry - another request - can we merge the changes for null safety - this is the last package i need for me! thank you!!! |
|
Looking forward to this 👍 |
|
@mendieta Guessing you're busy but any chance of merging and releasing? |
|
Merge please. |
|
lgtm. use of |
|
Looks like Pigment has been updated to null-safety: bregydoc/pigment@eb95e5e |
lib/tinycolor.dart
Outdated
| } | ||
| TinyColor(Color color) | ||
| : this.originalColor = color, | ||
| _color = color.copy(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was actually thinking just
TinyColor(Color color)
: this.originalColor = color,
_color = Color.fromARGB(alpha, red, green, blue);
or is that bad practice somehow? :) the extension seems overkill, just for the internals of a constructor. Or do you believe it is generally useful? Personally I haven't had the need yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would actually be (reference color):
TinyColor(Color color)
: this.originalColor = color,
_color = Color.fromARGB(color.alpha, color.red, color.green, color.blue);I don't think it is overkill, since the extension is private.
I am used to creating extensions for these cases to simplify the constructor and improve formatting, but it is just a matter of taste.
Both ways will produce the same end result, as of before, it was allowing the variable to not be initialized if somebody was to change the constructor and probably adding a tiny runtime penalty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I forgot the color ref.
sorry, I did not realize it was a private extension. thanks for explaining
|
Please merge, thanks 😃 |
|
Merge, Please |
Hi @mendieta, could you please merge :) |
|
Would love to see this merged as well! 🙏 In the meantime, I'm going to try migrating my codebase to null safety by depending on @lslv1243's latest commit in my dependencies:
tinycolor:
git:
url: git@github.com:lslv1243/tinycolor.git
ref: 87f654ce7b79daddfbe7cdf7b7d9bb27574a8b89I haven't actually migrated yet, but running |
|
Hey @lslv1243, can you make a PR to community-forked repo? Thanks! |
Fixes issues FooStudio#2, FooStudio#6, and FooStudio#10 on FooStudio/tinycolor
Update issue templates
…licy Create SECURITY.md
Update changelog template
Update underlying color with setting alpha and opacity, and re-structure as library.
Replace .gitignore
* Add .equals() * Fix value to be checked * Add @deprecated for .equals()
Xcode, JetBrains, VSCode
Add more .gitignore rules
Hey @lslv1243, please let us know if you are too busy to make the PR. We can work on it if that’s the case. |
make extension private access more explicit
I made the required changes for the package to be sound null safe.
Since it depended on Pigment which the last update was 2 years ago, to not cause any breaking change, I inlined the function that is being used. The function only parses a string as Color.