toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  return {
    'totalItems': totalItems,
    'items': items.map((x) => x.toMap()).toList(),
    'transactions': transactions.map((x) => x.toMap()).toList(),
    'total': total.toMap(),
  };
}