LinuxCommandLibrary

flutterfire

Configure Flutter projects for Firebase

TLDR

Initialize and configure Firebase for your current Flutter app

$ flutterfire configure
copy

Specify platforms (iOS, Android, web) to support
$ flutterfire configure --platforms [ios,android,...]
copy

Use a specific Firebase project
$ flutterfire configure --project [project_id]
copy

SYNOPSIS

flutterfire <command> [options]

Most commonly used as:
flutterfire configure [options]

PARAMETERS

configure
    Initiates the process of generating or updating Firebase configuration files for your Flutter project. This is the most frequently used subcommand.

  --project <project_id>
    Specifies the Firebase project ID to use for configuration. If omitted, the tool will attempt to infer it or prompt for selection.

  --platforms <platforms>
    A comma-separated list of target platforms for which to generate configuration files (e.g., android,ios,web,macos,windows,linux).

  --ios-bundle-id <bundle_id>
    Specifies the iOS bundle ID for the application. Essential for iOS configuration.

  --android-package-name <package_name>
    Specifies the Android package name for the application. Essential for Android configuration.

  --web-app-id <app_id>
    Specifies the Web app ID. Useful when connecting to an existing Web app in Firebase.

  --macos-bundle-id <bundle_id>
    Specifies the macOS bundle ID for the application.

  --windows-project-name <name>
    Specifies the Windows project name (e.g., Runner). Defaults to your Flutter project name if not provided.

  --linux-project-name <name>
    Specifies the Linux project name (e.g., Runner). Defaults to your Flutter project name if not provided.

  --debug
    Enables verbose debug logging for troubleshooting purposes.

  --help
    Displays help information for the flutterfire command or a specific subcommand.

login
    Authenticates the flutterfire CLI with your Google account, allowing it to interact with your Firebase projects.

logout
    Logs out the currently authenticated Google account from the flutterfire CLI.

DESCRIPTION

The flutterfire command-line tool simplifies the integration of Firebase into Flutter projects. It's part of the official FlutterFire ecosystem, designed to automate the setup and generation of Firebase configuration files (like firebase_options.dart) across various platforms (Android, iOS, Web, macOS, Windows, Linux). This tool significantly reduces the manual effort required to link a Flutter application to a Firebase project, ensuring correct initialization and platform-specific settings. It primarily interacts with your Firebase project via the Firebase CLI and your local Flutter project structure, acting as a bridge between your Flutter codebase and your Firebase backend.

CAVEATS

  • Requires the Flutter SDK to be installed and configured in your system's PATH.
  • Requires the Firebase CLI (firebase-tools) to be installed globally and authenticated (you typically run firebase login separately).
  • The flutterfire command must be executed from the root directory of your Flutter project.
  • For specific platforms, ensure their respective platform directories (e.g., android/, ios/, web/) are generated within your Flutter project (e.g., by running flutter create . or flutter build web).

HISTORY

The flutterfire CLI tool was developed as a crucial part of the official FlutterFire development initiative. Its inception aimed to significantly streamline the developer experience for integrating Firebase services into Flutter applications, addressing the complexities of managing cross-platform Firebase configurations. It emerged alongside the expansion of Flutter to diverse platforms like web, desktop, and mobile, providing a robust, automated setup process that mitigates common manual configuration errors. Its evolution is tightly coupled with the development of the FlutterFire packages themselves, ensuring consistent and up-to-date Firebase integration.

SEE ALSO

flutter(1), firebase(1)

Copied to clipboard