Money.fromJson constructor

Money.fromJson(
  1. Object? j
)

Implementation

factory Money.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Money(
    currencyCode: switch (json['currencyCode']) {
      null => '',
      Object $1 => decodeString($1),
    },
    units: switch (json['units']) {
      null => 0,
      Object $1 => decodeInt64($1),
    },
    nanos: switch (json['nanos']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
  );
}