Project setup
Prerequisites
Before you begin, ensure you have the following installed:
- Flutter SDK
- Dart SDK
- A code editor (VS Code or Android Studio recommended)
- Git
Initial Setup
Clone the repository:
git clone [repository-url]
cd [project-name]
Install dependencies:
flutter pub get
Running the Project
To run the project in debug mode:
flutter run
The app will open in a browser or device depending on your selected target platform:
- For web: Opens in your default browser
- For mobile: Opens in the connected device or emulator
- For desktop: Opens as a native window
Environment Configuration
The project uses environment-specific configuration files for different deployment scenarios.
Environment Files Structure
lib/
└── config/
├── .env.dart # Default development configuration
├── .env.dart.prod # Production configuration
├── .env.dart.staging # Staging configuration
└── .env.dart.test # Testing configuration
By default, the project uses .env.dart
configuration. To use a different environment:
Copy the appropriate environment file:
cp lib/config/.env.dart.prod lib/config/.env.dart
Update the configuration values according to your needs.
Backend Configuration
Firebase Setup
If you're using Firebase:
Replace the default test configuration in .env.dart
with your Firebase project credentials:
class Environment {
static const firebaseApiKey = 'your-api-key';
static const firebaseAuthDomain = 'your-auth-domain';
static const firebaseProjectId = 'your-project-id';
static const firebaseStorageBucket = 'your-storage-bucket';
static const firebaseMessagingSenderId = 'your-messaging-sender-id';
static const firebaseAppId = 'your-app-id';
}
Supabase Setup
If you're using Supabase:
Update the Supabase configuration in .env.dart
:
class Environment {
static const supabaseUrl = 'your-supabase-url';
static const supabaseAnonKey = 'your-anon-key';
}
Cross-Platform Testing
To ensure your setup works across different platforms:
Test on Web:
flutter run -d chrome
Test on Android:
flutter run -d android
Test on iOS (requires macOS):
flutter run -d ios
Test on Desktop:
flutter run -d windows
# or
flutter run -d macos
# or
flutter run -d linux
Troubleshooting
If you encounter any issues:
-
Ensure all dependencies are correctly installed:
flutter pub get
-
Clean the project:
flutter clean
flutter pub get -
Verify your environment configuration file (
.env.dart
) is properly set up. -
Check that you have the correct SDK versions as specified in
pubspec.yaml
.
Next Steps
After successful setup:
- Review the project structure.
- Check the included example features.
- Begin customizing the boilerplate according to your needs.
For more detailed information about specific features, refer to the other sections of the documentation.