commandLoop function

void commandLoop()

model from dartlang.org sample loop for switch cases

Implementation

void commandLoop() {
  var command = 'OPEN';
  //.........................
  doClosed() => print('..closed');
  doOpen() => print('..open');
  doApproved() => print('..approved');
  doUnknown() => print('..unknown');

  //.........................
  switch (command) {
    case 'CLOSED':
      doClosed();
      break;
    case 'OPEN':
      doOpen();
      break;
    case 'APPROVED':
      doApproved();
      break;
    default:
      doUnknown();
  }
}