Dart Tutorial

Dart Tutorial Single-Page Application Architecture Dart Features Dart Installation Guide Dart Basic Program Dart Syntax Dart Keywords Dart Variables Dart Comments Dart Standard Input Output Dart Important Concepts

Data Types

Built-in Data Types Numbers Strings Booleans Lists Sets Maps Runes and Graphemes Symbols Enumerations Constants Queues

Other data types

Objects Future and stream Iterable Miscellaneous types

OPERATORS

Precedence and associativity Arithmetic operators Equality and Relational operators Type Test Operators Assignment Operators Logical Operators Bitwise and Shift Operators Miscellaneous operators

Control Flow Statements

Introduction If statement If-else statement If-else-if statement Loops Switch and case Dart Break And Continue Assert In Dart

FUNCTIONS

Dart function Types of Functions Anonymous function main( ) function Lexical scope and closure Recursion Common Collection Methods

Object Oriented Concepts

Dart Object-Oriented Concepts Dart Classes Dart Constructors Dart This Keyword Dart Super Keyword Static Members Method Overriding Dart Interfaces Inheritance Dart Abstract Classes Dart Builder Classes Dart Callable Classes

Dart Type System

Dart Type System Dart Soundness Dart Type Inference

MISCELLANEOUS

Dart Isolates Dart Typedef Dart Metadata Dart Packages Dart Generics Dart Generators Dart Concurrency Dart Unit Testing Dart Html Dom Dart URIs Dart Extends, With and Implements Keywords Dart Optional Parameters Rust Vs Dart C++ vs Dart Golang Vs Dart Dart Basics Exception Handling

Dart Symbols

Symbols data type in Dart

A symbol is an object that is the representation of an operator or identifier in Dart. These are compile-time constants. 

They are used in APIs that refer to identifiers by name. 

Example,

#radix

Dart symbols are the dynamic strings that are used to derive metadata from a library. Metadata is the data about data. The symbol uses a technique called Reflection to derive the metadata at runtime. 

Conversion of Symbol to String

Dart symbols can be converted to their equivalent string using the built – in class MirrorClass provided by the 'dart:mirror' package. 

Program

import 'dart: mirrors'; 
void main( )
{ 
  Symbol lib = new Symbol( "<sym_lib>" ) ; 
  String name_of_lib = MirrorSystem.getName( lib ) ; 
   
  print( lib ) ; 
  print( name_of_lib ) ; 
} 

Output:

Dart Symbols