final
This commit is contained in:
parent
880c076f6b
commit
062bc11a69
@ -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,
|
||||||
|
@ -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)
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user