Skip to content

Commit

Permalink
feat: add vaulted and vaultedDate to MinimalItem
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerOrnstein committed Jan 30, 2024
1 parent 5071b25 commit e19fabd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/src/clients/items_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ class WarframeItemsClient extends WarframestatClient {

/// Returns all [Item]s that match the search query.
Future<List<MinimalItem>> search(String query) async {
const opts =
'uniqueName,name,description,imageName,category,type,vaulted,vaultDate';

final response = await _get<List<dynamic>>(
'/search/$query',
query: {'only': 'uniqueName,name,description,imageName,category,type'},
query: {'only': opts},
);

return compute(toSearchItems, response);
Expand Down
9 changes: 9 additions & 0 deletions lib/src/models/warframe_items/minimal_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ class MinimalItem extends Item {
required super.productCategory,
required super.patchlogs,
required super.imageName,
required this.vaultDate,
required this.vaulted,
});

/// Creates an instance of [MinimalItem] from json.
factory MinimalItem.fromJson(Map<String, dynamic> json) {
return _$MinimalItemFromJson(json);
}

final String? vaultDate;

final bool? vaulted;

@override
Map<String, dynamic> toJson() => _$MinimalItemToJson(this);

@override
List<Object?> get props => super.props..add([vaultDate, vaulted]);
}
4 changes: 4 additions & 0 deletions lib/src/models/warframe_items/minimal_item.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e19fabd

Please sign in to comment.