How to Build Your First Mobile App with Flutter: A Complete Beginner’s Walkthrough

If you want to build your first Flutter app but don't know where to start, you're in the right place. This guide walks you through the entire process — from installing Flutter on your computer to running a working app on your phone — with clear explanations and working code that you can type along with.
No prior mobile development experience is needed. If you've written even a basic "Hello World" in any programming language, you have enough background to follow along. By the end of this article, you'll have a functional task manager app running on your device and a solid understanding of how Flutter apps are structured.
Pillar Page: Flutter App Development Course at Swift Academy
What Do I Need to Install Before Building a Flutter App?
You need three things: Flutter SDK, an IDE (VS Code or Android Studio), and an Android emulator or physical device for testing. The entire setup takes 30-60 minutes on a stable internet connection and works on Windows, macOS, or Linux.
Step 1: Install Flutter SDK
Windows Installation:
- Download the Flutter SDK from flutter.dev/docs/get-started/install/windows
- Extract the zip file to a location like
C:\flutter(avoid paths with spaces) - Add Flutter to your PATH:
- Search "Environment Variables" in Windows
- Under System Variables, find
Path→ Edit → AddC:\flutter\bin
- Open Command Prompt and run:
# Verify Flutter is installed correctly
flutter doctor
flutter doctor checks your setup and tells you what's missing. You'll likely see warnings about Android SDK — we'll fix that next.
macOS/Linux: Follow the platform-specific guides on docs.flutter.dev.
Step 2: Install an IDE
VS Code (Recommended for beginners):
- Download VS Code
- Install the Flutter extension (it automatically installs Dart extension too)
- Install the Error Lens extension for inline error messages
Android Studio (Alternative):
- Download Android Studio
- During setup, install Android SDK, Android SDK Platform, and Android Virtual Device
- Install the Flutter and Dart plugins via Settings → Plugins
Step 3: Set Up an Android Emulator
- Open Android Studio → More Actions → Virtual Device Manager
- Click "Create Device" → Select "Pixel 7" (or any phone)
- Download a system image (select the latest recommended API level)
- Finish the setup and launch the emulator
Or use your physical phone:
- Enable Developer Options (tap Build Number 7 times in Settings → About Phone)
- Enable USB Debugging in Developer Options
- Connect your phone via USB cable
- Run
flutter devicesto verify it's detected
Step 4: Verify Everything Works
# Run this to check all components
flutter doctor -v
# You should see checkmarks for:
# ✓ Flutter
# ✓ Android toolchain
# ✓ VS Code / Android Studio
# ✓ Connected device
How Do I Create a New Flutter Project?
Open your terminal, navigate to your projects folder, and run flutter create my_first_app. This generates a complete Flutter project with all necessary files, configurations, and a demo counter app that you can run immediately.
# Navigate to where you want to create the project
cd ~/projects
# Create a new Flutter project
flutter create task_manager_app
# Navigate into the project
cd task_manager_app
# Open in VS Code
code .
Understanding the Project Structure
When you open the project, you'll see this file structure:
task_manager_app/
├── android/ # Android-specific code and configs
├── ios/ # iOS-specific code and configs
├── lib/ # YOUR CODE GOES HERE
│ └── main.dart # App entry point
├── test/ # Test files
├── pubspec.yaml # Dependencies and app config
└── README.md
The important files:
lib/main.dart— This is where your app starts. All your Dart code lives in thelib/folder.pubspec.yaml— This is like package.json in Node.js. It lists your dependencies, app name, and assets.
Run the Default App
# Make sure an emulator is running or a device is connected
flutter run
You should see a counter app with a floating action button. Press the button — the counter increases. Congratulations, you've just run your first Flutter app!
How Does a Flutter App Actually Work?
Every Flutter app starts with a main() function that calls runApp() with a root widget. Flutter builds the UI using a tree of widgets — small, reusable components like Text, Container, Column, and Button that nest inside each other to create the complete interface.
Let's replace the default code with something we understand from scratch. Open lib/main.dart and replace everything with:
import 'package:flutter/material.dart';
// Entry point of every Flutter app
void main() {
runApp(const MyApp()); // runApp takes a widget and makes it the root
}
// Root widget - sets up MaterialApp with theme and home screen
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Task Manager',
debugShowCheckedModeBanner: false, // Removes the debug banner
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
home: const HomePage(),
);
}
}
// Home page - a simple screen with text
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('My Task Manager'),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: const Center(
child: Text(
'Hello, Flutter!',
style: TextStyle(fontSize: 24),
),
),
);
}
}
Key Concepts in This Code:
StatelessWidget— A widget that doesn't change. Once built, it stays the same. Good for static UI.MaterialApp— The top-level widget that provides Material Design theming, navigation, and more.Scaffold— Provides the basic visual structure: AppBar, Body, FloatingActionButton, BottomNavigationBar.build()method — Every widget has this method. It returns what the widget looks like.
Save the file. If you have flutter run active, hot reload will update the app instantly (press r in the terminal or save the file in VS Code).
How Do I Add Interactivity with StatefulWidget?
When your UI needs to change based on user actions (like adding tasks, toggling checkboxes, or updating a counter), you use a StatefulWidget instead of StatelessWidget. The setState() method tells Flutter to rebuild the widget with updated data.
Let's convert our app to actually manage tasks. Replace the HomePage class:
// StatefulWidget because our task list will change
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
// Our list of tasks - each task has a name and completion status
final List<Map<String, dynamic>> _tasks = [];
// Controller for the text input field
final TextEditingController _taskController = TextEditingController();
// Add a new task to the list
void _addTask() {
final taskText = _taskController.text.trim();
if (taskText.isNotEmpty) {
setState(() {
_tasks.add({
'name': taskText,
'completed': false,
});
});
_taskController.clear(); // Clear input after adding
}
}
// Toggle task completion status
void _toggleTask(int index) {
setState(() {
_tasks[index]['completed'] = !_tasks[index]['completed'];
});
}
// Delete a task from the list
void _deleteTask(int index) {
setState(() {
_tasks.removeAt(index);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('My Task Manager'),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: Column(
children: [
// Input section - text field + add button
Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
// Expanded makes the text field take remaining space
Expanded(
child: TextField(
controller: _taskController,
decoration: const InputDecoration(
hintText: 'Enter a task...',
border: OutlineInputBorder(),
),
onSubmitted: (_) => _addTask(), // Add on Enter key
),
),
const SizedBox(width: 12), // Spacing
ElevatedButton(
onPressed: _addTask,
child: const Text('Add'),
),
],
),
),
// Task count display
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'${_tasks.length} tasks total',
style: const TextStyle(fontSize: 16, color: Colors.grey),
),
Text(
'${_tasks.where((t) => t['completed']).length} completed',
style: const TextStyle(fontSize: 16, color: Colors.green),
),
],
),
),
const Divider(),
// Task list - Expanded so it takes remaining screen space
Expanded(
child: _tasks.isEmpty
? const Center(
child: Text(
'No tasks yet. Add one above!',
style: TextStyle(fontSize: 18, color: Colors.grey),
),
)
: ListView.builder(
itemCount: _tasks.length,
itemBuilder: (context, index) {
final task = _tasks[index];
return ListTile(
leading: Checkbox(
value: task['completed'],
onChanged: (_) => _toggleTask(index),
),
title: Text(
task['name'],
style: TextStyle(
// Strikethrough text for completed tasks
decoration: task['completed']
? TextDecoration.lineThrough
: TextDecoration.none,
color: task['completed']
? Colors.grey
: Colors.black,
),
),
trailing: IconButton(
icon: const Icon(Icons.delete, color: Colors.red),
onPressed: () => _deleteTask(index),
),
);
},
),
),
],
),
);
}
@override
void dispose() {
_taskController.dispose(); // Clean up the controller
super.dispose();
}
}
What's happening here:
StatefulWidgetsplits into two classes: the widget itself and itsStateclass where mutable data livessetState()is the key method — when you call it, Flutter knows to rebuild the UI with the new dataListView.builderefficiently creates list items only when they're visible on screen (important for long lists)TextEditingControllermanages the text input field and lets us read/clear its valuedispose()cleans up resources when the widget is removed — always dispose controllers
Save and hot reload. You now have a working task manager app!
How Do I Make the App Look Better with Styling?
Flutter uses a widget-based styling approach — instead of CSS, you wrap widgets in other widgets like Padding, Container, and Card to control layout and appearance. Material 3 theming provides consistent colors, typography, and shapes with minimal effort.
Let's improve the task list item with a Card design:
// Replace the ListView.builder's itemBuilder with this
itemBuilder: (context, index) {
final task = _tasks[index];
return Card(
margin: const EdgeInsets.symmetric(
horizontal: 16,
vertical: 4,
),
child: ListTile(
leading: Checkbox(
value: task['completed'],
onChanged: (_) => _toggleTask(index),
activeColor: Colors.green,
),
title: Text(
task['name'],
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: task['completed']
? TextDecoration.lineThrough
: TextDecoration.none,
color: task['completed'] ? Colors.grey : Colors.black87,
),
),
trailing: IconButton(
icon: const Icon(Icons.delete_outline),
color: Colors.red.shade300,
onPressed: () => _deleteTask(index),
),
),
);
},
Common Flutter Layout Widgets:
| Widget | Purpose | CSS Equivalent |
|---|---|---|
Padding |
Add space around a widget | padding |
Container |
Box model with size, color, margin | div with styles |
Row |
Horizontal layout | display: flex; flex-direction: row |
Column |
Vertical layout | display: flex; flex-direction: column |
Expanded |
Fill remaining space | flex: 1 |
SizedBox |
Fixed-size spacing | width / height |
Card |
Material Design card | Card component |
Stack |
Overlay widgets on top of each other | position: relative/absolute |
How Do I Navigate Between Screens?
Flutter uses a Navigator to manage a stack of screens (called Routes). Use Navigator.push() to go to a new screen and Navigator.pop() to go back. Each screen is simply another widget.
Let's add a detail screen when tapping a task:
// Add this new screen class at the bottom of main.dart
class TaskDetailScreen extends StatelessWidget {
final String taskName;
final bool isCompleted;
const TaskDetailScreen({
super.key,
required this.taskName,
required this.isCompleted,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Task Details'),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
taskName,
style: const TextStyle(fontSize: 28, fontWeight: FontWeight.bold),
),
const SizedBox(height: 16),
Row(
children: [
Icon(
isCompleted ? Icons.check_circle : Icons.pending,
color: isCompleted ? Colors.green : Colors.orange,
),
const SizedBox(width: 8),
Text(
isCompleted ? 'Completed' : 'In Progress',
style: TextStyle(
fontSize: 18,
color: isCompleted ? Colors.green : Colors.orange,
),
),
],
),
],
),
),
);
}
}
Now add navigation to the task list tile by adding onTap:
// In your ListTile, add this onTap property
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TaskDetailScreen(
taskName: task['name'],
isCompleted: task['completed'],
),
),
);
},
Tap any task, and you'll navigate to the detail screen. The back button is automatically added by AppBar when you push a new route.
What the Reddit Community Says
Building a first Flutter app is one of the most discussed beginner topics on Reddit.
r/FlutterDev — "What should my first Flutter app be?":
The community consistently recommends starting with a todo/task manager app (exactly what we built!) because it teaches core concepts: widgets, state management, lists, user input, and CRUD operations. One experienced developer noted: "Build a todo app first. Then a weather app with API calls. Then an e-commerce app with authentication. By app #3, you'll be job-ready."
r/learnprogramming — "Flutter feels overwhelming, help!":
A common beginner frustration. The most helpful response: "Ignore 80% of what you see. Start with StatelessWidget, then StatefulWidget, then learn one state management solution (Provider). That covers 90% of what you need for your first real app."
r/FlutterDev — "Hot reload is life-changing":
Multiple threads praise Flutter's hot reload as the biggest advantage for beginners. "I used to spend 30 seconds waiting for native Android builds. In Flutter, I save the file and see changes instantly. It makes learning 10x faster because you can experiment freely."
Swift Academy's Advice: The task manager app in this tutorial covers the essential building blocks. In our Flutter course in Pokhara, we build progressively more complex apps — from this level to full-featured apps with Firebase authentication, cloud databases, and Play Store deployment.
Practical Takeaway: What to Build Next
Now that you've built your first app, here's your roadmap:
- Enhance this app — Add task categories, due dates, and local storage (use the
shared_preferencesorhivepackages) - Build a Weather App — Learn API integration by calling a free weather API
- Build a Notes App — Practice CRUD operations with local database (SQLite/Hive)
- Build a Chat UI — Practice complex layouts and custom widgets
- Enroll in structured training to learn state management, Firebase, and deployment
Each project teaches you new Flutter concepts while building your portfolio.
Frequently Asked Questions
Can I build iOS apps with Flutter on a Windows computer?
You can write Flutter code for iOS on Windows, but you cannot build or test the iOS version without a Mac. Most Nepali students start with Android development on Windows and handle iOS builds later (or use CI/CD services like Codemagic that provide Mac build environments).
How long does it take a complete beginner to build their first Flutter app?
Following a tutorial like this one, you can have a working app in 2-4 hours. Building an app from scratch without a tutorial typically takes 1-2 weeks for a beginner, depending on the app's complexity and how much time you spend debugging.
What's the difference between StatelessWidget and StatefulWidget?
StatelessWidget is for UI that never changes after it's built (like a label or icon). StatefulWidget is for UI that needs to update based on user interaction or data changes (like a checkbox, counter, or dynamic list). Use StatefulWidget when your widget needs to call setState().
Do I need to learn Dart separately before starting Flutter?
Not necessarily. Most Flutter courses and tutorials teach Dart concepts as they come up. However, spending a few days on Dart fundamentals (variables, functions, classes, async/await) before diving into Flutter will make the learning process smoother. See our guide: Dart Programming Language: The Only Guide You Need
Want to go from building simple apps to deploying production-ready mobile applications? Swift Academy's Flutter App Development Course in Pokhara takes you from zero to app store — with hands-on projects, expert code reviews, and career support. Visit swiftacademy.com.np to enroll.




