generateShellStatusWidget method

Widget generateShellStatusWidget()

Implementation

Widget generateShellStatusWidget() {
  if (model.status() == ShellStatus.successful) {
    return const TextIcon(
        "Last run was successful", Icons.check_circle_outline,
        color: Colors.green);
  } else if (model.status() == ShellStatus.failed) {
    return const TextIcon("Last run failed", Icons.cancel, color: Colors.red);
  } else if (model.status() == ShellStatus.stopped) {
    return const TextIcon("Last run stopped", Icons.stop_circle,
        color: Colors.yellow);
  } else if (model.status() == ShellStatus.running) {
    return Center(
        child: Row(
      children: [
        const SizedBox(
            height: 20, width: 20, child: CircularProgressIndicator()),
        const SizedBox(
          width: 30,
        ),
        ElevatedButton.icon(
            icon: const Icon(Icons.stop),
            onPressed: () => model.stop(),
            label: const Text("Cancel")),
      ],
    ));
  } else {
    return Container();
  }
}