Files
syncrow-web/lib/pages/home/view/home_card.dart
2025-05-25 10:57:23 +03:00

66 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class HomeCard extends StatelessWidget {
final bool active;
final String img;
final int index;
final String name;
final Function()? onTap;
final Color? color;
const HomeCard({
super.key,
required this.name,
required this.index,
this.active = false,
required this.img,
required this.onTap,
required this.color,
});
@override
Widget build(BuildContext context) {
return InkWell(
onTap: active ? onTap : null,
child: Container(
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(30),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Flexible(
child: FittedBox(
fit: BoxFit.scaleDown,
child: Text(
name,
style: const TextStyle(
fontSize: 20,
color: Colors.white,
fontWeight: FontWeight.bold,
),
),
),
),
],
),
),
const SizedBox(height: 10),
Expanded(
child: Align(
alignment: AlignmentDirectional.bottomEnd,
child: SvgPicture.asset(img),
),
),
],
),
),
);
}
}