This document provides a high-level introduction to the auth0-flutter repository, an Auth0 SDK for Flutter applications supporting Android, iOS, macOS, and Web platforms. The SDK enables Flutter developers to integrate authentication and authorization functionality from Auth0 into their cross-platform applications.
This overview covers the repository structure, core components, and architectural patterns. For detailed information about specific aspects:
The auth0-flutter repository contains a Flutter SDK that provides:
The SDK is distributed as two pub.dev packages:
| Package | Version | Purpose |
|---|---|---|
auth0_flutter | 2.0.0-beta.5 | Main SDK package for application integration |
auth0_flutter_platform_interface | 2.0.0-beta.4 | Platform abstraction layer and shared contracts |
Sources: auth0_flutter/pubspec.yaml1-8 auth0_flutter_platform_interface/pubspec.yaml1-3 README.md7-12
The repository follows a federated plugin architecture with clear separation between platform-agnostic Dart code and platform-specific native implementations:
The main SDK package (auth0_flutter) depends on the platform interface package and includes platform-specific implementations for Android, iOS/macOS (Darwin), and Web. The platform interface defines abstract contracts that each implementation must fulfill.
Sources: auth0_flutter/pubspec.yaml1-56 auth0_flutter_platform_interface/pubspec.yaml1-14 README.md9-12
The SDK exposes three primary components through the main entry point classes:
Applications instantiate one of two classes depending on the target platform:
Auth0 class: Used for Android, iOS, and macOS applications. Constructed with domain and client ID parameters.Auth0Web class: Used for web applications. Provides web-specific functionality like popup-based authentication.WebAuthentication API (webAuthentication())
Authentication API (api property)
Credentials Manager (credentialsManager property)
Sources: auth0_flutter/README.md131-293 auth0_flutter/lib/src/version.dart1
The SDK implements Flutter's federated plugin architecture, which separates interface definitions from platform implementations:
The plugin registers with Flutter using platform-specific plugin classes defined in pubspec.yaml:
| Platform | Plugin Class | File Location |
|---|---|---|
| Android | Auth0FlutterPlugin | android/src/main/kotlin/ |
| iOS | Auth0FlutterPlugin | darwin/Classes/ (shared) |
| macOS | Auth0FlutterPlugin | darwin/Classes/ (shared) |
| Web | Auth0FlutterPlugin | lib/src/web.dart |
The sharedDarwinSource: true configuration in pubspec.yaml enables code sharing between iOS and macOS implementations.
Sources: auth0_flutter/pubspec.yaml38-56 auth0_flutter/ios/auth0_flutter.podspec1-29 auth0_flutter/darwin/auth0_flutter.podspec1-29
Sources: auth0_flutter/README.md356-392 auth0_flutter/CHANGELOG.md1-36 auth0_flutter_platform_interface/CHANGELOG.md1-35
The SDK has specific minimum version requirements across platforms:
| Component | Minimum Version |
|---|---|
| Flutter SDK | 3.24.0+ |
| Dart SDK | 3.5.0+ |
| Android API | 21+ |
| Android Java | 8+ |
| iOS | 14+ |
| macOS | 11+ |
| Swift | 5.9+ |
| Xcode | 15.x / 16.x |
Native SDK Dependencies:
Sources: auth0_flutter/README.md29-35 auth0_flutter/pubspec.yaml6-16 auth0_flutter/ios/auth0_flutter.podspec16-24 auth0_flutter/darwin/auth0_flutter.podspec16-24
The SDK is distributed through pub.dev as two separate packages that are versioned independently:
af-v* git tags (e.g., af-v2.0.0-beta.5)afpi-v* git tags (e.g., afpi-v2.0.0-beta.4)Both packages undergo security scanning via Reversing Labs before publication. The CI/CD pipeline automates testing across all platforms and aggregates code coverage reports to Codecov.
Sources: auth0_flutter/pubspec.yaml1-4 auth0_flutter_platform_interface/pubspec.yaml1-3 README.md1-35
To begin using the SDK:
flutter pub add auth0_flutterFor detailed setup instructions and code examples, see Getting Started and Authentication Flows.
Sources: auth0_flutter/README.md37-293 auth0_flutter/example/README.md1-92
Refresh this wiki