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});
|
||||
|
||||
factory _Card.fromData(
|
||||
CardData data, OnLikeFunction? onLike, VoidCallback? onTap) =>
|
||||
CardData data, {OnLikeFunction? onLike, VoidCallback? onTap}) =>
|
||||
_Card(
|
||||
name: data.name,
|
||||
price: data.price,
|
||||
|
@ -53,8 +53,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
children: [
|
||||
_Card.fromData(
|
||||
cardData,
|
||||
(String text) => _showSnackBar(context, text),
|
||||
() => _navigateToDetailsPage(context, cardData),
|
||||
onTap: () => _navigateToDetailsPage(context, cardData),
|
||||
onLike: (String text) => _showSnackBar(context, text),
|
||||
),
|
||||
const SizedBox(height: 20)
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user