genericizing add card, activity ui tweaks
This commit is contained in:
37
lib/widgets/generic/elements/add_card_generic.dart
Normal file
37
lib/widgets/generic/elements/add_card_generic.dart
Normal file
@ -0,0 +1,37 @@
|
||||
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),
|
||||
)))
|
||||
]));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user