This project provides a scaffold for implementing Firebase authentication in a Flutter application, runnable in GitHub Codespaces.
To prepare your GitHub Codespace for Flutter development:
- Navigate to your GitHub repository.
- Click on the
Codebutton. - Select
Codespaces. - Click
Create new Codespace.
Note: Stop your Codespace when done to prevent unnecessary credit usage.
Before installation:
- Go to the Firebase Console.
- Click on
Add projectand follow the instructions to create a new Firebase project. - Once the project is created, navigate to the
Authenticationsection. - In the
Sign-in methodtab, enableEmail/Passwordauthentication.
Once your Codespace is ready:
- Open the terminal.
- Run
flutter pub getto install dependencies. - Authenticate with Firebase using
firebase login. - Run
flutterfire configureto connect your app with the Firebase project. - Move
firebase_options.dartfromlibtolib/configwithmv lib/firebase_options.dart lib/config/firebase_options.dart.
Important: Never publish API keys or other sensitive credentials in public repositories. The files that contain these credentials include:
lib/config/firebase_options.dartandroid/app/google-services.jsonios/firebase_app_id_file.jsonmacos/firebase_app_id_file.json
These files should be kept out of version control to protect your Firebase account and services. For an example of how to set up your .gitignore to exclude these files, refer to the .gitignore file in this repository.
Before running the app:
- Open port 3000:
- In the
Portstab, right-click on3000. - Select
Port Visibility. - Choose
Public.
- In the
To start the app:
- Execute
./run.shin the terminal. - After the build, in
Ports, right-click on3000and selectOpen in Browser.