fromChar static method

Suit? fromChar(
  1. String c
)

Create one from text character or unicode symbol.

Implementation

static Suit? fromChar(String c) {
  switch (c) {
    case 'c':
    case '♣':
      return Club;
    case 'd':
    case '♦':
      return Diamond;
    case 'h':
    case '♥':
      return Heart;
    case 's':
    case '♠':
      return Spade;
    default:
      return null;
  }
}