First Flutter App: A Step-by-Step Tutorial
First Flutter App: A Step-by-Step Tutorial
Want to build beautiful mobile apps with just one codebase? Flutter is the way to go! It lets you create apps for Android, iOS, web, and desktop using a single programming language — Dart.
In this tutorial, we’ll help you build your first Flutter app step by step, even if you're new to it.
π ️ What You’ll Learn
-
Installing Flutter
-
Setting up an IDE
-
Creating your first app
-
Understanding the project structure
-
Running the app
-
Making simple changes
✅ Step 1: Install Flutter
π Download Flutter SDK
Visit: https://flutter.dev/docs/get-started/install
Choose your OS (Windows, macOS, Linux) and follow the steps to:
-
Download the SDK
-
Add it to your system path
-
Run
flutter doctorin terminal to check setup
✅ This command checks if everything is installed correctly.
π» Step 2: Install IDE (VS Code or Android Studio)
πΉ Option 1: Visual Studio Code
-
Install VS Code
-
Add Flutter and Dart extensions
πΉ Option 2: Android Studio
-
Install Android Studio
-
Install Flutter & Dart plugins
π± Step 3: Set Up Android/iOS Emulator
You can either:
-
Use an Android Virtual Device (AVD)
-
Connect a real phone via USB
Make sure your device is detected:
π Step 4: Create Your First Flutter App
In terminal or command prompt:
This creates a new project folder named my_first_app.
π Step 5: Explore main.dart
Open lib/main.dart in your editor. You’ll see default code:
▶️ Step 6: Run Your App
Make sure your emulator/phone is running.
Then run:
You’ll see a simple app with a title bar and text “Hello Flutter!”
π§ͺ Step 7: Make a Change
Let’s change the text:
Now save the file. Flutter will hot reload the app instantly!
π¨ Step 8: Add a Button
Let’s add a button under the text.
Replace body: section with:
✅ Save and see the updated UI.
π¦ Step 9: Add a Package
Let’s use a third-party package called google_fonts.
In pubspec.yaml, add under dependencies:
Then run:
Use it in code:
π± Final Code (Summary)
π― What You Learned
-
How to set up Flutter
-
How to create and run a Flutter app
-
How to add text, buttons, and use packages
-
Basic UI layout using
Column,Text, andElevatedButton
π Next Steps
-
Learn about Stateful Widgets
-
Try navigation between pages
-
Build a To-Do app or Quiz app
-
Explore more Flutter UI widgets like
ListView,Container,Image
π§ Final Tip
Flutter is easy to start with and powerful to grow with. Just build small apps and keep experimenting!
Comments
Post a Comment