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;
@ -78,7 +79,7 @@ class _CardState extends State<Card> {
children: [ children: [
Container( Container(
padding: padding:
const EdgeInsets.only(top: 50, bottom: 15, left: 40, right: 40), const EdgeInsets.only(top: 50, bottom: 15, left: 40, right: 40),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.orange, width: 2), border: Border.all(color: Colors.orange, width: 2),
color: Colors.blue, color: Colors.blue,
@ -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: EdgeInsets.only(top: 50), Padding(
child: Column( padding: EdgeInsets.only(top: 50),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text(widget.name, style: TextStyle(fontSize: 17)), children: [
Text("Местоположение: ${widget.location}", style: TextStyle(fontSize: 15)), Text(widget.name, style: TextStyle(fontSize: 17)),
Text("${widget.price} Рублей/сутки", Text("Местоположение: ${widget.location}",
style: TextStyle( style: TextStyle(fontSize: 15)),
fontSize: 17, color: Colors.orange)) Text("${widget.price} Рублей/сутки",
], style: TextStyle(fontSize: 17, color: Colors.orange))
), ],
) ),
)
], ],
), ),
), ),
Positioned( Positioned(
right: 300, right: 300,
top: 10, top: 10,
@ -119,4 +123,3 @@ class _CardState extends State<Card> {
); );
} }
} }