fromJson static method

FoundPositions? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static FoundPositions? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return FoundPositions(
    totalCount: (json['total_count'] as int?) ?? 0,
    positions: List<int>.from(
        ((json['positions'] as List<dynamic>?) ?? <dynamic>[])
            .map((item) =>
                (item is int ? item : int.tryParse(item.toString()) ?? 0))
            .toList()),
  );
}