adguard-home-manager/lib/screens/logs/details/log_list_tile.dart

69 lines
1.9 KiB
Dart
Raw Normal View History

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-11-04 22:56:00 +01:00
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
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,
2023-01-26 22:43:00 +01:00
color: Theme.of(context).colorScheme.onSurfaceVariant,
2022-10-22 02:39:29 +02:00
),
const SizedBox(width: 16),
2022-10-22 02:39:29 +02:00
Flexible(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
2023-01-25 19:55:34 +01:00
style: TextStyle(
fontSize: 16,
2023-01-25 19:55:34 +01:00
fontWeight: FontWeight.w400,
color: Theme.of(context).colorScheme.onSurface
2022-10-22 02:39:29 +02:00
),
2022-10-01 02:00:51 +02:00
),
const SizedBox(height: 3),
2022-10-22 02:39:29 +02:00
subtitleWidget ?? Text(
subtitle!,
style: TextStyle(
fontSize: 14,
2022-11-05 02:35:35 +01:00
color: Theme.of(context).listTileTheme.textColor,
2022-10-22 02:39:29 +02:00
),
)
],
),
),
],
),
2022-10-01 02:00:51 +02:00
),
2022-10-22 02:39:29 +02:00
if (trailing != null) ...[
const SizedBox(width: 16),
2022-10-22 02:39:29 +02:00
trailing!
]
2022-10-01 02:00:51 +02:00
],
),
);
}
}