Skip to content

Commit

Permalink
docs and no export
Browse files Browse the repository at this point in the history
  • Loading branch information
faithoflifedev committed May 15, 2024
1 parent 72b9d65 commit 4bab47d
Show file tree
Hide file tree
Showing 34 changed files with 206 additions and 159 deletions.
20 changes: 11 additions & 9 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ scripts:
run: melos run build && melos run meta && melos run markdown && melos run analyze && melos run format && melos run commit:flutter
description: Run prep steps Flutter.

commit:dart:
run: melos exec git add .; git commit -m "chore(release); git push origin main"
description: Commit changes for Dart package.
## TODO: Add commit steps for Dart and Flutter packages.

commit:flutter:
run: melos exec git add .; git commit -m "chore(release); git push origin main"
description: Commit changes for Flutter package.
# commit:dart:
# run: melos exec git add .; git commit -m "chore(release); git push origin main"
# description: Commit changes for Dart package.

# commit:flutter:
# run: melos exec git add .; git commit -m "chore(release); git push origin main"
# description: Commit changes for Flutter package.

publish:real:dart:
run: melos exec --ignore="google_vision_flutter" dart pub publish --force
Expand Down Expand Up @@ -91,6 +93,6 @@ scripts:
run: melos exec pana --no-dartdoc .
description: Run pana checks for all packages.

clean:deep:
run: git clean -x -d -f -q
description: Clean things very deeply, can be used to establish "pristine checkout" status.
# clean:deep:
# run: git clean -x -d -f -q
# description: Clean things very deeply, can be used to establish "pristine checkout" status.
68 changes: 3 additions & 65 deletions packages/google_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
# Changelog

## 1.2.1

* [ISSUE #19](https://github.com/faithoflifedev/google_vision_workspace/issues/19) - Support for API key

## 1.2.1

* [ISSUE #19](https://github.com/faithoflifedev/google_vision_workspace/issues/19) - Support for API key

## 1.2.1
## 1.2.1+1

* [ISSUE #19](https://github.com/faithoflifedev/google_vision_workspace/issues/19) - Support for API key
* updated documentation

## 1.2.1

* [ISSUE #19](https://github.com/faithoflifedev/google_vision_workspace/issues/19) - Support for API key

## 1.2.1

* [ISSUE #19](https://github.com/faithoflifedev/google_vision_workspace/issues/19) - Support for API key

## 1.2.1

* [ISSUE #19](https://github.com/faithoflifedev/google_vision_workspace/issues/19) - Support for API key
* [ISSUE #19](https://github.com/faithoflifedev/google_vision_workspace/issues/19) - Support for API key authentication

## 1.2.0+6

Expand All @@ -49,22 +33,6 @@

* dependency bump

## 1.1.1+3

* dependency bump

## 1.1.1+3

* dependency bump

## 1.1.1+3

* dependency bump

## 1.1.1+3

* dependency bump

## 1.1.1+2

* dependency bump
Expand All @@ -73,10 +41,6 @@

* adjust ignore

## 1.1.0+4

* adjust ignore

## 1.1.0+3

* adjust gitignore
Expand Down Expand Up @@ -113,11 +77,6 @@
* web entities and pages
* dependency bump

## 1.0.8

* web entities and pages
* dependency bump

## 1.0.7+7

* https://github.com/faithoflifedev/google_vision/issues/8
Expand Down Expand Up @@ -156,23 +115,6 @@
* support for `error` responses
* support for contextual information

## 1.0.7

* support for landmark detection
* support for logo detection
* support for text and full-text detection
* support for image properties detection
* support for `error` responses
* support for contextual information

## 1.0.7

* support for landmark detection
* support for logo detection
* support for text and full-text detection
* support for image properties detection
* support for `error` responses
* support for contextual information

## 1.0.6+7

Expand Down Expand Up @@ -224,10 +166,6 @@

* support for `publish_tools`

## 1.0.5+2

* support for `publish_tools`

## 1.0.5+1

* updated build tool
Expand Down
2 changes: 1 addition & 1 deletion packages/google_vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To use this package, add the dependency to your `pubspec.yaml` file:
```yaml
dependencies:
...
google_vision: ^1.2.1
google_vision: ^1.2.1+1
```
### Obtaining Authorization Credentials
Expand Down
2 changes: 1 addition & 1 deletion packages/google_vision/lib/meta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ library meta;
import 'dart:convert' show json;

final pubSpec = json.decode(
'{"name":"google_vision","version":"1.2.1","homepage":"https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision","environment":{"sdk":">=3.2.0 <4.0.0"},"description":"Allows you to add Google Visions image labeling, face, logo, and landmark detection, OCR, and detection of explicit content, into cross platform applications.","dependencies":{"args":"^2.5.0","collection":"^1.18.0","crypto_keys_plus":"^0.4.0","dio":"^5.4.3+1","http":"^1.2.1","image":"^4.1.7","jose_plus":"^0.4.6","json_annotation":"^4.9.0","retrofit":"^4.1.0","universal_io":"^2.2.2"},"dev_dependencies":{"build_runner":"^2.4.9","grinder":"^0.9.5","json_serializable":"^6.8.0","lints":"^4.0.0","publish_tools":"^1.0.0+4","retrofit_generator":"^8.1.0","test":"^1.25.5"},"executables":{"vision":""},"repository":"https://github.com/faithoflifedev/google_vision"}');
'{"name":"google_vision","version":"1.2.1+1","homepage":"https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision","environment":{"sdk":">=3.2.0 <4.0.0"},"description":"Allows you to add Google Visions image labeling, face, logo, and landmark detection, OCR, and detection of explicit content, into cross platform applications.","dependencies":{"args":"^2.5.0","collection":"^1.18.0","crypto_keys_plus":"^0.4.0","dio":"^5.4.3+1","http":"^1.2.1","image":"^4.1.7","jose_plus":"^0.4.6","json_annotation":"^4.9.0","retrofit":"^4.1.0","universal_io":"^2.2.2"},"dev_dependencies":{"build_runner":"^2.4.9","grinder":"^0.9.5","json_serializable":"^6.8.0","lints":"^4.0.0","publish_tools":"^1.0.0+4","retrofit_generator":"^8.1.0","test":"^1.25.5"},"executables":{"vision":""},"repository":"https://github.com/faithoflifedev/google_vision"}');
1 change: 1 addition & 0 deletions packages/google_vision/lib/src/model/json_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:typed_data';

import 'package:universal_io/io.dart';

/// A class that holds the details of an image that can be converted to/from JSON.
class JsonImage {
final String? imageUri;

Expand Down
2 changes: 1 addition & 1 deletion packages/google_vision/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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: 1.2.1
version: 1.2.1+1
repository: https://github.com/faithoflifedev/google_vision
homepage: https://github.com/faithoflifedev/google_vision/tree/main/packages/google_vision

Expand Down
2 changes: 1 addition & 1 deletion packages/google_vision_flutter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ migrate_working_dir/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
Expand Down
5 changes: 5 additions & 0 deletions packages/google_vision_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.1.0

* removed reexport of &quot;google_vision&quot; package
* added example.md

## 1.0.0+3

* [ISSUE #19](https:&#x2F;&#x2F;github.com&#x2F;faithoflifedev&#x2F;google_vision_workspace&#x2F;issues&#x2F;19) - Support for API key
Expand Down
73 changes: 59 additions & 14 deletions packages/google_vision_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ Please feel free to submit PRs for any additional helper methods, or report an [

## Table of Contents


- [Google Vision Images Flutter Widget](#google-vision-images-flutter-widget)
- [Table of Contents](#table-of-contents)
- [Getting Started](#getting-started)
- [pubspec.yaml](#pubspecyaml)
- [Obtaining Authorization Credentials](#obtaining-authorization-credentials)
- [Usage of the GoogleVisionBuilder Widget](#usage-of-the-googlevisionbuilder-widget)
- [Contributing](#contributing)

## Getting Started

Expand All @@ -21,11 +27,9 @@ To use this package, add the dependency to your `pubspec.yaml` file:
```yaml
dependencies:
...
google_vision_flutter: ^1.0.0+3
google_vision_flutter: ^1.1.0
```
<!-- <img src="https://github.com/faithoflifedev/flip_card/blob/master/screenshots/young_man_smiling.png?raw=true&amp;v1" width="320"> -->
### Obtaining Authorization Credentials
Expand All @@ -37,6 +41,7 @@ See the [example app](https://github.com/faithoflifedev/google_vision_workspace/
```dart
import 'package:flutter/material.dart';
import 'package:google_vision/google_vision.dart' as gv;
import 'package:google_vision_flutter/google_vision_flutter.dart';

class FaceDetection extends StatefulWidget {
Expand Down Expand Up @@ -89,16 +94,15 @@ class _MyHomePageState extends State<FaceDetection> {
'assets/service_credentials.json'),
imageProvider: _processImage.image,
builder: (BuildContext context,
List<FaceAnnotation>? faceAnnotations,
ImageDetail imageDetail) {
return CustomPaint(
foregroundPainter: AnnotationPainter(
faceAnnotations: faceAnnotations,
imageDetail: imageDetail,
),
child: Image(image: _processImage.image),
);
},
List<gv.FaceAnnotation>? faceAnnotations,
ImageDetail imageDetail) =>
CustomPaint(
foregroundPainter: AnnotationPainter(
faceAnnotations: faceAnnotations,
imageDetail: imageDetail,
),
child: Image(image: _processImage.image),
),
),
)
],
Expand All @@ -107,8 +111,49 @@ class _MyHomePageState extends State<FaceDetection> {
),
);
}

/// See the example project for all the necessary code.

```

<center><img src="https://github.com/faithoflifedev/google_vision_workspace/blob/main/packages/google_vision_flutter/screenshot/face_detection.png?raw=true&amp;v1" width="320"></center>

## Major Changes for v1.1.x

Starting with this version of the package, the `google_vision` package is not re-exported by `google_vision_flutter`, this means that you must import `google_vision` manually in the cases that you need any classes that are part of it's API.

```dart
import 'package:flutter/material.dart';
import 'package:google_vision/google_vision.dart' as gv;
import 'package:google_vision_flutter/google_vision_flutter.dart';
GoogleVisionBuilder.faceDetection(
googleVision: GoogleVision.withAsset(
'assets/service_credentials.json'),
imageProvider: _processImage.image,
builder: (BuildContext context,
List<gv.FaceAnnotation>? faceAnnotations,
ImageDetail imageDetail) =>
CustomPaint(
foregroundPainter: AnnotationPainter(
faceAnnotations: faceAnnotations,
imageDetail: imageDetail,
),
child: Image(image: _processImage.image),
),
),
```

In this code snippet the `FaceAnnotation` class is referenced as `gv.FaceAnnotation` since the class is part of the `google_vision` package.

Previous versions of the `google_vision_flutter` package reexported the `google_vision` package as part of the it's library definition. This lead to warnings like:

```text
warning: private API of package:google_Vision is reexported by libraries in other packages:
```

During analysis of the package. The updated package does not generate these warnings.

## Contributing

Any help from the open-source community is always welcome and needed:
Expand Down
16 changes: 0 additions & 16 deletions packages/google_vision_flutter/example/README.md

This file was deleted.

3 changes: 2 additions & 1 deletion packages/google_vision_flutter/example/lib/crop_hints.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_vision/google_vision.dart' as gv;
import 'package:google_vision_flutter/google_vision_flutter.dart';

class CropHints extends StatefulWidget {
Expand Down Expand Up @@ -52,7 +53,7 @@ class _MyHomePageState extends State<CropHints> {
imageProvider: _processImage.image,
builder: (
BuildContext context,
CropHintsAnnotation? cropHintsAnnotation,
gv.CropHintsAnnotation? cropHintsAnnotation,
ImageDetail? imageDetail,
) =>
Padding(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_vision/google_vision.dart' as gv;
import 'package:google_vision_flutter/google_vision_flutter.dart';

class DocumentTextDetection extends StatefulWidget {
Expand Down Expand Up @@ -52,7 +53,7 @@ class _MyHomePageState extends State<DocumentTextDetection> {
imageProvider: _processImage.image,
builder: (
BuildContext context,
FullTextAnnotation? fullTextAnnotation,
gv.FullTextAnnotation? fullTextAnnotation,
ImageDetail? imageDetail,
) =>
Padding(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_vision/google_vision.dart' as gv;
import 'package:google_vision_flutter/google_vision_flutter.dart';

class FaceDetection extends StatefulWidget {
Expand Down Expand Up @@ -51,7 +52,7 @@ class _MyHomePageState extends State<FaceDetection> {
'assets/service_credentials.json'),
imageProvider: _processImage.image,
builder: (BuildContext context,
List<FaceAnnotation>? faceAnnotations,
List<gv.FaceAnnotation>? faceAnnotations,
ImageDetail imageDetail) =>
CustomPaint(
foregroundPainter: AnnotationPainter(
Expand All @@ -70,7 +71,7 @@ class _MyHomePageState extends State<FaceDetection> {
}

class AnnotationPainter extends CustomPainter {
final List<FaceAnnotation>? faceAnnotations;
final List<gv.FaceAnnotation>? faceAnnotations;
// a reference to the original image
final ImageDetail imageDetail;

Expand Down Expand Up @@ -140,7 +141,7 @@ class AnnotationPainter extends CustomPainter {
}

void drawAnnotationsRect({
required List<Vertex> vertices,
required List<gv.Vertex> vertices,
required Canvas canvas,
required double heightRatio,
required double widthRatio,
Expand Down
Loading

0 comments on commit 4bab47d

Please sign in to comment.