build method

  1. @override
Widget build(
  1. BuildContext context,
  2. 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 device in _devices)
      SizedBox(
        width: 250,
        child: Card(
          child: Column(
            children: [
              ListTile(
                onTap: () => model.resetDevice(device),
                leading: const Icon(Icons.restart_alt),
                title: Text("Reset ${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(device)),
                    NetworkStatusIcon(
                      device: device,
                      tooltip: "Ping Device",
                      onPressed: Platform.isWindows
                          ? () => model.ping(device)
                          : null,
                    ),
                    sshButton(device) ?? Container(),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
  ],
);