2022-10-01 02:00:51 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class LogListTile extends StatelessWidget {
|
|
|
|
final IconData icon;
|
|
|
|
final String title;
|
|
|
|
final String? subtitle;
|
|
|
|
final Widget? subtitleWidget;
|
|
|
|
final Widget? trailing;
|
|
|
|
|
|
|
|
const LogListTile({
|
|
|
|
Key? key,
|
|
|
|
required this.icon,
|
|
|
|
required this.title,
|
|
|
|
this.subtitle,
|
|
|
|
this.subtitleWidget,
|
|
|
|
this.trailing,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
2022-10-21 12:33:22 +02:00
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
2022-10-01 02:00:51 +02:00
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
2022-10-22 02:39:29 +02:00
|
|
|
Flexible(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Icon(
|
|
|
|
icon,
|
|
|
|
size: 24,
|
|
|
|
),
|
|
|
|
const SizedBox(width: 20),
|
|
|
|
Flexible(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: const TextStyle(
|
|
|
|
fontSize: 18,
|
|
|
|
),
|
2022-10-01 02:00:51 +02:00
|
|
|
),
|
2022-10-22 02:39:29 +02:00
|
|
|
const SizedBox(height: 5),
|
|
|
|
subtitleWidget ?? Text(
|
|
|
|
subtitle!,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 14,
|
|
|
|
color: Theme.of(context).listTileTheme.iconColor,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2022-10-01 02:00:51 +02:00
|
|
|
),
|
2022-10-22 02:39:29 +02:00
|
|
|
if (trailing != null) ...[
|
|
|
|
const SizedBox(width: 10),
|
|
|
|
trailing!
|
|
|
|
]
|
2022-10-01 02:00:51 +02:00
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|