alignmentToJson static method

Map<String, dynamic>? alignmentToJson(
  1. Alignment? source
)

Implementation

static Map<String, dynamic>? alignmentToJson(Alignment? source) {
  if (source == null) return null;
  final x = {
    if (source.x != 0) "x": source.x,
    if (source.y != 0) "y": source.y
  };
  if (x.isEmpty) return null;
  return x;
}