Dart Concepts
DSC SVIT�DSC PU
arps18
Topics
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Comments
DSC SVIT�DSC PU
arps18
Comments
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Getters and Setters
DSC SVIT�DSC PU
arps18
Getters and Setters
Getters and Setters
Getters and Setters
Getters & Setters
Syntax: Defining a setter
DSC SVIT�DSC PU
arps18
Sample Code
DSC SVIT�DSC PU
arps18
Inheritance
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Class Inheritance
Syntax
DSC SVIT�DSC PU
arps18
Types of Inheritance
Inheritance can be of the following three types −
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Sample Code
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
SAMPLE CODE
DSC SVIT�DSC PU
arps18
Abstract Methods
DSC SVIT�DSC PU
arps18
Abstract Classes
DSC SVIT�DSC PU
arps18
Syntax for defining Abstract Class
abstract class class_name
{
//Body of Abstract Class
}
DSC SVIT�DSC PU
arps18
Enumerated Types
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Generics
DSC SVIT�DSC PU
arps18
Sample Code
DSC SVIT�DSC PU
arps18
Typedef
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Safety Operators
??
Use ?? when you want to evaluate and return an expression IFF another expression resolves to null.
exp ?? otherExp
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Safety Operators
??=
Use ??= when you want to assign a value to an object IFF that object is null. Otherwise, return the object.
obj ??= value
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Safety Operators
?.
Use ?. when you want to call a method/getter on an object IFF that object is not null (otherwise, return null).
obj?.method()
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Static Keyword
DSC SVIT�DSC PU
arps18
Async
DSC SVIT�DSC PU
arps18
Create a contact.txt file as given below and save it in the current project.
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Future
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
Classes
A class encapsulates data for the object.
Generics
Generics are often required for type safety, Properly specifying generic types results in better generated code & You can use generics to reduce code duplication.
Safety Operators
Collectively known as null-aware operators, these features will help to reduce the code required to work with potentially null objects.
Typedefs
A typedef, or a function-type alias, helps to define pointers to executable code within memory.
Asynchrony support
An asynchronous operation executes in a thread, separate from the main application thread.
DSC SVIT�DSC PU
arps18
Classes
A class encapsulates data for the object.
Generics
Generics are often required for type safety, Properly specifying generic types results in better generated code & You can use generics to reduce code duplication.
Safety Operators
Collectively known as null-aware operators, these features will help to reduce the code required to work with potentially null objects.
Typedefs
A typedef, or a function-type alias, helps to define pointers to executable code within memory.
Asynchrony support
An asynchronous operation executes in a thread, separate from the main application thread.
DSC SVIT�DSC PU
arps18
Classes
A class encapsulates data for the object.
Generics
Generics are often required for type safety, Properly specifying generic types results in better generated code & You can use generics to reduce code duplication.
Safety Operators
Collectively known as null-aware operators, these features will help to reduce the code required to work with potentially null objects.
Typedefs
A typedef, or a function-type alias, helps to define pointers to executable code within memory.
Asynchrony support
An asynchronous operation executes in a thread, separate from the main application thread.
DSC SVIT�DSC PU
arps18
Classes
A class encapsulates data for the object.
Generics
Generics are often required for type safety, Properly specifying generic types results in better generated code & You can use generics to reduce code duplication.
Safety Operators
Collectively known as null-aware operators, these features will help to reduce the code required to work with potentially null objects.
Typedefs
A typedef, or a function-type alias, helps to define pointers to executable code within memory.
Asynchrony support
An asynchronous operation executes in a thread, separate from the main application thread.
DSC SVIT�DSC PU
arps18
Classes
A class encapsulates data for the object.
Generics
Generics are often required for type safety, Properly specifying generic types results in better generated code & You can use generics to reduce code duplication.
Safety Operators
Collectively known as null-aware operators, these features will help to reduce the code required to work with potentially null objects.
Typedefs
A typedef, or a function-type alias, helps to define pointers to executable code within memory.
Asynchrony support
An asynchronous operation executes in a thread, separate from the main application thread.
DSC SVIT�DSC PU
arps18
Comments
Dart supports single-line comments, multi-line comments, and documentation comments.
Enum
Enums are a special kind of class used to represent a fixed number of constant values.
Getters & Setters
allow the program to initialize and retrieve the values of class fields respectively.
Inheritance
Inheritance means that a class can directly inherit from one class to another.
DSC SVIT�DSC PU
arps18
Comments
Dart supports single-line comments, multi-line comments, and documentation comments.
Enum
Enums are a special kind of class used to represent a fixed number of constant values.
Getters & Setters
allow the program to initialize and retrieve the values of class fields respectively.
Inheritance
Inheritance means that a class can directly inherit from one class to another.
DSC SVIT�DSC PU
arps18
Comments
Dart supports single-line comments, multi-line comments, and documentation comments.
Enum
Enums are a special kind of class used to represent a fixed number of constant values.
Getters & Setters
allow the program to initialize and retrieve the values of class fields respectively.
Inheritance
Inheritance means that a class can directly inherit from one class to another.
DSC SVIT�DSC PU
arps18
Comments
Dart supports single-line comments, multi-line comments, and documentation comments.
Enum
Enums are a special kind of class used to represent a fixed number of constant values.
Getters & Setters
allow the program to initialize and retrieve the values of class fields respectively.
Inheritance
Inheritance means that a class can directly inherit from one class to another.
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18
DSC SVIT�DSC PU
arps18