Files
apskel-owner-flutter/lib/presentation/pages/home/widgets/feature_tile.dart
T

71 lines
2.1 KiB
Dart
Raw Normal View History

2025-08-12 20:44:27 +07:00
import 'package:flutter/material.dart';
import '../../../../common/theme/theme.dart';
import '../../../components/spacer/spacer.dart';
class HomeFeatureTile extends StatelessWidget {
final String title;
2026-05-12 15:47:38 +07:00
final String iconPath;
2025-08-12 20:44:27 +07:00
final Function() onTap;
2026-06-23 21:27:27 +07:00
final bool isHighlighted;
2025-08-12 20:44:27 +07:00
const HomeFeatureTile({
super.key,
required this.title,
2026-05-12 15:47:38 +07:00
required this.iconPath,
2025-08-12 20:44:27 +07:00
required this.onTap,
2026-06-23 21:27:27 +07:00
this.isHighlighted = false,
2025-08-12 20:44:27 +07:00
});
@override
Widget build(BuildContext context) {
2026-06-23 21:27:27 +07:00
final double iconSize = isHighlighted ? 72 : 56;
final double borderRadius = isHighlighted ? 20 : 16;
2025-08-12 20:44:27 +07:00
return Expanded(
child: InkWell(
onTap: onTap,
borderRadius: BorderRadius.circular(AppValue.radius),
child: Container(
2025-08-15 16:31:29 +07:00
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 6),
2025-08-12 20:44:27 +07:00
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
2026-06-23 21:27:27 +07:00
width: iconSize,
height: iconSize,
2025-08-12 20:44:27 +07:00
decoration: BoxDecoration(
gradient: LinearGradient(
2026-06-23 21:27:27 +07:00
colors: [
AppColor.primary.withOpacity(0.1),
AppColor.primary.withOpacity(0.05),
],
2025-08-12 20:44:27 +07:00
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
2026-06-23 21:27:27 +07:00
borderRadius: BorderRadius.circular(borderRadius),
2025-08-12 20:44:27 +07:00
),
2026-05-12 15:47:38 +07:00
child: Image.asset(iconPath),
2025-08-12 20:44:27 +07:00
),
const SpaceHeight(12),
Text(
title,
2026-06-23 21:27:27 +07:00
style: AppStyle.xs.copyWith(
fontWeight: isHighlighted ? FontWeight.w700 : FontWeight.w600,
color: isHighlighted
? const Color(0xFF388E3C)
: AppColor.textPrimary,
2025-08-12 20:44:27 +07:00
letterSpacing: -0.2,
),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
),
),
);
}
}