Run the Project
Flutter provider quite an extensive guide on installation for different platforms: Flutter Installation Guide. Choose your development environment and target device to get started.
Here is a quick overview of the steps to run the project:
- Make sure you are working with a system with a minimum of 8GB RAM, 4 core CPU, and enough free disk space. This is to ensure enough resources and speed when running the project locally.
- You need to install Git for cloning the project and running some flutter commands. Here is the guide in case you need it: Install Git
- Android Studio for Windows and XCode for Mac is necessary to debug and compile code. CocoaPods are additionally required for iOS.
- Download Flutter SDK and add it to the PATH. For Mac, CocoaPods is also required in the PATH.
- Download the device emulators for Android/iOS to run the code locally.
- Download your favorite IDE: VSCode or Cursor or Android Studio. I encourage you to try Cursor IDE.
Verify Installation
Whether you followed Windows/Mac setup, run flutter doctor
to verify that flutter is set up correctly. Don’t worry - everything may not be checked for you. It depends on the development environment you have chosen.
Start with Flutter Dev Kit
-
Go to the directory where you want to place your project.
-
To download all project dependencies listed in
pubspec.yaml
, run this:Notice it will generate
build/
folder in the project root directory -
Select a device from the bottom-right corner of your VSCode editor.
-
Add environment variables in
assets/.env
file.If you skip this step, you will see an error like this:
-
Go to
lib/main.dart
, you will see a debug and run button on the top-right corner of the IDE. It performs the build, installs, and runs the application on the selected device.Run button on top-right
Or you can run using the command:
Note: This may take few minutes to build and run for the first time.
Congratulations! 🥳 You have successfully run the project!
Additional Step (Android)
If you try to login with Google provider on Android device, you will see an error. This is because Google sign-in require you to provide the SHA-1 of your signing certificate so we can create an OAuth2 client and API key for your app.
To create a SHA-1 key, you can use the following command:
You will see Certificate fingerprints, select the one that starts with SHA1:
. Copy the SHA-1 key. Go to your Firebase console -> Project Settings -> Your apps -> Android -> SHA certificate fingerprints -> Add fingerprint -> Paste the SHA-1 key -> Add.
More information on this: Google Developers - Client Authentication
The project is linked to my Firebase, Stripe and resend account. Now we will make changes step-by-step to integrate with your own accounts.