-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Add CupertinoLinearActivityIndicator
#170108
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?
Add CupertinoLinearActivityIndicator
#170108
Conversation
a8baca1
to
15ee6a9
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.
Thanks for this PR. Can you attach images comparing to native as well as a description of the native APIs for similar behaviors? For a design review.
@override | ||
void paint(Canvas canvas, Size size) { | ||
// Draw the background of the progress bar. | ||
canvas.drawRRect( |
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'm wondering if the native version is a rounded rect or a rounded superellipse (squircle). Can you attach images to the PR description comparing the native version?
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've tried to look at https://developer.apple.com/design/human-interface-guidelines/progress-indicators
and from the photo
it looks like rounded rect? But again, I half guessing 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.
The native photo attached has less-rounded corners on the edges than the flutter photo attached. But the actual blue line has the same rounding (I think) in both.
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.
It's true on the picture it looks like the container has less rounded corners.
However, if I look at https://developer.apple.com/design/human-interface-guidelines/progress-indicators
it looks like the background AND the blue line are having a stadium shape, which is like the current implementation
Having said that, what would you prefer me to do?
I can replace the current native image attached to the PR description with the ones from https://developer.apple.com/design/human-interface-guidelines/progress-indicators
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.
Can you attach images from a running native iOS app? The goal is to match live widgets, not HIG website photos.
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.
@victorsanni I have attached the picture from the issue in the description. I might need a bit of assistance to provide what you need from me, as I'm not very familiar with Cupertino and Apple specs/environment. For context, I saw the issue #156167 and noticed that the PR to fix it #156287 was closed due to a lack of tests. So, I've added those tests. I'm not saying I'm unwilling to apply your suggestion; I just need you to be extra explicit because I might not fully understand everything. |
15ee6a9
to
022699e
Compare
/// {@end-tool} | ||
/// | ||
/// See also: | ||
/// |
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.
Add the circular progress indicator to the 'See also" section, just before the HIG link.
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.
And also add this to the 'See also' section of the circular progress indicator.
required this.progress, | ||
this.height = 4.5, | ||
this.color, | ||
super.key, |
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.
Should be the first argument in the constructor.
/// The color of the progress bar. | ||
/// | ||
/// Defaults to [CupertinoColors.activeBlue] if no color is specified. This | ||
/// color represents the portion of the bar that indicates progress. |
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 sentence should be in a paragraph before the default line.
/// The current progress of the linear activity indicator. | ||
/// | ||
/// This value must be between zero and one. A value of 0.0 means no progress | ||
/// and 1.0 means that progress is complete. The value will be clamped to be |
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.
Is it clamped if it asserts? Don't think this line is necessary.
|
||
/// The current progress of the linear activity indicator. | ||
/// | ||
/// This value must be between zero and one. A value of 0.0 means no progress |
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 value must be between zero and one. A value of 0.0 means no progress | |
/// This value must be between 0.0 and 1.0. A value of 0.0 means no progress |
Be explicit.
|
||
/// The height of the line used to draw the linear activity indicator. | ||
/// | ||
/// The default height is 4.5 units. Must be positive. |
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 default height is 4.5 units. Must be positive. | |
/// Defaults to 4.5 units. Must be positive. |
Removes redundancy.
Thank you for the feedbacks. I improved the documentation in Improve documentation |
Fixes #156167
Continuation of #156287
Native version:
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.