build method
- @override
- BuildContext context,
- LogsViewModel model
override
Builds the UI according to the state in model.
Implementation
@override
Widget build(BuildContext context, LogsViewModel model) => Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
for (final socket in models.sockets.sockets)
SizedBox(
width: 250,
child: Card(
child: Column(
children: [
ListTile(
onTap: () => model.resetDevice(socket.device),
leading: const Icon(Icons.restart_alt),
title: Text("Reset ${socket.device.humanName}"),
subtitle: const Text("The device will reboot"),
),
Padding(
padding: const EdgeInsets.all(4),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Icon(Icons.circle, color: getStatusColor(socket.device)),
NetworkStatusIcon(
device: socket.device,
tooltip: "Ping Device",
onPressed:
Platform.isWindows
? () => model.ping(socket.device)
: null,
),
sshButton(socket.device) ?? Container(),
],
),
),
],
),
),
),
],
);