Running Your First Flutter App
Running Your First Flutter App
About
- First Run validates setup
- Default counter app demonstrates core concepts
- Supports multiple run targets
- Introduces development workflow
Main Topics
-
Run Targets
- Definition: Device selection
- Example:
# List connected: flutter devices # Run on specific: flutter run -d iPhone12
-
Debug Mode
- Definition: Development configuration
- Example:
# Default for: flutter run
-
Emulator Usage
- Definition: Virtual device testing
- Example:
# Start emulator: flutter emulators --launch Pixel_5
-
Physical Device
- Definition: Real hardware testing
- Example:
# Android: adb devices # iOS: flutter run -d '00008020-001A...'
-
First App Features
- Definition: Default counter demo
- Example:
// Demonstrates: // - State management // - Widget composition // - Hot reload
How to Use
- Select: Target device
- Run: Start development
- Debug: Set breakpoints
- Reload: See changes instantly
How It Works
- Build: Debug bundle
- Deploy: To target
- Launch: Main entrypoint
- Connect: For hot reload
Example Session:
flutter emulators --launch Pixel_5
flutter run
# Press r for hot reload
# Press R for hot restart
Conclusion
Running the default Flutter app successfully verifies your development environment is properly configured while demonstrating core framework capabilities. This initial experience showcases Flutter’s hot reload feature and cross-platform execution that form the foundation of productive Flutter development.