Skip to content

Commit

Permalink
loose ends
Browse files Browse the repository at this point in the history
  • Loading branch information
faithoflifedev committed Aug 18, 2024
1 parent 41d10fd commit 976b75f
Show file tree
Hide file tree
Showing 22 changed files with 1,585 additions and 170 deletions.
8 changes: 4 additions & 4 deletions melos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ scripts:
# description: Run publish for all packages.

prep:dart:
run: melos run build && melos run meta && melos run markdown && melos run analyze && melos run format && melos run commit:dart
run: melos run build && melos run meta && melos run markdown && melos run analyze && melos run format
description: Run prep steps dart.

prep:flutter:
run: melos run build && melos run meta && melos run markdown && melos run analyze && melos run format && melos run commit:flutter
run: melos run build && melos run meta && melos run markdown && melos run analyze && melos run format
description: Run prep steps Flutter.

## TODO: Add commit steps for Dart and Flutter packages.
Expand All @@ -37,15 +37,15 @@ scripts:
# description: Commit changes for Dart package.

# commit:flutter:
# run: melos exec git add .; git commit -m "chore(release); git push origin main"
# 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
description: Real publish for Google_Vision Package.

publish:real:flutter:
run: melos exec --ignore="google_vision" dart pub publish --force
run: melos exec --ignore="google_vision" flutter pub publish --force
description: Real publish for Google_Vision Package.

publish:flutter:
Expand Down
13 changes: 1 addition & 12 deletions packages/google_vision/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@

## 1.3.0

* support for file API
* sepeartion of code base into file and image API
* separation of code base into file and image API
* better support for ImageContext
* deprecate old methods/classes

## 1.2.1+3

* support for file API
* sepeartion of code base into file and image API
* deprecate old methods/classes

## 1.3.0

* custom headers with API Key authentication Issue #23

## 1.3.0

* custom headers with API Key authentication Issue #23

## 1.2.1+2

Expand Down
32 changes: 32 additions & 0 deletions packages/google_vision_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## 1.3.0

* added back the google_vision re-export
* package example is now included
* dependency bump for google_vision
* example added for new file functionality

## 1.3.0

* added back the google_vision re-export
* package example is now included
* dependency bump for google_vision
* example added for new file functionality

## 1.2.1+3

* added back the google_vision re-export
* package example is now included
* dependency bump for google_vision

## 1.2.1+3

* added back the google_vision re-export
* package example is now included
* dependency bump for google_vision

## 1.2.1+3

* added back the google_vision re-export
* package example is now included
* dependency bump for google_vision

## 1.2.1+3

* added back the google_vision re-export
Expand Down
2 changes: 1 addition & 1 deletion packages/google_vision_flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To use this package, add the dependency to your `pubspec.yaml` file:
```yaml
dependencies:
...
google_vision_flutter: ^1.2.1+3
google_vision_flutter: ^1.3.0
```
Expand Down
Binary file not shown.
6 changes: 4 additions & 2 deletions packages/google_vision_flutter/example/lib/crop_hints.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ class CropHints extends StatefulWidget {
}

class _MyHomePageState extends State<CropHints> {
static const assetName = 'assets/young-man-smiling.jpg';

final _processImage = Image.asset(
'assets/young-man-smiling.jpg',
assetName,
fit: BoxFit.fitWidth,
);

Expand All @@ -32,7 +34,7 @@ class _MyHomePageState extends State<CropHints> {
children: <Widget>[
const Padding(
padding: EdgeInsets.all(8.0),
child: Text('assets/young-man-smiling.jpg'),
child: Text(assetName),
),
Padding(
padding: const EdgeInsets.all(8.0),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import 'package:flutter/material.dart';
import 'package:google_vision_flutter/google_vision_flutter.dart';
import 'package:vision_demo/show_pdf.dart';

class DocumentTextDetectionFile extends StatefulWidget {
const DocumentTextDetectionFile({super.key, required this.title});

final String title;

@override
State<DocumentTextDetectionFile> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<DocumentTextDetectionFile> {
static const assetName = 'assets/allswell.pdf';

@override
Widget build(BuildContext context) => SafeArea(
child: Scaffold(
appBar: AppBar(
leading: IconButton(
icon: const Icon(Icons.arrow_back, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
title: Text(widget.title),
),
body: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
ElevatedButton(
child: const Text('Show PDF Content'),
onPressed: () => Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
const ShowPdf(assetName: assetName),
),
)),
const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Process result will appear below:',
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: GoogleVisionFileBuilder.documentTextDetection(
googleVision: GoogleVision.withAsset(
'assets/service_credentials.json'),
inputConfig: InputConfig.fromAsset('assets/allswell.pdf'),
builder: (
BuildContext context,
List<AnnotateFileResponse>? responses,
Future<InputConfig> inputConfig,
) =>
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: responses!
.map((annotateFileResponse) => Row(
children: [
const Text('Total Pages - '),
Text(
'${annotateFileResponse.totalPages}'),
],
))
.toList()),
),
),
)
],
),
),
),
);
}
131 changes: 76 additions & 55 deletions packages/google_vision_flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';

import 'crop_hints.dart';
import 'document_text_detection.dart';
import 'document_text_detection_file.dart';
import 'face_detection.dart';
import 'image_properties.dart';
import 'label_detection.dart';
Expand Down Expand Up @@ -34,6 +35,10 @@ class MyApp extends StatelessWidget {
'/documenttextdetection': (context) => const DocumentTextDetection(
title: 'Document Text Detection',
),
'/documenttextdetectionfile': (context) =>
const DocumentTextDetectionFile(
title: 'Document Text Detection',
),
'/facedetection': (context) => const FaceDetection(
title: 'Face Detection',
),
Expand All @@ -59,7 +64,7 @@ class MyApp extends StatelessWidget {
title: 'Text Detection',
),
'/webdetection': (context) => const WebDetection(
title: 'Web Detection',
title: 'Document Text Detection from PDF',
),
},
);
Expand All @@ -76,60 +81,76 @@ class MenuScreen extends StatelessWidget {
title: const Text('Menu'),
),
body: Center(
child:
Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
ElevatedButton(
child: const Text('Multiple Detections'),
onPressed: () => Navigator.pushNamed(context, '/multiple'),
),
ElevatedButton(
child: const Text('Crop Hints'),
onPressed: () => Navigator.pushNamed(context, '/crophints'),
),
ElevatedButton(
child: const Text('Document Text Detection'),
onPressed: () =>
Navigator.pushNamed(context, '/documenttextdetection'),
),
ElevatedButton(
child: const Text('Face Detection'),
onPressed: () => Navigator.pushNamed(context, '/facedetection'),
),
ElevatedButton(
child: const Text('Image Properties'),
onPressed: () => Navigator.pushNamed(context, '/imageproperties'),
),
ElevatedButton(
child: const Text('Label Detection'),
onPressed: () => Navigator.pushNamed(context, '/labeldetection'),
),
ElevatedButton(
child: const Text('Landmark Detection'),
onPressed: () => Navigator.pushNamed(context, '/landmarkdetection'),
),
ElevatedButton(
child: const Text('Logo Detection'),
onPressed: () => Navigator.pushNamed(context, '/logodetection'),
),
ElevatedButton(
child: const Text('Object Localization'),
onPressed: () =>
Navigator.pushNamed(context, '/objectlocalization'),
),
ElevatedButton(
child: const Text('Safe Search Detection'),
onPressed: () =>
Navigator.pushNamed(context, '/safesearchdetection'),
),
ElevatedButton(
child: const Text('Text Detection'),
onPressed: () => Navigator.pushNamed(context, '/textdetection'),
),
ElevatedButton(
child: const Text('Web Detection'),
onPressed: () => Navigator.pushNamed(context, '/webdetection'),
),
]),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const SizedBox(
height: 30,
child: Text('Image Functions'),
),
ElevatedButton(
child: const Text('Multiple Detections'),
onPressed: () => Navigator.pushNamed(context, '/multiple'),
),
ElevatedButton(
child: const Text('Crop Hints'),
onPressed: () => Navigator.pushNamed(context, '/crophints'),
),
ElevatedButton(
child: const Text('Document Text Detection'),
onPressed: () =>
Navigator.pushNamed(context, '/documenttextdetection'),
),
ElevatedButton(
child: const Text('Face Detection'),
onPressed: () => Navigator.pushNamed(context, '/facedetection'),
),
ElevatedButton(
child: const Text('Image Properties'),
onPressed: () => Navigator.pushNamed(context, '/imageproperties'),
),
ElevatedButton(
child: const Text('Label Detection'),
onPressed: () => Navigator.pushNamed(context, '/labeldetection'),
),
ElevatedButton(
child: const Text('Landmark Detection'),
onPressed: () =>
Navigator.pushNamed(context, '/landmarkdetection'),
),
ElevatedButton(
child: const Text('Logo Detection'),
onPressed: () => Navigator.pushNamed(context, '/logodetection'),
),
ElevatedButton(
child: const Text('Object Localization'),
onPressed: () =>
Navigator.pushNamed(context, '/objectlocalization'),
),
ElevatedButton(
child: const Text('Safe Search Detection'),
onPressed: () =>
Navigator.pushNamed(context, '/safesearchdetection'),
),
ElevatedButton(
child: const Text('Text Detection'),
onPressed: () => Navigator.pushNamed(context, '/textdetection'),
),
ElevatedButton(
child: const Text('Web Detection'),
onPressed: () => Navigator.pushNamed(context, '/webdetection'),
),
const SizedBox(
height: 30,
child: Text('File Functions'),
),
ElevatedButton(
child: const Text('Document Text Detection from PDF'),
onPressed: () =>
Navigator.pushNamed(context, '/documenttextdetectionfile'),
),
],
),
),
);
}
Expand Down
19 changes: 19 additions & 0 deletions packages/google_vision_flutter/example/lib/show_pdf.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';

class ShowPdf extends StatefulWidget {
const ShowPdf({super.key, required this.assetName});

final String assetName;

@override
State<ShowPdf> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<ShowPdf> {
@override
Widget build(BuildContext context) => SafeArea(
child: Scaffold(
body: SfPdfViewer.asset(widget.assetName),
));
}
Loading

0 comments on commit 976b75f

Please sign in to comment.