google_cloud
0.5.0, released 6 months ago by cloud.google.com
Utilities for running Dart code correctly on the Google Cloud Platform.
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.
- cloud_firestore_web
The web implementation of cloud_firestore.
82Compare - cloud_functions_web
Web implementation of Firebase Cloud Functions for Flutter web apps
78Compare - gcloud
High-level Dart API for Google Cloud Storage, Pub/Sub, and Datastore.
77Compare - appengine
Support for using Dart as a custom runtime on Google App Engine Flexible Environment.
73Compare
Works with
Packages commonly used together with google_cloud: ones it builds on, ones built on it, and its own family.
- stack_tracegoogle_cloud depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- googleapis_authBuilt on google_cloudObtain Access credentials and authenticated HTTP clients for Google APIs using OAuth 2.0.
- google_cloud_storageBuilt on google_cloudA Dart client for Google Cloud Storage.
- google_cloud_firestoreBuilt on google_cloudA Dart client library for Google Cloud Firestore database.
- firebase_admin_sdkBuilt on google_cloudFirebase Admin SDK implementation for Dart server environments
- functions_frameworkBuilt on google_cloudFaaS framework for writing portable Dart functions.