Documentation

    Table of Content
    • 3D File Formats
      • 3D File Formats
      • 3D2
      • 3DS
      • 3MF
      • AMF
      • ASE
      • DAE
      • DRC
      • FBX
      • GLB
      • GLTF
      • JRXML
      • JT
      • OBJ
      • PLY
      • PRC
      • RVM
      • STEP
      • U3D
      • VRML
      • X
      • X3D
    • Audio File Formats
      • Audio File Formats
      • AAC
      • FLAC
      • M3U
      • MID
      • MKA
      • MP3
      • OGG
      • RA
      • SDT
      • STAP
      • WAV
    • CAD File Formats
      • CAD File Formats
      • CF2
      • DC3
      • DGN
      • DWF
      • DWFX
      • DWG
      • DWT
      • DXF
      • HPGL
      • IFC
      • IGES
      • IGS
      • JVSG
      • NWC
      • NWD
      • NWF
      • PAT
      • PHJ
      • PLT
      • PSM
      • PSS
      • RVT
      • STL
    • Compression File Formats
      • Compression File Formats
      • 7Z
      • ARC
      • ARJ
      • BZ2
      • DAA
      • GZ
      • RAR
      • TAR
      • ZIM
      • ZIP
    • Database
      • Database File Formats
      • ACCDB
      • ACCDE
      • ACCDT
      • ACCFT
      • BAK
      • BCP
      • DDL
      • DTSX
      • LDF
      • MDB
      • MDF
      • MYI
      • NDF
      • NSF
      • SQL
      • SQLITE
    • EBook File Formats
      • EBook File Formats
      • AZW
      • AZW3
      • EPUB
      • FB2
      • KFX
      • LRF
      • LRS
      • LRX
      • MOBI
      • TR
    • Email File Formats
      • Email File Formats
      • EDB
      • EML
      • EMLX
      • ICS
      • MBOX
      • MSG
      • OFT
      • OST
      • PST
      • TNEF
      • VCF - Virtual Contact File
    • Font
      • Font File Formats
      • CFF
      • CFF2
      • EOT
      • FNT
      • FON
      • JFPROJ
      • OTF
      • PFA
      • PFB
      • PFM
      • SFD
      • TTF
      • WOFF
    • GIS File Formats
      • GIS File Formats
      • E00
      • FileGDB
      • GeoJSON
      • GML
      • GPX
      • KML
      • KMZ
      • OSM
      • SHP
    • Image File Formats
      • Image File Formats
      • APNG
      • AVIF
      • BMP
      • CDR
      • CMX
      • DCM
      • DIB
      • DICOM
      • DJVU
      • DNG
      • EMF
      • EMZ
      • EXIF
      • GIF
      • ICO
      • J2K
      • JP2
      • JPEG
      • JXR
      • ODG
      • OTG
      • PNG
      • PSB
      • PSD
      • SVGZ
      • TGA
      • TIFF
      • VDX
      • VSD
      • VSDM
      • VSDX
      • VSS
      • VSSM
      • VSSX
      • VST
      • VSTM
      • VSTX
      • VSX
      • VTX
      • WEBP
      • WMF
      • WMZ
    • Note Taking File Formats
      • Note Taking File Formats
      • ONE
      • ONETOC2
    • Page Description Language
      • Page Description Language
      • CGM
      • EPS
      • PCL
      • PS
      • SVG
      • SWF
      • TEX
      • XPS
      • XSLFO
    • PDF
      • PDF
      • PDF/A
      • PDF/E
      • PDF/UA
      • PDF/VT
      • PDF/X
    • Presentation File Formats
      • Presentation File Formats
      • ODP
      • OTP
      • POT
      • POTM
      • POTX
      • PPS
      • PPSM
      • PPSX
      • PPT
      • PPTM
      • PPTX
    • Programming
      • Programming
      • C
      • Class
      • CPP
      • CS
      • CSPROJ
      • Dart
      • H
      • JAR
      • Java
      • KT
      • MF
      • PDB
      • PHP
      • PY
      • SH
      • SLN
      • SWIFT
      • TOML
      • VB
      • VBPROJ
      • VCXPROJ
      • YAML
    • Project Management File Formats
      • Project Management File Formats
      • MPP
      • MPT
      • MPX
      • XER
    • Spreadsheet File Formats
      • Spreadsheet File Formats
      • CSV
      • DIF
      • ODS
      • OTS
      • TSV
      • XLAM
      • XLM
      • XLS
      • XLSB
      • XLSM
      • XLSX
      • XLT
      • XLTM
      • XLTX
    • Video File Formats
      • Video File Formats
      • 3G2
      • 3GP
      • AVI
      • F4V
      • FLV
      • M4V
      • MKV
      • MOV
      • MP4
      • RM
      • RMVB
      • RV
      • SRT
      • VOB
      • WMV
      • Xvid
    • Web File Formats
      • Web File Formats
      • ASP
      • ASPX
      • CHM
      • CSS
      • HTM
      • HTML
      • JS
      • JSON
      • MHTML
      • Sass
      • SCSS
      • VDW
      • XAML
      • XHTML
      • XML
      • XOML
      • XSLT
    • Word Processing File Formats
      • Word Processing File Formats
      • DOC
      • DOCM
      • DOCX
      • DOT
      • DOTM
      • DOTX
      • MD
      • ODT
      • OTT
      • RTF
      • TXT

    What's on this Page

      • What is a Dart file?
      • Brief History
      • How to open Dart files
      • How to run/execute Dart files
      • Dart File Format
        • Syntax
      • References
    1. Home
    2. Programming
    3. Dart

    What is a Dart file?

    Dart is a client-optimized programming language developed by Google that is used to build apps for mobile, desktop, web, etc. Dart is an object-oriented language with a syntax similar to C. Dart can be compiled to either JavaScript or native code.

    Brief History

    The Dart project was founded by Lars Bak and Kasper Lund and the first version was released on 14th November 2013. Dart was initially criticized for fragmenting the web due to the plans for including a Dart VM in Google Chrome. Those plans were dropped and Dart focused on compiling to JavaScript with the release of version 1.9 in 2015.

    Dart 2.0 was released in August 2018 with a sound type system. With the release of Dart 2.0, the dart2native extension was introduced that compiled Dart code to native Linux, Windows, macOS platforms. This extension enabled self-contained executables due to which the Dart SDK was not required to run Dart apps om those platforms. This extension also integrated with Flutter making it possible to create cross-platform apps.

    ECMA standardized Dart with the first edition in July 2014 and the second edition in December 2014.

    How to open Dart files

    To open Dart files, you can use any text editor. For additional support like code highlighting and code completion, the following can be used:

    • Dart Editor
    • Eclipse with the plugin for Dart
    • IntelliJ IDEA with Dart plugin
    • PyCharm with Dart plugin
    • PhpStorm with Dart plugin
    • WebStorm with Dart plugin
    • Visual Studio with Dart plugin
    • Sublime Text with Dart plugin
    • Atom with Dart plugin
    • Emacs with Dart plugin
    • Vim with Dart plugin

    How to run/execute Dart files

    Dart code can run in the following ways:

    • Compiled as JavaScript: The Dart code is compiled to JavaScript by using the dart2js compiler. The compiled JavaScript code is compatible with all major web browsers.
    • Stand-alone: The Dart Software Development Kit (SDK) ships with a stand-alone Dart VM that allows Dart code to run in the command-line interface. Dart ships with a complete standard library that allows users to write fully functional apps.
    • Ahead-of-time (AOT) compiled: Dart code can be AOT-compiled to machine code that allows mobile apps to be built with Flutter.
    • Native: With the dart2native compiler, Dart code can be compiled to self-contained executables that can run on Windows, Linux, and macOS.

    Dart File Format

    Dart is a C-style object-oriented language that supports interfaces, mixins, abstract classes, reified generics, and type interface.

    Syntax

    The following are some examples of Dart syntax.

    Print to Console

    // print "Hello World" to console
    main() {
      print("Hello, World!");
    }
    

    Loops and Arrays

    // loops and arrays
    var names = {
      'John',
      'James',
      'Rose',
    };
    main() {
      for (var name in names) {
        print(name);
      }
    }
    

    Functions

    // functions
    int double(int x) {
      return x * 2;
    }
    main() {
      print("double of 10 is ${double(10)}");
    }
    

    Classes

    // classes
    abstract class Person {
      detail();
    }
    
    class Student implements Person {
      String firstName = "Jack";
      String lastName = "Wick";
      detail() => print("Student: $firstName $lastName");
    }
    
    main() {
      // The 'new' keyword is optional.
      Student student = Student();
      student.detail();
    }
    

    Mixins

    Mixins are normal classes from which we can borrow methods/variables without inheriting them. This is done by using the “with” keyword.

    class B {  
      method(){
         ....
      }
    }
    
    class A with B {
      ....
         ......
    }
    void main() {
      A a = A();
      a.method();  //We are able to access the method of B class without inheriting from it.
    }
    

    References

    • Dart (programming language) - Wikipedia
    • Dart

    See Also

    • PY File Format
    • KT File Format
    • Java File Format
    • F4V File Format
    • Xvid File Format