Skip to content
pubscout

google_cloud

0.5.0, released 6 months ago by cloud.google.com

Utilities for running Dart code correctly on the Google Cloud Platform.

$ flutter pub add google_cloud
Source repository

What it does

Provides core utilities for Google Cloud Platform integration in Dart, including automatic project ID discovery via environment variables, configuration, and metadata server, as well as metadata API access.

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

Use it when

  • You are running a Dart application on Google Cloud Platform and need to discover the current project ID.
  • You need to access the Google Cloud Metadata Server from within a running Dart service.

Skip it when

  • You are building a client application unrelated to Google Cloud Platform infrastructure.
  • You need logging or HTTP serving features (which have been split into separate packages like google_cloud_logging and google_cloud_shelf).

Strengths

  • Automatic project discovery using multiple fallback strategies.
  • Built-in caching for metadata server responses.

Weaknesses

  • Community-supported project with no official SLA or deprecation policy.
  • Recent breaking changes have spun off logging and HTTP serving into separate packages.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4

Requires appropriate Google Cloud environment variables or credentials depending on your deployment environment.

import 'package:google_cloud/google_cloud.dart';

void main() async {
  final projectId = await computeProjectId();
  print('Running in project: $projectId');
}

Alternatives

Packages that do the same job and could replace google_cloud.

Works with

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