• Guides
    • Getting started with Dart
  • Blog
  • FAQ
    • Dart
    • Flutter
  • Contact
  • Guides
    • Getting started with Dart
  • Blog
  • FAQ
    • Dart
    • Flutter
  • Contact
  • Getting Started with Dart
    • Dart Variables
    • Dart Operators
    • Dart Comments
  • Dart Data Types
    • Dart Strings
    • Dart Numbers
    • Dart Booleans
    • Dart Lists
    • Dart Maps
  • Control Flow
    • Dart if...else Statements
    • Dart switch Statement
    • Dart for Loop
    • Dart for...in Loop
    • Dart while and do...while Loops
    • break and continue Statements
  • Dart Functions
  • Dart Classes
  • Dart Objects
  • Dart Constructors
  • Dart Exceptions

Getting Started with Dart

1572 views 3

Written by fawesomeapps
December 7, 2021
Flutter Guide- Getting started with Dart
Flutter Guide- Getting started with Dart

Dart is a client-optimized language for fast apps on any platform. In this guide, you will learn about a way to run Dart on your computer. Let’s get started with Dart.

  • Dart is an open-source programming language that is developed by Google. Dart is an object-oriented language.
  • We can use Dart on the server side as well as on the client-side.
  • Dart is generally used to create single-page websites and web applications. The Gmail application uses dart programming language.
  • Dart has become popular along with the Flutter framework for developing cross-platform mobile apps.

Hello World Program

Let’s see how we can run a dart program on our computers.

Here we will learn to create our first program hello_world that will print the text hello world.

void main() {
  print("Hello World!");
}

The dart program starts with the main keyword. Before main, we are using the void which denotes that the main function won’t return anything.

The parentheses after main indicate that it is a function and all the codes are written inside the curly braces.

To run the program,

  1. Copy and paste the above code in a file with the filename hello_world.dart. The .dart extension denotes that it is a dart program.
hello world program in dart

2. Open the terminal/command prompt. Navigate to the file location and type

         dart hello_world.dart.

run hello world program

      3. You will get the Hello World! output on the terminal.


There are other ways to run a dart program.

However, we are going to use this method explained above as this is the easiest one.

Now that we know how to run a dart program, let’s start with the fundamentals of the dart programming language.

Next Chapter: Variables.

Was this helpful?

3 Yes  No
Related Articles
  • Dart Constructors
  • Dart Exceptions
  • Dart Objects
  • Dart Classes
  • Control Flow
  • Dart Functions
Up Next
Dart Variables
flutter-dev-experts




FLUTTERGUIDE
FlutterGuide is an easy learning guide platform to help you build apps for any screen. The leading Dart/Flutter guides for getting started and become pro.
Guides
  • Private Documentation 1
  • Getting started with Dart 22
Categories
  • Firebase
  • Dart
  • iOS
  • API
  • Bloc
  • Flutter
  • Widgets
  • Mobile
  • State Management
  • Design
  • Animations
  • Flutter Designs
About
About Us
Guides
Blogs
FAQs
Contact
  • Privacy Policy
  • Terms & Conditions
  • Copyright 2022 Fawesome Apps. All Rights Reserved