forked from openfoodfacts/openfoodfacts-dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: openfoodfacts#370 - new source configuration for saveProduct
New file: * `SourceConfiguration.dart`: Source Configuration for detection of apps (populates data sources on BE). Impacted file: * `openfoodfacts.dart`: added source configuration parameter to `saveProduct`
- Loading branch information
1 parent
057e0a3
commit d52b6d2
Showing
2 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// Source Configuration for detection of apps (populates data sources on BE). | ||
class SourceConfiguration { | ||
const SourceConfiguration({ | ||
this.appName, | ||
this.appVersion, | ||
this.appUuid, | ||
}); | ||
|
||
final String? appName; | ||
final String? appVersion; | ||
final String? appUuid; | ||
|
||
Map<String, String> getParameters() { | ||
final Map<String, String> result = <String, String>{}; | ||
if (appName != null) { | ||
result['app_name'] = appName!; | ||
} | ||
if (appVersion != null) { | ||
result['app_version'] = appVersion!; | ||
} | ||
if (appUuid != null) { | ||
result['app_uuid'] = appUuid!; | ||
} | ||
return result; | ||
} | ||
} |