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 doctor
in 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