-
Notifications
You must be signed in to change notification settings - Fork 1
Add LoadingView, improve initialization logic, and refine UI and localization elements
#245
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
base: master
Are you sure you want to change the base?
Conversation
…calization elements
Summary of ChangesHello @Ziedelth, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience during application startup by introducing a dedicated loading screen and refactoring the core initialization process. It also includes various UI refinements across different components and updates to localization strings, ensuring a more polished and intuitive interface. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a LoadingView for a better startup experience by refactoring the initialization logic into a stateful widget. It also includes various UI tweaks, such as icon changes and layout adjustments, and updates to localization strings.
My review highlights two potential issues:
- In the platform preference dialog, the 'Remember my choice' text could cause a UI overflow with longer translations because it's not wrapped in an
Expandedwidget. - In the anime details view, the
maxWidthfor aTextPainterdoesn't account for horizontal padding, which could lead to incorrect text truncation logic.
I've provided code suggestions to address these points. The rest of the changes look good and improve the application's UI and startup sequence.
| textDirection: TextDirection.ltr, | ||
| maxLines: 4, | ||
| )..layout(maxWidth: MediaQuery.sizeOf(context).width - 16); | ||
| )..layout(maxWidth: MediaQuery.sizeOf(context).width); |
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 maxWidth for the TextPainter should account for the horizontal padding of the parent container. The text is rendered within a Padding with symmetric(horizontal: 8), so the available width is MediaQuery.sizeOf(context).width - 16. Using the full screen width might lead to an incorrect calculation of didExceedMaxLines, potentially hiding the '...more' button when the text actually overflows.
| )..layout(maxWidth: MediaQuery.sizeOf(context).width); | |
| )..layout(maxWidth: MediaQuery.sizeOf(context).width - 16); |
| child: Flex( | ||
| direction: Axis.horizontal, | ||
| children: <Widget>[ | ||
| Checkbox( | ||
| value: _remember, | ||
| onChanged: (final bool? value) => | ||
| setState(() => _remember = value ?? false), | ||
| ), | ||
| const SizedBox(width: 8), | ||
| Text(l10n.rememberMyChoice), | ||
| ], | ||
| ), |
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 Text widget for 'Remember my choice' is no longer wrapped in an Expanded widget. This could cause a UI overflow if the localized text is long. It's better to wrap it in Expanded to ensure it takes up the available space and wraps if necessary.
Also, using a Row here is more idiomatic than Flex with a horizontal direction when no other Flex-specific properties are used.
| child: Flex( | |
| direction: Axis.horizontal, | |
| children: <Widget>[ | |
| Checkbox( | |
| value: _remember, | |
| onChanged: (final bool? value) => | |
| setState(() => _remember = value ?? false), | |
| ), | |
| const SizedBox(width: 8), | |
| Text(l10n.rememberMyChoice), | |
| ], | |
| ), | |
| child: Row( | |
| children: <Widget>[ | |
| Checkbox( | |
| value: _remember, | |
| onChanged: (final bool? value) => | |
| setState(() => _remember = value ?? false), | |
| ), | |
| const SizedBox(width: 8), | |
| Expanded( | |
| child: Text(l10n.rememberMyChoice), | |
| ), | |
| ], | |
| ), |
No description provided.