diff --git a/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml b/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml index c11d4d2260c..be476afbf9d 100644 --- a/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml +++ b/clients/algoliasearch-client-dart/packages/client_core/pubspec.yaml @@ -13,4 +13,4 @@ dependencies: dio: ^5.2.1 dev_dependencies: lints: ^4.0.0 - test: ^1.24.3 + test: ^1.25.8 diff --git a/config/.dart-version b/config/.dart-version index 351227fca34..87ce492908a 100644 --- a/config/.dart-version +++ b/config/.dart-version @@ -1 +1 @@ -3.2.4 +3.5.2 diff --git a/playground/dart/lib/recommend.dart b/playground/dart/lib/recommend.dart index 96d12f5fe28..cf909809be8 100644 --- a/playground/dart/lib/recommend.dart +++ b/playground/dart/lib/recommend.dart @@ -9,23 +9,19 @@ void main() async { appId: dotenv['ALGOLIA_APPLICATION_ID']!, apiKey: dotenv['ALGOLIA_SEARCH_KEY']!, ); - final indexName = dotenv['SEARCH_INDEX']!; // Creating recommendation requests for different products. var requests = [ - RecommendationRequest( - model: RecommendationModels.relatedProducts, + RelatedProducts( + model: RelatedModel.relatedProducts, objectID: '6445156', - indexName: indexName, - threshold: 70, - maxRecommendations: 3, + fallbackParameters: FallbackParams( + query: 'iphone', + ), ), - RecommendationRequest( - model: RecommendationModels.relatedProducts, + RelatedProducts( + model: RelatedModel.relatedProducts, objectID: '6443034', - indexName: indexName, - threshold: 70, - maxRecommendations: 3, ) ]; @@ -44,10 +40,6 @@ void main() async { /// Prints the search hits. void printRecommendations(GetRecommendationsResponse response) { final results = response.results; - if (results == null) { - print("No recommendations found"); - return; - } // Loop over each result and map over the search hits, // converting each hit to a product. diff --git a/scripts/buildClients.ts b/scripts/buildClients.ts index 0653d627242..a1d6c191d55 100644 --- a/scripts/buildClients.ts +++ b/scripts/buildClients.ts @@ -15,6 +15,12 @@ async function buildLanguage(language: Language, gens: Generator[], buildType: B case 'csharp': await run('dotnet build --configuration Release', { cwd, language }); break; + case 'dart': + if (buildType !== 'snippets') { + // fix the snippets at some point + await run('dart pub get && dart analyze', { cwd, language }); + } + break; case 'go': await run('go build ./...', { cwd, language }); break; diff --git a/templates/dart/pubspec.mustache b/templates/dart/pubspec.mustache index 9ed625e3782..538e59a37cd 100644 --- a/templates/dart/pubspec.mustache +++ b/templates/dart/pubspec.mustache @@ -29,4 +29,4 @@ dev_dependencies: json_serializable: ^6.7.0 lints: ^4.0.0 logging: ^1.2.0 - test: ^1.24.3 \ No newline at end of file + test: ^1.25.8 diff --git a/tests/output/dart/pubspec.yaml b/tests/output/dart/pubspec.yaml index f08cae30c03..53951638464 100644 --- a/tests/output/dart/pubspec.yaml +++ b/tests/output/dart/pubspec.yaml @@ -9,9 +9,10 @@ dependencies: algolia_client_search: ^1.0.0 algolia_client_insights: ^1.0.0 algolia_client_recommend: ^1.0.0 - test: ^1.24.3 + test: ^1.25.8 collection: ^1.17.2 - test_api: ^0.6.0 + test_api: ^0.7.3 + algolia_client_core: any dev_dependencies: - lints: ^3.0.0 + lints: ^4.0.0