From 7618f8e35ec9b253ce908a67a69488a33d4c6655 Mon Sep 17 00:00:00 2001 From: faithoflifedev Date: Sun, 23 Feb 2025 13:25:08 -0500 Subject: [PATCH] Fix incorrect face landmark keys #29 --- .../lib/src/provider/files.g.dart | 43 +++++++++++------- .../lib/src/provider/images.g.dart | 43 +++++++++++------- .../lib/src/provider/oauth.g.dart | 45 +++++++++++-------- packages/google_vision/pubspec.yaml | 18 ++++---- packages/google_vision/tool/README.md | 1 + 5 files changed, 89 insertions(+), 61 deletions(-) diff --git a/packages/google_vision/lib/src/provider/files.g.dart b/packages/google_vision/lib/src/provider/files.g.dart index 18bea91..217a656 100644 --- a/packages/google_vision/lib/src/provider/files.g.dart +++ b/packages/google_vision/lib/src/provider/files.g.dart @@ -9,7 +9,11 @@ part of 'files.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _FilesClient implements FilesClient { - _FilesClient(this._dio, {this.baseUrl, this.errorLogger}) { + _FilesClient( + this._dio, { + this.baseUrl, + this.errorLogger, + }) { baseUrl ??= 'https://vision.googleapis.com/v1'; } @@ -30,21 +34,23 @@ class _FilesClient implements FilesClient { _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(params); - final _options = _setStreamType( - Options( - method: 'POST', - headers: _headers, - extra: _extra, - contentType: contentType, - ) - .compose( - _dio.options, - '/files:annotate', - queryParameters: queryParameters, - data: _data, - ) - .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), - ); + final _options = _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + contentType: contentType, + ) + .compose( + _dio.options, + '/files:annotate', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); final _result = await _dio.fetch>(_options); late BatchAnnotateFilesResponse _value; try { @@ -69,7 +75,10 @@ class _FilesClient implements FilesClient { return requestOptions; } - String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { + String _combineBaseUrls( + String dioBaseUrl, + String? baseUrl, + ) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/google_vision/lib/src/provider/images.g.dart b/packages/google_vision/lib/src/provider/images.g.dart index dab50b0..5d14232 100644 --- a/packages/google_vision/lib/src/provider/images.g.dart +++ b/packages/google_vision/lib/src/provider/images.g.dart @@ -9,7 +9,11 @@ part of 'images.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _ImagesClient implements ImagesClient { - _ImagesClient(this._dio, {this.baseUrl, this.errorLogger}) { + _ImagesClient( + this._dio, { + this.baseUrl, + this.errorLogger, + }) { baseUrl ??= 'https://vision.googleapis.com/v1'; } @@ -30,21 +34,23 @@ class _ImagesClient implements ImagesClient { _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(params); - final _options = _setStreamType( - Options( - method: 'POST', - headers: _headers, - extra: _extra, - contentType: contentType, - ) - .compose( - _dio.options, - '/images:annotate', - queryParameters: queryParameters, - data: _data, - ) - .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), - ); + final _options = _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + contentType: contentType, + ) + .compose( + _dio.options, + '/images:annotate', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); final _result = await _dio.fetch>(_options); late BatchAnnotateImagesResponse _value; try { @@ -69,7 +75,10 @@ class _ImagesClient implements ImagesClient { return requestOptions; } - String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { + String _combineBaseUrls( + String dioBaseUrl, + String? baseUrl, + ) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/google_vision/lib/src/provider/oauth.g.dart b/packages/google_vision/lib/src/provider/oauth.g.dart index 98461ad..d2b0c7f 100644 --- a/packages/google_vision/lib/src/provider/oauth.g.dart +++ b/packages/google_vision/lib/src/provider/oauth.g.dart @@ -9,7 +9,11 @@ part of 'oauth.dart'; // ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers,unused_element,unnecessary_string_interpolations class _OAuthClient implements OAuthClient { - _OAuthClient(this._dio, {this.baseUrl, this.errorLogger}) { + _OAuthClient( + this._dio, { + this.baseUrl, + this.errorLogger, + }) { baseUrl ??= 'https://accounts.google.com/o/oauth2'; } @@ -24,26 +28,28 @@ class _OAuthClient implements OAuthClient { final _extra = {}; final queryParameters = {}; final _headers = { - r'Content-Type': 'application/x-www-form-urlencoded', + r'Content-Type': 'application/x-www-form-urlencoded' }; _headers.removeWhere((k, v) => v == null); final _data = {}; _data.addAll(params); - final _options = _setStreamType( - Options( - method: 'POST', - headers: _headers, - extra: _extra, - contentType: 'application/x-www-form-urlencoded', - ) - .compose( - _dio.options, - '/token', - queryParameters: queryParameters, - data: _data, - ) - .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), - ); + final _options = _setStreamType(Options( + method: 'POST', + headers: _headers, + extra: _extra, + contentType: 'application/x-www-form-urlencoded', + ) + .compose( + _dio.options, + '/token', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls( + _dio.options.baseUrl, + baseUrl, + ))); final _result = await _dio.fetch>(_options); late Token _value; try { @@ -68,7 +74,10 @@ class _OAuthClient implements OAuthClient { return requestOptions; } - String _combineBaseUrls(String dioBaseUrl, String? baseUrl) { + String _combineBaseUrls( + String dioBaseUrl, + String? baseUrl, + ) { if (baseUrl == null || baseUrl.trim().isEmpty) { return dioBaseUrl; } diff --git a/packages/google_vision/pubspec.yaml b/packages/google_vision/pubspec.yaml index 374efcb..7703014 100644 --- a/packages/google_vision/pubspec.yaml +++ b/packages/google_vision/pubspec.yaml @@ -1,6 +1,6 @@ name: google_vision description: Allows you to add Google Visions image labeling, face, logo, and landmark detection, OCR, and detection of explicit content, into cross platform applications. -version: 2.0.0+4 +version: 2.0.0+5 repository: https://github.com/faithoflifedev/google_vision homepage: https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision @@ -19,24 +19,24 @@ dependencies: args: ^2.6.0 collection: ^1.18.0 crypto_keys_plus: ^0.4.0 - dio: ^5.7.0 + dio: ^5.8.0+1 flutter_loggy_dio: ^3.1.0 - http: ^1.2.2 - image: ^4.3.0 + http: ^1.3.0 + image: ^4.5.3 jose_plus: ^0.4.6 json_annotation: ^4.9.0 loggy: ^2.0.3 mime: ^2.0.0 - retrofit: ^4.4.1 + retrofit: ^4.4.2 universal_platform: ^1.1.0 dev_dependencies: - build_runner: ^2.4.13 + build_runner: ^2.4.15 grinder: ^0.9.5 - json_serializable: ^6.9.0 - lints: ^5.1.0 + json_serializable: ^6.9.4 + lints: ^5.1.1 publish_tools: ^1.0.0+10 - retrofit_generator: ^9.1.5 + retrofit_generator: ^9.1.9 executables: vision: diff --git a/packages/google_vision/tool/README.md b/packages/google_vision/tool/README.md index 70446a3..f07d134 100644 --- a/packages/google_vision/tool/README.md +++ b/packages/google_vision/tool/README.md @@ -176,6 +176,7 @@ Please see the cli documentation [README.md](https://github.com/faithoflifedev/g - [JLuisRojas](https://github.com/JLuisRojas) - [DeadBryam](https://github.com/DeadBryam) - [husitawi](https://github.com/husitawi) +- [EricApostal](https://github.com/EricApostal) ## Contributing