Dart Essentials Environment Setup First Flutter App
flutter doctor
pubspec.yaml
String title = "Mobile Programming"; // Non-nullable String? nullableName; // Nullable void greetUser(String? name) { // Use ?? to provide a default value final cleanName = name?.trim() ?? "Guest student"; print("Hello $cleanName"); }
!
# Check the complete development environment status flutter doctor -v # Accept Android licenses flutter doctor --android-licenses
In Android Studio, open SDK Manager > SDK Tools and enable Android SDK Command-line Tools (latest).
Android SDK Command-line Tools (latest)
During the first run, Gradle needs to download dependencies. If access is restricted, configure a suitable DNS service (such as Shekan or Radar) or a system-wide circumvention tool.
# Create a new project flutter create mp_starter_app # Fetch packages declared in pubspec.yaml flutter pub get # List available emulators and connected devices flutter devices # Run the project flutter run
r
R
main()
initState