Aller au contenu principal

Flutter Commands

📌 Installation & Setup

flutter doctor               # Check Flutter installation and dependencies
flutter upgrade # Update Flutter to the latest version
flutter config --enable-web # Enable web support
flutter create my_project # Create a new Flutter project

📌 Running & Debugging

flutter run                  # Run the app on a connected device
flutter run -d chrome # Run on a web browser (if enabled)
flutter run --release # Run the app in production mode
flutter logs # View real-time logs
flutter attach # Attach to a running Flutter app

📌 Dependency Management

flutter pub get              # Install dependencies
flutter pub upgrade # Update dependencies
flutter pub outdated # Check for outdated dependencies
flutter pub cache repair # Repair dependency cache

📌 Building the App

flutter build apk            # Generate an Android APK
flutter build appbundle # Generate an Android App Bundle
flutter build ios # Build for iOS
flutter build web # Build for the web
flutter build macos # Build for macOS
flutter build windows # Build for Windows
flutter build linux # Build for Linux

📌 Testing

flutter test                 # Run all unit and widget tests
flutter test test/my_test.dart # Run a specific test file

📌 Code Formatting & Analysis

flutter analyze              # Analyze the project for errors
flutter format . # Format the codebase

📌 Cleaning the Project

flutter clean                # Clear build cache and temporary files