makePretty method Null safety

Map makePretty(
  1. Move uglyMove
)

pretty = external move object

Implementation

Map makePretty(Move uglyMove) {
  Map map = {};
  map['san'] = moveToSan(uglyMove);
  map['to'] = uglyMove.toAlgebraic;
  map['from'] = uglyMove.fromAlgebraic;
  map['captured'] = uglyMove.captured;
  map['color'] = uglyMove.color;

  var flags = '';
  for (var flag in BITS.keys) {
    if ((BITS[flag]! & uglyMove.flags) != 0) {
      flags += FLAGS[flag]!;
    }
  }
  map['flags'] = flags;

  return map;
}