FirebaseService class

Service for Firebase operations

Constructors

FirebaseService(SetupConfig config, {ProcessRunner? runner})

Properties

authEnvironment Map<String, String>?
Public accessor for the auth environment so collaborator services (like HostingSiteManager) can run firebase/gcloud as the same SA that Oracular's other steps use. Returns the same map as the internal _authEnvironment getter — i.e. a single-key map binding GOOGLE_APPLICATION_CREDENTIALS to the resolved SA file, or null when no SA file was configured/found.
no setter
config SetupConfig
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serviceAccountEmail String?
client_email field extracted from the configured service-account JSON, or null when no key file is configured / readable / valid.
no setter
serviceAccountKeyPath String?
Absolute path to the service-account JSON file Oracular will use for authenticating Firebase / gcloud commands, or null when none was supplied or found.
no setter

Methods

addProjectIamBinding({required String projectId, required String member, required String role, String? account}) Future<({String error, bool success})>
Add an IAM binding (gcloud projects add-iam-policy-binding) granting role to member on projectId. Idempotent: re-running on a project where the binding already exists is a no-op (gcloud reports success).
buildWeb() Future<bool>
Build web app.
canEnableServices({String api = 'serviceusage.googleapis.com', String? account}) Future<bool>
Probe whether a gcloud principal has the serviceusage.services.enable permission on projectId by trying to enable a single API. Defaults to serviceusage.googleapis.com because that API is auto-enabled on every project at creation, so the call is effectively a no-op when the principal does have the permission.
canListFirebaseApps({String? account}) Future<bool>
Probe whether the active principal has firebase.apps.list on the configured project — i.e. the permission needed by step 5.5 (Configure Firebase client wiring).
configureFlutterFire() Future<bool>
Configure FlutterFire for the project
deployAll() Future<bool>
Deploy all Firebase resources
deployFirestore() Future<bool>
Deploy Firestore rules
deployHostingBeta() Future<bool>
Deploy to Firebase Hosting (beta target)
deployHostingRelease() Future<bool>
Deploy to Firebase Hosting (release target)
deployStorage({bool allowNotInitialized = false}) Future<bool>
Deploy Storage rules
enableFirebaseCoreApis() Future<List<String>>
Enable the core Firebase APIs needed by every Firebase-enabled project.
enableGoogleApis() Future<bool>
Enable Google Cloud APIs needed for deployment
gcloudLogin() Future<bool>
Login to gcloud
gcloudUserLogin() Future<bool>
Login to gcloud with a user account, even when Oracular is configured with a service-account key for application credentials.
getActiveFirebaseAccount() Future<String?>
Email of the user the Firebase CLI is logged in as (firebase login:list --json), or null when no login is stored.
getActiveGcloudAccount() Future<String?>
Email of the gcloud account currently active for this terminal session (gcloud config get-value account), or null when gcloud is not authenticated / not installed.
getCredentialedAccounts() Future<List<String>>
All credentialed accounts gcloud knows about (gcloud auth list --format=value(account)), in arbitrary order.
login() Future<bool>
Login to Firebase CLI
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
supportsWebHosting() bool
Whether this project supports web hosting deployment.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

classifyFirebaseErrorForTest(String raw) FirebaseFailureKind
Public accessor for tests.
firebaseErrorForTest(ProcessResult result) String
Public accessor for tests so they can verify error extraction logic.