action static method

void action(
  1. String message, [
  2. String? a,
  3. String? b,
  4. String? c,
  5. String? d,
])

$message ──╮─→ $a ─→ $b ╰─→ $c ─→ $d or $message ─→ $a or $message ──╮─→ $a ─→ $b ╰─→ $c ─→ $d

Implementation

static void action(String message,
    [String? a, String? b, String? c, String? d]) {
  if (a != null && b != null && c != null && d != null) {
    print(inYellow(message) +
        inRed(" ──╮─→ ") +
        inPurple(a) +
        inRed(" ─→ ") +
        inGreen(b));
  }
  if (a != null && b != null && c == null) {
    print(inYellow(message) + inRed(" ─→ ") + inPurple(a));
  }
  if (a != null && b == null && c == null) {
    print(inYellow(message) + inRed(" ─→ ") + inPurple(a));
  }
  if (a != null && b != null && c != null && d != null) {
    print(inYellow(message) +
        inRed(" ──╮─→ ") +
        inPurple(a) +
        inRed(" ─→ ") +
        inGreen(b));
    print(inRed(" ".repeat(message.length)) +
        inRed(" ╰─→ ") +
        inPurple(c) +
        inRed(" ─→ ") +
        inGreen(d));
  }
}