-
Notifications
You must be signed in to change notification settings - Fork 36
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: Pre-cache all images from the PageConfigProvider #285
Conversation
cb4a508
to
a3064e0
Compare
@@ -78,6 +78,8 @@ Future<void> runInstallerApp( | |||
); | |||
tryRegisterService<DesktopService>(GnomeService.new); | |||
tryRegisterServiceFactory<GSettings, String>(GSettings.new); | |||
tryRegisterService( | |||
() => PageConfigService(config: tryGetService<ConfigService>())); |
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.
Could we keep those services in alphabetic order?
import 'package:ubuntu_wizard/ubuntu_wizard.dart'; | ||
import 'package:yaru/yaru.dart'; | ||
|
||
import 'confirm/test_confirm.dart'; |
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.
We should probably import '../../ubuntu_provision/test/test_utils.mocks.dart'
here
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.
Ah yes, in the long run we should probably create an internal package in the monorepo with test helpers, so that we don't have to import files like this.
@@ -138,7 +138,7 @@ class _$PageConfigEntryImpl implements _PageConfigEntry { | |||
} | |||
|
|||
@override | |||
bool operator ==(dynamic other) { | |||
bool operator ==(Object other) { |
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.
Are those unintended changes caused by the linter? Freezed seems to generate those lines with a dynamic
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.
The new version generates Object
instead of dynamic
, it's strange that it isn't Object?
though...
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.
Hm, I was certain I ran pub upgrade
.. I'll check again :)
Everyone contributing to this PR have now signed the CLA. Thanks! |
void setupMockPageConfig({Map<String, PageConfigEntry> pages = const {}}) { | ||
final pageConfigService = MockPageConfigService(); | ||
registerMockService<PageConfigService>(pageConfigService); | ||
when(pageConfigService.pages).thenReturn(pages); |
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.
Misses a stub for excludedPages
(error is thrown in installer_test/initializes subiquity
, which somehow doesn't cause a test failure 😕)
Looks very nice so far, great job!
|
148a2a8
to
2ecf76e
Compare
Sorted out flutter versions and dependency issues - tests fail locally for me now. But it seems like they even fail on the |
I suspect this is what broke the tests. |
Ah, I just rebased on main, that must have been why I didn't see it previously. |
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.
LGTM 👍
Signed-off-by: Lukas Klingsbo <[email protected]>
Signed-off-by: Lukas Klingsbo <[email protected]>
Signed-off-by: Lukas Klingsbo <[email protected]>
Signed-off-by: Lukas Klingsbo <[email protected]>
Signed-off-by: Lukas Klingsbo <[email protected]>
4fe41d8
to
248b5a8
Compare
This PR adds a image cache that loads all images specific by the white labeling config, the loading page is shown meanwhile.
It also speeds up some loading by starting to run multiple futures at once instead of running the sequentially.