сдано

This commit is contained in:
dyakonovr 2024-09-11 15:36:09 +04:00
parent f1d002f7dc
commit 6bbfbf2586

View File

@ -39,11 +39,11 @@ class _MyHomePageState extends State<MyHomePage> {
title: Text(widget.title),
),
body: Padding(
padding: EdgeInsets.all(30),
padding: const EdgeInsets.all(30),
child: ListView.separated(
itemBuilder: (context, index) =>
Card(name: "test $index", price: 11.0),
separatorBuilder: (context, index) => SizedBox(height: 20),
separatorBuilder: (context, index) => const SizedBox(height: 20),
itemCount: 2,
)));
}
@ -73,7 +73,7 @@ class _CardState extends State<Card> {
return Stack(
children: [
Container(
padding: EdgeInsets.only(top: 50, bottom: 15, left: 40, right: 40),
padding: const EdgeInsets.only(top: 50, bottom: 15, left: 40, right: 40),
decoration: BoxDecoration(
border: Border.all(color: Colors.black12, width: 2),
borderRadius: BorderRadius.circular(20)),
@ -90,7 +90,7 @@ class _CardState extends State<Card> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(widget.name, style: TextStyle(fontSize: 17)),
Text(widget.price.toString() + " Руб",
Text("${widget.price} Руб",
style: TextStyle(fontSize: 17, color: Colors.orange))
],
),
@ -105,8 +105,9 @@ class _CardState extends State<Card> {
icon: Icon(_isFavourite ? Icons.favorite : Icons.favorite_border),
color: Colors.red,
onPressed: toggleIsFavourite,
))
)
)
],
);
}
}
}