This commit is contained in:
dyakonovr 2024-09-18 13:49:29 +04:00
parent 880c076f6b
commit 062bc11a69
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ class _Card extends StatefulWidget {
{required this.name, required this.price, this.onLike, this.onTap}); {required this.name, required this.price, this.onLike, this.onTap});
factory _Card.fromData( factory _Card.fromData(
CardData data, OnLikeFunction? onLike, VoidCallback? onTap) => CardData data, {OnLikeFunction? onLike, VoidCallback? onTap}) =>
_Card( _Card(
name: data.name, name: data.name,
price: data.price, price: data.price,

View File

@ -53,8 +53,8 @@ class _MyHomePageState extends State<MyHomePage> {
children: [ children: [
_Card.fromData( _Card.fromData(
cardData, cardData,
(String text) => _showSnackBar(context, text), onTap: () => _navigateToDetailsPage(context, cardData),
() => _navigateToDetailsPage(context, cardData), onLike: (String text) => _showSnackBar(context, text),
), ),
const SizedBox(height: 20) const SizedBox(height: 20)
], ],