SendTrain/lib/widgets/generic/elements/add_card_generic.dart
2025-01-07 12:37:17 -05:00

38 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
class AddCardGeneric extends StatelessWidget {
const AddCardGeneric(
{super.key, required this.title, required this.description, this.action});
final String title;
final String description;
final Function? action;
@override
Widget build(BuildContext context) {
return Expanded(
child: ListView(
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
children: [
Card.outlined(
child: InkWell(
customBorder: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
onTap: () {
if (action != null) {
action!();
}
},
child: ListTile(
contentPadding:
EdgeInsets.only(top: 5, left: 15, right: 5, bottom: 5),
autofocus: true,
leading: Icon(Icons.add_box_rounded),
title: Text(title),
subtitle: Text(description),
)))
]));
}
}