Skip to content
pubscout

google_api_headers

5.4.5, released 3 weeks ago by an unverified publisher

A Flutter plugin to fetch required headers for calling Google APIs with an app-restricted API key.

$ flutter pub add google_api_headers
Source repository

What it does

It retrieves the required key and value pairs needed to call Google APIs based on the platform (iOS or Android) when using an app-restricted API key.

AI-written summary of version 5.4.5, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to call Google APIs from your app using an app-restricted API key.
  • You need platform-specific headers automatically generated for Google API requests.

Skip it when

  • You are not using Google APIs.
  • Your API keys do not have app restrictions.

Strengths

  • Simplifies getting platform-specific headers for Google API requests.
  • Easy to integrate with a single asynchronous method call.

Weaknesses

  • Limited to getting Google API headers for app-restricted keys.
  • Platform-specific functionality heavily tied to iOS and Android environments.

Setup

Kind
Plugin (native code)
Effort
Low
Code generation
No
Direct dependencies
1

Add the dependency to pubspec.yaml and call the API.

import 'package:google_api_headers/google_api_headers.dart';

final headers = await GoogleApiHeaders().getHeaders();

Alternatives

Packages that do the same job and could replace google_api_headers.

Works with

Packages commonly used together with google_api_headers: ones it builds on, ones built on it, and its own family.