Skip to content
pubscout

google_identity_services_web

0.3.3+1, released 2 years ago by flutter.dev

Dart JS-interop wrapper for Google Identity Services Web SDK

WASM-readyQuiet but busy
$ flutter pub add google_identity_services_web
Source repository

What it does

Provides Dart bindings to Google’s Sign‑In‑With‑Google and OAuth2 JavaScript APIs, allowing Flutter Web apps to load the SDK and call its functions from Dart code.

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

Use it when

  • Implement Google Sign‑In on a Flutter Web app
  • Need to call Google OAuth2 flows from a web page

Skip it when

  • Building a mobile or desktop app
  • Using a server‑side authentication flow

Strengths

  • Pure Dart wrapper, no native code
  • Handles loading the SDK via script tag or on‑demand
  • No need for allowInterop in callbacks
  • Supports both authentication and authorization APIs

Weaknesses

  • Web‑only, not usable on mobile or desktop
  • Requires manual script tag or conditional import
  • Limited to Google Identity Services, no other providers

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
2

Add the package to pubspec, optionally insert <script src="https://accounts.google.com/gsi/client" async defer></script> in index.html or call loadWebSdk() in main.dart

import 'package:google_identity_services_web/loader.dart' as gis;

void main() async {
  await gis.loadWebSdk(); // load the SDK
  // use google.accounts.id or google.accounts.oauth2 via the provided bindings
}

Alternatives

Packages that do the same job and could replace google_identity_services_web.

Works with

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