Skip to content

Conversation

@WieFel
Copy link
Member

@WieFel WieFel commented Jul 3, 2021

  • Example project using null-safety

@WieFel
Copy link
Member Author

WieFel commented Jul 3, 2021

screen1 screen2

@calvintam236 calvintam236 added the documentation Improvements or additions to documentation label Jul 3, 2021
@WieFel WieFel force-pushed the feature/example branch from 54dda79 to 8a8a98e Compare July 4, 2021 12:04
@calvintam236
Copy link
Member

@WieFel can you pull from master and update the import here (package:tinycolor2/tinycolor2.dart)?

@calvintam236 calvintam236 marked this pull request as ready for review July 4, 2021 12:33
Copy link
Member

@calvintam236 calvintam236 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. flutter format needed
  2. merge from master

@WieFel
Copy link
Member Author

WieFel commented Jul 4, 2021

Ok, apparently something went wrong on my rebase before.
I'll just rebase again and force push...

@WieFel WieFel force-pushed the feature/example branch from 94ddc70 to 5a64e09 Compare July 4, 2021 12:35
Copy link
Member

@calvintam236 calvintam236 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. remove pubspec.lock from example directory. it is only needed in the repo root for package
  2. flutter format for the whole example directory

@calvintam236
Copy link
Member

Ok, apparently something went wrong on my rebase before.
I'll just rebase again and force push...

btw this is feature branch. it will just squash into one.

@WieFel
Copy link
Member Author

WieFel commented Jul 4, 2021

1. remove `pubspec.lock` from `example` directory. it is only needed in the repo root for package

After removing it, it is regenerated when running the example app. So I think it has to be there... It could be added to .gitignore, but I don't see a reason why it should not be commited...

2. `flutter format` for the whole `example` directory

Done. No changes at all. Everything was formatted fine.

@WieFel
Copy link
Member Author

WieFel commented Jul 4, 2021

btw this is feature branch. it will just squash into one.

Yeah I know. But rebasing keeps the branch network cleaner in my opinion. Also if it is only for the moment...

@WieFel
Copy link
Member Author

WieFel commented Jul 4, 2021

What we still have to discuss is this: #2 (reply in thread)
Let's open a separate discussion topic about example/demo project!?

@calvintam236
Copy link
Member

1. remove `pubspec.lock` from `example` directory. it is only needed in the repo root for package

After removing it, it is regenerated when running the example app. So I think it has to be there... It could be added to .gitignore, but I don't see a reason why it should not be commited...

https://dart.dev/guides/libraries/private-files

@WieFel
Copy link
Member Author

WieFel commented Jul 4, 2021

https://dart.dev/guides/libraries/private-files

https://dart.dev/guides/libraries/private-files#pubspeclock
For the example project it is fine to have pubspec.lock. We should rather ignore/remove the one in the project root.

calvintam236
calvintam236 previously approved these changes Jul 4, 2021
@WieFel
Copy link
Member Author

WieFel commented Jul 11, 2021

@calvintam236 ok like this? Wanted to keep it as simple as possible.

screenshot

@calvintam236
Copy link
Member

@calvintam236 ok like this? Wanted to keep it as simple as possible.

screenshot

Shouldn't the rest using c. since you have var c? (BTW don't use var. Specific the type)

It would be great if you can add other constructors such as .fromRGB and .fromString

@calvintam236 calvintam236 marked this pull request as draft July 11, 2021 08:23
@WieFel
Copy link
Member Author

WieFel commented Jul 11, 2021

Shouldn't the rest using c. since you have var c? (BTW don't use var. Specific the type)

What do you mean? All the list items DO use c.
And ok, I can specify type...

It would be great if you can add other constructors such as .fromRGB and .fromString

Ok

@calvintam236
Copy link
Member

Shouldn't the rest using c. since you have var c? (BTW don't use var. Specific the type)

What do you mean? All the list items DO use c.
And ok, I can specify type...

It would be great if you can add other constructors such as .fromRGB and .fromString

Ok

I mean in the screenshot. You are using Colors.blue.xxx in all of the example.

@WieFel
Copy link
Member Author

WieFel commented Jul 11, 2021

Yeah, that is an example for the extension usage in a static way.
Of course it could also be c.color.lighten(20) for example, but that's almost the same as c.lighten(20).color. Don't know which way is better!?

@calvintam236
Copy link
Member

Yeah, that is an example for the extension usage in a static way.
Of course it could also be c.color.lighten(20) for example, but that's almost the same as c.lighten(20).color. Don't know which way is better!?

Personally, I use TinyColor() over extension because it will not create another instance of Tinycolor. I think the extension way is convenience but has performance penalty. It is basically a stripped-down version.

@WieFel
Copy link
Member Author

WieFel commented Jul 17, 2021

So, should I change Colors.blue.xxx to c.color.xxx?
In my opinion it should stay Colors.blue.xxx.

@calvintam236
Copy link
Member

So, should I change Colors.blue.xxx to c.color.xxx?
In my opinion it should stay Colors.blue.xxx.

you can add another example for original color Color c = Colors.blue; and use c. for all of the below. it is clear either works

@WieFel WieFel marked this pull request as ready for review July 18, 2021 09:32
@WieFel WieFel requested a review from calvintam236 July 18, 2021 09:32
@WieFel WieFel requested a review from calvintam236 July 18, 2021 11:32
@calvintam236 calvintam236 merged commit 5187239 into master Jul 18, 2021
@calvintam236 calvintam236 deleted the feature/example branch July 19, 2021 06:14
@calvintam236 calvintam236 added this to the v2.0.0 milestone Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants