meilisearch / meilisearch-dart

The Meilisearch API client written for Dart
https://meilisearch.com
MIT License
81 stars 26 forks source link

Add `copyWith` to `SearchQuery` #305

Closed ahmednfwela closed 1 year ago

ahmednfwela commented 1 year ago

going to need this for the flutter ui kit

brunoocasali commented 1 year ago

Can you give me more info about this method? I also asked that in the PR review so you can answer only here if you want!

ahmednfwela commented 1 year ago

since SearchQuery is immutable, we need a way to change certain values in it, which is why the copyWith is introduced.

why this is needed tho can be seen here

https://github.com/meilisearch/meilisearch-flutter/blob/ab97f0eee4fda9512491dae165b28bebbc77ad61/lib/src/widgets/query_builders/offset_based.dart#L99-L122

where we manipulate the input query to automatically progress the search results based on scroll