Skip to content

Commit

Permalink
Added hero animation to the product summary card (#1334)
Browse files Browse the repository at this point in the history
* Added hero animation to the product summary card

* formatted the code
  • Loading branch information
Gagarod authored Mar 26, 2022
1 parent 7a315dc commit e15720d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 9 additions & 6 deletions packages/smooth_app/lib/pages/product/new_product_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,15 @@ class _ProductPageState extends State<ProductPage> {
padding: const EdgeInsets.symmetric(
horizontal: SMALL_SPACE,
),
child: SummaryCard(
_product,
_productPreferences,
isFullVersion: true,
showUnansweredQuestions: true,
refreshProductCallback: _refreshProduct,
child: Hero(
tag: _product.barcode ?? '',
child: SummaryCard(
_product,
_productPreferences,
isFullVersion: true,
showUnansweredQuestions: true,
refreshProductCallback: _refreshProduct,
),
),
),
_buildKnowledgePanelCards(),
Expand Down
5 changes: 4 additions & 1 deletion packages/smooth_app/lib/pages/scan/scan_product_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ class ScanProductCard extends StatelessWidget {
_openProductPage(context);
}
},
child: SummaryCard(product, productPreferences),
child: Hero(
tag: product.barcode ?? '',
child: SummaryCard(product, productPreferences),
),
);
}

Expand Down

0 comments on commit e15720d

Please sign in to comment.