Added answers section logs

This commit is contained in:
Juan Gilsanz Polo 2022-10-22 02:39:29 +02:00
parent 80019eaa13
commit 82870ded63
3 changed files with 70 additions and 35 deletions

View file

@ -179,6 +179,39 @@ class LogDetailsModal extends StatelessWidget {
title: AppLocalizations.of(context)!.deviceName,
subtitle: log.clientInfo!.name
),
if (log.answer.isNotEmpty) ...[
Padding(
padding: const EdgeInsets.all(20),
child: Text(
AppLocalizations.of(context)!.answer,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryColor
),
),
),
...log.answer.map((a) => LogListTile(
icon: Icons.download_rounded,
title: a.value,
subtitle: "TTL: ${a.ttl.toString()}",
trailing: Container(
padding: const EdgeInsets.all(5),
decoration: BoxDecoration(
color: Theme.of(context).listTileTheme.iconColor,
borderRadius: BorderRadius.circular(10)
),
child: Text(
a.type,
style: const TextStyle(
fontSize: 12,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
)
)).toList()
]
],
),
),

View file

@ -18,45 +18,47 @@ class LogListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final width = MediaQuery.of(context).size.width;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Icon(
icon,
size: 24,
),
const SizedBox(width: 20),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: const TextStyle(
fontSize: 18,
),
),
const SizedBox(height: 5),
subtitleWidget ?? SizedBox(
width: width-100,
child: Text(
subtitle!,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).listTileTheme.iconColor,
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,
),
),
),
)
],
),
],
const SizedBox(height: 5),
subtitleWidget ?? Text(
subtitle!,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).listTileTheme.iconColor,
),
)
],
),
),
],
),
),
if (trailing != null) trailing!
if (trailing != null) ...[
const SizedBox(width: 10),
trailing!
]
],
),
);