-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
API improvements #17
API improvements #17
Conversation
@ahmednfwela It will require to enforce the types. @TheAnkurPanchani Can you review this please? |
@SalahAdDin which types exactly ? |
You put final, but you don't define the variable type. Can you avoid the component duplicate child when it is only one? |
where exactly am i doing that ? |
I had a look at your PR, I am not the owner of the repo, just to point out that there are a few code smells in your PR with concepts such as using final without declaring the type, lazy use of Object, creating variables in memory where they are not needed (don't duplicate), you get it, the devil is in the details. Instead, throw as much stuff as possible directly to the render functions, it is a good way to go but it seems it has breaking changes and it needs some linting, you want to also avoid breaking changes with this library as people will not migrate because this library is a clone of another and there are many forks of the same library. To be fair, I believe that the best thing to do with this carousel library is to start over again with better design patterns, inheritance won't solve everything. |
@eli-me what exact lines am I using final without declaring the type? or using Object ? |
@ahmednfwela I have to do a full code review to point it out because your code is big, I am a bit busy because I am at work now but I might be able to have a look at your changes and do your code review plus make some amendments later on. It is possible you can give me write access to your PR? |
This PR has some conflicts. Please resolve them. I will have a look at all changes, but it will gonna take time as it has lot of changes. |
conflicts resolved @TheAnkurPanchani |
@ahmednfwela @TheAnkurPanchani hey I am still fighting with this library, but I believe I have to do a separate pull request. Thing is, I tried to refactor the entire library for readability and portability and it turns out the way it was designed is as three separate modular libraries, yet, the original developer never did code splitting, they chunked all classes in big files and it's not really modular because they all depend on each other and I am thinking what way should we go. Basically maintaining this repo means we have to maintain the package flutter_page_indicator and transformer_page_view which by the way were not maintained anymore (3 years) @ahmednfwela I will not touch your PR, just make sure it doesn't have any conflicts and merge it into master, I will continue with the refactoring on a separate thread after your contribution. |
I forgot to mention @ahmednfwela that you put changes on all files in the library, including the transformer page view and the page indicator which are supposed to be different libraries. People which depend on the base packages (not the slider) and use this library will have an error for redefinition, but I think as well that it's not the case since most should be using a non-null version of this library like card_swiper or the other clones in pub.dev. |
the general idea of this pr was to solve problems I was facing and weird exceptions but it just evolved to be a refactor, and I just made a pr of it. if there is no intention for this to be merged, it's ok, I will just continue referencing my fork |
and I can't find anywhere where you say I put final without defining type or using Object |
I mentioned you many different places where you didn't put the type. |
do you mean as |
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.
These are just some examples about we commented.
@@ -88,7 +88,7 @@ class _FormSelectState extends State<FormSelect> { | |||
height: values.length * 30.0 + 70.0, | |||
child: CupertinoPicker( | |||
itemExtent: 30.0, | |||
children: values.map((Object value) { | |||
children: values.map((value) { |
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.
Here you are removing the variable type.
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.
- this is the example package
- value type is inferred from usage,
List<T> values
means that value is of typeT
, I fail to understand how that is a problem
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.
final without type is not a code smell. Flutter team use that but that does not make not using it a code smell |
this PR uses polymorphism instead of multiple enum values to determine the swiper state
also fixes some issues where the timer would still run after the widget is disposed