From 917b0fcf455e598f28cee43738611db06cb576c1 Mon Sep 17 00:00:00 2001 From: "nikbel2004@outlook.com" Date: Tue, 17 Sep 2024 17:15:58 +0400 Subject: [PATCH] laboratory_3 --- lib/main.dart | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 7519d8c..841ddea 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,10 +35,7 @@ class _MyHomePageState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - backgroundColor: Theme - .of(context) - .colorScheme - .inversePrimary, + backgroundColor: Theme.of(context).colorScheme.inversePrimary, title: Text(widget.title), ), body: Padding( @@ -53,7 +50,11 @@ class _MyHomePageState extends State { } 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 double price; @@ -78,7 +79,7 @@ class _CardState extends State { children: [ Container( 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( border: Border.all(color: Colors.orange, width: 2), color: Colors.blue, @@ -87,26 +88,29 @@ class _CardState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Center( + child: ClipRRect( + borderRadius: BorderRadius.circular(20.0), + // Радиус скругления child: Image.network( "https://cdn0.youla.io/files/images/780_780/63/29/6329d9f543eedb62b7695786-1.jpg"), - ), - Padding( - padding: EdgeInsets.only(top: 50), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(widget.name, style: TextStyle(fontSize: 17)), - Text("Местоположение: ${widget.location}", style: TextStyle(fontSize: 15)), - Text("${widget.price} Рублей/сутки", - style: TextStyle( - fontSize: 17, color: Colors.orange)) - ], - ), - ) + ), + ), + Padding( + padding: EdgeInsets.only(top: 50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(widget.name, style: TextStyle(fontSize: 17)), + Text("Местоположение: ${widget.location}", + style: TextStyle(fontSize: 15)), + Text("${widget.price} Рублей/сутки", + style: TextStyle(fontSize: 17, color: Colors.orange)) + ], + ), + ) ], ), ), - Positioned( right: 300, top: 10, @@ -119,4 +123,3 @@ class _CardState extends State { ); } } -