Skip to content
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

Product Page section expanding animation #267

Merged
merged 4 commits into from
Mar 16, 2021
Merged

Conversation

M123-dev
Copy link
Member

fixes: #203

Removed collapsed from smooth_card:
smooth_card.dart
attribute_list_expandable.dart
list_page.dart
pantry_list_page.dart
product_page.dart

smooth_expandable_card.dart: Added icon animation

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm almost OK with the code - see my comments.
I haven't tried it, I'll see the results when it's merged!

packages/smooth_ui_library/lib/widgets/smooth_card.dart Outdated Show resolved Hide resolved

class SmoothExpandableCard extends StatelessWidget {
class SmoothExpandableCard extends StatefulWidget {
const SmoothExpandableCard({
@required this.collapsedHeader,
this.expandedHeader,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need a bool collapsed in the constructor as a default value; there might already be an issue about that.

Copy link
Member Author

@M123-dev M123-dev Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monsieurtanuki I don't know if I understood you exactly, do you mean that we can set the startvalue for each widget inindividually, or something else

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we can use just one header, that's easier to understand.
Anyway, I approve.

children: <Widget>[
Container(
child: collapsed
? widget.collapsedHeader
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: could we just use one header that works for the collapse and expanded states?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@monsieurtanuki the expanded header is now only optional, great idea

@M123-dev M123-dev merged commit b3c9ee6 into master Mar 16, 2021
@M123-dev M123-dev deleted the animated-card-expand branch March 16, 2021 21:56
],
),
if (collapsed != true) content,
header,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@M123-dev : I think this is causing #270 . header should be required, or we should test if it is null. The AttributeListExpandable does not set it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adding an animation on icons when expanding a section in the product page
3 participants