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

Hot reload issues #7

Closed
ariedov opened this issue Oct 28, 2018 · 17 comments
Closed

Hot reload issues #7

ariedov opened this issue Oct 28, 2018 · 17 comments
Labels
bug Something isn't working
Milestone

Comments

@ariedov
Copy link
Owner

ariedov commented Oct 28, 2018

When changing a parameter on the Snaplist itself the app has to be restarted to apply changes.

@ariedov ariedov added the bug Something isn't working label Oct 28, 2018
@raacker
Copy link
Contributor

raacker commented Oct 30, 2018

What was the issue?

@ariedov
Copy link
Owner Author

ariedov commented Oct 30, 2018

Updated the description.

For instance: the axis change is not applied until the app restart. Does not work by hot reload.

@raacker
Copy link
Contributor

raacker commented Oct 30, 2018

Figured out and fixed. But want to ask first, Bloc is currently initialize at SnapList creation (initState) using final fields including sizeProvider, separatorProviders, etc. But if we want to support runtime build and changes to get hot-reload advantage, we should shrink them into fields. Would it be okay to you?

@ariedov
Copy link
Owner Author

ariedov commented Oct 30, 2018

Yes, it will be totally ok. Thank you!

@ariedov
Copy link
Owner Author

ariedov commented Oct 30, 2018

Just don't forget to update on didUpdateWidget.

@raacker
Copy link
Contributor

raacker commented Oct 30, 2018

Yup :)

@ariedov ariedov added this to the 0.1.6 milestone Oct 31, 2018
@raacker
Copy link
Contributor

raacker commented Oct 31, 2018

@ariedov hmm... seems I got a problem with keeping start position. So, when we do hot reload the app, the center position is still on previous center. But that leads to make all center positions to off from center since it's not correctly calculated. Why don't we reset the progress when it does reload? I was keep testing on make it to move proper position but I think just resetting all stuffs would be safe and stable in any situations :)

@ariedov
Copy link
Owner Author

ariedov commented Oct 31, 2018

I am not sure what do you mean by

reset the progress when it does reload

Do you mean that you want to reset the progress and position on reassemble? If yes - then I am ok with it.

@raacker
Copy link
Contributor

raacker commented Oct 31, 2018

never mind. It should not move the position when axis didn't change. Then could you tell me how to move to specific position by force?

@ariedov
Copy link
Owner Author

ariedov commented Oct 31, 2018

There is no way to move to a specific position. For now, at least ;)

@raacker
Copy link
Contributor

raacker commented Oct 31, 2018

@ariedov oh well.....
screenshot_20181031-204531

this is the bug that I have now :) when we change axis, it's off

@raacker
Copy link
Contributor

raacker commented Oct 31, 2018

after scrolling a few times, it gets back to normal

@ariedov
Copy link
Owner Author

ariedov commented Oct 31, 2018

There might be a few reasons for it.

  1. The scroll offset was calculated for the vertical axis, but after we've changed it the calculation is wrong due to card size differences.
  2. The progress is off, which I doubt.

@ariedov
Copy link
Owner Author

ariedov commented Oct 31, 2018

If everything else works, I mean if we can change card sizes, orientation and separator sizes by hot reload - I would appreciate a pull request.
This issue can be fixed later.

@raacker
Copy link
Contributor

raacker commented Oct 31, 2018

@ariedov let me try a bit more! I'll just make PR if I can't resolve the issue

@ariedov
Copy link
Owner Author

ariedov commented Oct 31, 2018

Ok, no problem. Thank you very much, I really appreciate your help.

raacker added a commit to raacker/flutter_snaplist that referenced this issue Oct 31, 2018
raacker added a commit to raacker/flutter_snaplist that referenced this issue Oct 31, 2018
It will invoke UiEvent that makes scrollProgress to 0 when it's reinitializing.
Thus, it will update properly.
ariedov pushed a commit that referenced this issue Oct 31, 2018
It will invoke UiEvent that makes scrollProgress to 0 when it's reinitializing.
Thus, it will update properly.
@ariedov
Copy link
Owner Author

ariedov commented Oct 31, 2018

Done with that. I'll create a new issue for position storing.

@ariedov ariedov closed this as completed Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants