Logo ASILTECHSOFTBY ÜNAL
Blog Flutter

Flutter and Dart Beginner's Guide: For Those Starting from Scratch

Flutter and Dart Beginner's Guide: For Those Starting from Scratch

What are Flutter and Dart?

Four years ago when I first heard about Flutter, I understood how serious Google was about the mobile app development world. Flutter is a framework that allows you to develop iOS and Android applications from a single codebase. Dart, on the other hand, is the programming language behind Flutter.

Why should you learn both together? Because learning Flutter is almost impossible without Dart knowledge. Dart is powerful, fast, and actually quite easy to learn. If you have web development experience, you'll be using Dart comfortably within a week.

Installation: First Steps

To get started, you need to download the official Flutter SDK. Go to flutter.dev and download the version suitable for your operating system. I use Windows and the installation is quite straightforward; unzip the file, add it to your PATH variable, and you're done.

Once installation is complete, run this command in your terminal:

  • flutter doctor – Checks if your system is ready
  • flutter pub global activate – Installs required packages
  • flutter create my_app – Creates your first project

You may see yellow or red warnings in the flutter doctor output. Most of these are due to missing compilers, emulators, or SDKs. It's worth taking the time to resolve them step by step; this infrastructure will help all your future projects.

Understanding Dart Basics

Before moving to Flutter, knowing Dart's fundamental structures saves time. Dart is a type-safe language; this means you must specify what kind of data your variable will hold.

  • Variables: var name = 'Ünal'; or String name = 'Ünal';
  • Functions: void greet(String name) { print('Hello $name'); }
  • Classes: The foundation of object-oriented programming
  • Null Safety: Null pointer errors are eliminated, this is Dart's best feature

The most important point: In Dart, everything is an object. Integers, Strings, even null are objects. This might seem strange at first, but it makes perfect sense once you understand it.

Write Your First Flutter Application

Now we can move to real code. In Flutter, everything starts with a widget. A widget is the basic building block of the user interface; a button, text, box, everything is a widget.

Let's say we want to write a simple counter application. When the user presses a button, the number on the screen will increase. Here's the basic structure:

  • StatelessWidget – For unchanging UI
  • StatefulWidget – For UI that refreshes when state changes
  • Scaffold – Provides page structure (AppBar, body, FAB, etc.)
  • FloatingActionButton – That beautiful round button

For the counter application, you need to use StatefulWidget. Why? Because the number changes and the UI needs to refresh. If you use StatelessWidget, nothing will happen when the button is pressed.

Learn the Layout System

Creating layouts in Flutter can be thought of like flexbox in React. The Row and Column widgets provide horizontal and vertical layouts. All your layout needs revolve around these two widgets.

For more complex layouts, there's Stack (layer widgets on the z-axis), GridView (grid list), and ListView (scrollable list). Practice extensively with Column and Row at the beginning.

Packages and Libraries

You don't want to develop in an empty world. The pub.dev repository has nearly 400,000 packages for Flutter. The http package for HTTP requests, Provider or Riverpod for state management, SQLite for databases – everything is ready to use.

To add a new package, the flutter pub add package_name command is enough. However, I recommend using few packages at first. Once you get comfortable with the language and framework, add packages when you need them.

Closing: Patience and Practice

Learning Flutter is an exciting but patience-requiring journey. In the first week you'll write a few widgets, in the second week you'll develop a simple app, and by the third week you'll be solving real-world problems. The official documentation is excellent and you won't be left with any unanswered questions about Dart. Start right away. KALEM and The Impostor Haini Hunt are developed with Flutter and Dart, and also the AsilTechSoft TV application is too.

Ünal Kaya
Ünal Kaya Asil Tech Soft · Software & Hardware Developer About
Get new posts by email

A few posts a month; no spam, unsubscribe in one click.

Your email is used only to send you new posts. Privacy notice

More Posts

All →
Can — Assistant