-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat: landscape magic attach #882
Conversation
5c28e4f
to
c182707
Compare
@d-loose still a WIP, and haven't removed the extra pages yet, but if you are happy with how the landscape page and model are looking and how I unblocked the tests, I'll close the ticket to move over to riverpod annotations. Thanks again for all the help! |
Based on my learnings from stubbing out landscape integratino in #882, I have put together some `dev-docs` outlining the broad steps required for adding a new page to the insatller, as well as adding some doc comments on some relevant dart components that did not have any.
a7445c5
to
e32b083
Compare
One thing I forgot to mention: we briefly talked about https://pub.dev/packages/qr_flutter the other day - would be great if you could check whether that's a more future-proof package for QR code generation than the one we're currently using here |
Discussed on MM, we found the current library produced (bottom) clearer QR codes, so will not swap libraries. |
e49a590
to
1fefcd1
Compare
02e9c14
to
9fc4db8
Compare
Looks really good so far! More detailed review comments soon! |
apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_landscape_domain_page.dart
Outdated
Show resolved
Hide resolved
apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_landscape_model.dart
Outdated
Show resolved
Hide resolved
45765f4
to
ec720b0
Compare
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 have a bit of a refactoring proposal (since you've already spent quite a lot of time on this PR, I wouldn't mind merging this and coming back to it later on, though).
Current state management:
There's a single view model (LandscapeDataModel
) for both the 'landscape domain' page where attach()
is called and the 'landscape' page where watch()
is called. The state this model holds includes the domain entered by the user as well as the status response from the server. It also keeps track of a stream/provider subscription and updates its own state whenever a stream event is received (after calling watch()
). Listening/cancelling needs to be handled explicitly through corresponding method calls.
Proposed refactor:
We can split this into two view models. The one for the 'landscape domain' page would
- hold the domain entered by the user
- provide an
attach()
method
Instead of storing the received userCode
in the view model, we could simply pass it to the route that displays the 'landscape' page.
The model for the 'landscape' page would then be a stream provider family (i.e. a stream provider that receives the userCode
as an argument to its build
function) that exposes a stream of UI states for the page. Simply using ref.watch(autoinstallLandscapeProvider(userCode))
would then take care of the stream's lifecycle (i.e. start listening when the user enters the page, cancel when they leave).
-> UDENG-5870
e6b7c9e
to
ceb37d1
Compare
apps/ubuntu_bootstrap/integration_test/ubuntu_bootstrap_test.dart
Outdated
Show resolved
Hide resolved
apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_landscape_page.dart
Outdated
Show resolved
Hide resolved
apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_landscape_page.dart
Outdated
Show resolved
Hide resolved
490a982
to
c8501d3
Compare
c8501d3
to
57728a5
Compare
WIP: Currently just lifting the Ubuntu Pro pages from init out into bootstrap.