-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add hero widget for profile picture animation #1131
base: develop
Are you sure you want to change the base?
Conversation
Hi! Thanks for contributing, please fix the linting errors first 😅, thanks! |
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.
Besides the linter annoyances, I left some comments below. Thank you for the contribution!
@override | ||
Widget build(BuildContext context) { | ||
if (onLoad == null) { |
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 think it is cleaner to simply surround the callback with the condition, this is repeated below.
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.
If the callback is surrounded by if (onLoad != null) {...}
the variable _loading
should be also set to false so the condition else { _loading = false; }
is needed. Do you still prefer this approach over the implemented one?
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 meant surround the add callback statement, not the callback body
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.
But still, I get that, can we set loading and onLoad not null?
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.
Yep, it is feasible, but I think that in this case, the return early pattern makes the code simpler and easier to read
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.
Yeah, seems like a tradeoff. In that case, I'll leave it to your preference.
), | ||
if (decorationImage.hasData) | ||
{ | ||
Navigator.push( |
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 there any way to keep the named route and pass a parameter, to keep consistency?
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.
Maybe. I think pushNamed
can receive arguments and then be used on RouteSettings.
I'll try 🚀
@@ -23,6 +23,14 @@ class CourseUnitDetailPageView extends StatefulWidget { | |||
|
|||
class CourseUnitDetailPageViewState | |||
extends SecondaryPageViewState<CourseUnitDetailPageView> { | |||
@override | |||
void initState() { |
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't you achieve this simply calling the construction? This field should be private, I think.
417c250
to
bd61b50
Compare
I love to see that in the app! What can we do to make it possible? |
From what I remember, the hero widget was working correctly. However, I suppose that the usage of this particular widget triggered some internal application behaviour which conflicts with the test... |
Closes #1120
Add hero widget for profile picture animation
Review checklist
whatsnew/whatsnew-pt-PT
changelog.md
with the change