https://github.com/zeshuaro/google_api_headers
A Flutter plugin for getting the headers required to call Google APIs with an app restricted API key
https://github.com/zeshuaro/google_api_headers
dart flutter flutter-plugin google-api
Last synced: about 1 year ago
JSON representation
A Flutter plugin for getting the headers required to call Google APIs with an app restricted API key
- Host: GitHub
- URL: https://github.com/zeshuaro/google_api_headers
- Owner: zeshuaro
- License: mit
- Created: 2020-12-24T12:35:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-30T14:00:25.000Z (about 1 year ago)
- Last Synced: 2025-04-02T08:10:07.701Z (about 1 year ago)
- Topics: dart, flutter, flutter-plugin, google-api
- Language: Dart
- Homepage: https://pub.dev/packages/google_api_headers
- Size: 1.38 MB
- Stars: 10
- Watchers: 3
- Forks: 32
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Google API Headers
[](https://pub.dartlang.org/packages/google_api_headers)
[](https://pub.dev/documentation/google_api_headers/latest/)
[](https://github.com/zeshuaro/google_api_headers/blob/main/LICENSE)
[](https://github.com/zeshuaro/google_api_headers/actions/workflows/github-actions.yml)
[](https://codecov.io/gh/zeshuaro/google_api_headers)
[](https://app.codacy.com/gh/zeshuaro/google_api_headers/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://pub.dev/packages/flutter_lints)
[](https://github.com/sponsors/zeshuaro)
[](https://www.buymeacoffee.com/zeshuaro)
[](https://ko-fi.com/zeshuaro)
[](https://liberapay.com/zeshuaro/)
[](https://patreon.com/zeshuaro)
[](https://paypal.me/JoshuaTang)
A Flutter plugin for getting the headers required to call Google APIs with an [app restricted API key](https://developers.google.com/maps/api-security-best-practices#restricting-api-keys).
## Getting Started
Add this to your project's `pubspec.yaml` file:
```yml
dependencies:
google_api_headers: ^4.4.3
```
## Usage
Depending on the platform (iOS or Android), the function will return the required key and value pairs for calling Google APIs with keys that are restricted to an iOS or Android app.
```dart
import 'package:google_api_headers/google_api_headers.dart';
final headers = await GoogleApiHeaders().getHeaders();
```