# Flutterfire Configure

Use when adding Firebase to a Flutter project, running flutterfire configure...

- Repository: https://github.com/evanca/flutter-ai-rules (668 stars)
- Category: Mobile
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -g -a claude-code -y`
Codex: `npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -g -a codex -y`
Cursor: `npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -g -a cursor -y`
Gemini CLI: `npx skills add evanca/flutter-ai-rules --skill flutterfire-configure -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add evanca/flutter-ai-rules`

## Description

Use when adding Firebase to a Flutter project, running flutterfire configure, initializing Firebase in main.dart, or configuring multiple flavors.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# FlutterFire Configure Skill

This skill defines how to correctly set up and configure Firebase for Flutter applications.

## When to Use

Use this skill when:

* Adding Firebase to a Flutter project for the first time.
* Running `flutterfire configure` after adding a new Firebase service or platform.
* Initializing Firebase in `main.dart`.
* Setting up separate Firebase projects for multiple app flavors.

---

## 1. Prerequisites

Install the required tools:

```bash
npm install -g firebase-tools
firebase login
dart pub global activate flutterfire_cli
```

**Minimum platform requirements:**
- Android: API level 19 (KitKat) or higher
- Apple: iOS 11 or higher

---

## 2. Setup and Configuration

```bash
# From your Flutter project directory:
flutterfire configure

# Add the core Firebase package:
flutter pub add firebase_core
```

- Re-run `flutterfire configure` any time you **add support for a new platform** or **start using a new Firebase service**.
- For Android-specific services (Crashlytics, Performance Monitoring), the FlutterFire CLI automatically adds the required Gradle plugins.
- Rebuild with `flutter run` after adding new Firebase plugins.

---

## 3. Firebase Initialization

```dart
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(
    options: DefaultFirebaseOptions.currentPlatform,
  );
  runApp(const MyApp());
}
```

- Call `WidgetsFlutterBinding.ensureInitialized()` **before** Firebase initialization.
- Place Firebase initialization **before** any other Firebase service calls.
- **Never modify** `firebase_options.dart` manually, it is auto-generated.
- **Commit** `firebase_options.dart` to version control, it contains non-secret configuration identifiers.
- For Firebase Emulator Suite: `await Firebase.initializeApp(demoProjectId: "demo-project-id")`.

---

## 4. Verification and Best Practices

The rest: https://github.com/evanca/flutter-ai-rules/blob/HEAD/skills/flutterfire-configure/SKILL.md
