Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ dependencies:
dio: ^5.2.1
dev_dependencies:
lints: ^4.0.0
test: ^1.24.3
test: ^1.25.8
2 changes: 1 addition & 1 deletion config/.dart-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.4
3.5.2
22 changes: 7 additions & 15 deletions playground/dart/lib/recommend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
];

Expand All @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions scripts/buildClients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion templates/dart/pubspec.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ dev_dependencies:
json_serializable: ^6.7.0
lints: ^4.0.0
logging: ^1.2.0
test: ^1.24.3
test: ^1.25.8
7 changes: 4 additions & 3 deletions tests/output/dart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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