lab 3 доработка

This commit is contained in:
Arkadiy Radaev 2024-10-09 16:10:25 +04:00
parent 8901a403ad
commit edc28313ec

View File

@ -107,13 +107,13 @@ class MyWidget extends StatelessWidget {
} }
class _Car extends StatelessWidget { class _Car extends StatelessWidget {
final String text; final String TitleCar;
final String descriptionCar; final String descriptionCar;
final IconData icon; final IconData icon;
final String? imageUrl; final String? imageUrl;
const _Car( const _Car(
this.text, { this.TitleCar, {
this.icon = Icons.ac_unit_outlined, this.icon = Icons.ac_unit_outlined,
required this.descriptionCar, required this.descriptionCar,
this.imageUrl, this.imageUrl,
@ -134,11 +134,11 @@ class _Car extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white70, color: Colors.white70,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
border: Border.all(color: Colors.grey), border: Border.all(color: Colors.redAccent),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.grey.withOpacity(.5), color: Colors.deepOrange.withOpacity(.5),
spreadRadius: 4, spreadRadius: 5,
offset: const Offset(0, 5), offset: const Offset(0, 5),
blurRadius: 8, blurRadius: 8,
), ),
@ -150,8 +150,8 @@ class _Car extends StatelessWidget {
ClipRRect( ClipRRect(
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
child: SizedBox( child: SizedBox(
height: 140, height: 150,
width: 100, width: 150,
child: Image.network( child: Image.network(
imageUrl ?? '', imageUrl ?? '',
fit: BoxFit.cover, fit: BoxFit.cover,
@ -166,7 +166,7 @@ class _Car extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
text, TitleCar,
style: Theme.of(context).textTheme.headlineLarge, style: Theme.of(context).textTheme.headlineLarge,
), ),
Text( Text(
@ -177,10 +177,6 @@ class _Car extends StatelessWidget {
), ),
), ),
), ),
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Icon(icon),
),
], ],
), ),
); );