48 lines
1.1 KiB
Dart
48 lines
1.1 KiB
Dart
import "package:shadcn_flutter/shadcn_flutter.dart";
|
|
|
|
class SettingCard extends StatelessWidget {
|
|
const SettingCard({
|
|
super.key,
|
|
required this.title,
|
|
required this.description,
|
|
required this.icon,
|
|
this.onTap,
|
|
});
|
|
|
|
final String title;
|
|
final String description;
|
|
final IconData icon;
|
|
final VoidCallback? onTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Row(
|
|
children: [
|
|
Icon(icon).iconLarge,
|
|
const Gap(12),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(title).textLarge,
|
|
const Gap(4),
|
|
Text(description).textSmall.muted,
|
|
],
|
|
),
|
|
),
|
|
if (onTap != null) ...[
|
|
const Gap(8),
|
|
IconButton.ghost(
|
|
onPressed: onTap,
|
|
icon: const Icon(LucideIcons.chevronRight),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|