laboratory_3

This commit is contained in:
nikbel2004@outlook.com 2024-09-17 17:15:58 +04:00
parent b08b615cc2
commit 917b0fcf45

View File

@ -35,10 +35,7 @@ class _MyHomePageState extends State<MyHomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
backgroundColor: Theme backgroundColor: Theme.of(context).colorScheme.inversePrimary,
.of(context)
.colorScheme
.inversePrimary,
title: Text(widget.title), title: Text(widget.title),
), ),
body: Padding( body: Padding(
@ -53,7 +50,11 @@ class _MyHomePageState extends State<MyHomePage> {
} }
class Card extends StatefulWidget { class Card extends StatefulWidget {
const Card({super.key, required this.name, required this.price, required this.location}); const Card(
{super.key,
required this.name,
required this.price,
required this.location});
final String name; final String name;
final double price; final double price;
@ -87,26 +88,29 @@ class _CardState extends State<Card> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Center( Center(
child: ClipRRect(
borderRadius: BorderRadius.circular(20.0),
// Радиус скругления
child: Image.network( child: Image.network(
"https://cdn0.youla.io/files/images/780_780/63/29/6329d9f543eedb62b7695786-1.jpg"), "https://cdn0.youla.io/files/images/780_780/63/29/6329d9f543eedb62b7695786-1.jpg"),
), ),
),
Padding( Padding(
padding: EdgeInsets.only(top: 50), padding: EdgeInsets.only(top: 50),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(widget.name, style: TextStyle(fontSize: 17)), Text(widget.name, style: TextStyle(fontSize: 17)),
Text("Местоположение: ${widget.location}", style: TextStyle(fontSize: 15)), Text("Местоположение: ${widget.location}",
style: TextStyle(fontSize: 15)),
Text("${widget.price} Рублей/сутки", Text("${widget.price} Рублей/сутки",
style: TextStyle( style: TextStyle(fontSize: 17, color: Colors.orange))
fontSize: 17, color: Colors.orange))
], ],
), ),
) )
], ],
), ),
), ),
Positioned( Positioned(
right: 300, right: 300,
top: 10, top: 10,
@ -119,4 +123,3 @@ class _CardState extends State<Card> {
); );
} }
} }