Skip to main content

Command Palette

Search for a command to run...

Dart Core Libraries

Updated
2 min read
Dart Core Libraries

Overview

dart:core

The dart:core library is automatically imported into every Dart program. It provides fundamental types, collections, utilities, and annotations that are essential for Dart programming. Some key features include:

  • Core types like int, double, String, bool, etc.

  • Collection classes such as List, Set, Map, and Iterable.

  • Useful utilities like DateTime for working with dates and times.

  • Annotations like override and deprecated for annotating code.

2. dart:async

The dart:async library is used for asynchronous programming in Dart. It provides classes and utilities for working with asynchronous operations, including:

  • Futures and Completers for representing asynchronous computations.

  • Streams and StreamControllers for working with streams of data.

  • Timers and asynchronous error handling mechanisms.

3. dart:collection

The dart:collection library provides specialized collection classes that are not available in the core dart:core library. These include:

  • Queue for a collection that supports adding and removing elements efficiently.

  • LinkedList for a doubly-linked list implementation.

  • HashMap and LinkedHashMap for implementing hash tables.

4. dart:math

The dart:math library offers mathematical constants and functions for common mathematical operations. Key features include:

  • Mathematical constants like pi and e.

  • Functions for trigonometry, logarithms, exponentiation, random number generation, etc.

5. dart:convert

The dart:convert library provides encoders and decoders for converting between different data representations. This includes:

  • JSON encoding and decoding using jsonEncode and jsonDecode.

  • UTF-8 encoding and decoding using utf8.encode and utf8.decode.

  • Base64 encoding and decoding using base64.encode and base64.decode.

6. dart:io

The dart:io library allows Dart programs to interact with the file system, sockets, processes, and other I/O operations. Note that this library is typically used in server-side or command-line applications, not in web applications.

Dart

Part 8 of 50

I'll be here to provide explanations, examples, and assistance as you explore the depths of Dart programming language. Together, we'll unravel the intricacies of Dart, from its fundamental concepts to

Up next

Effective Dart: Usage

Libraries The preferred syntax is to use a URI string that points directly to the library file. If you have some library, my_library.dart, that contains: library my_library; part 'some/other/file.dart'; Then the part file should use the library file...

More from this blog

Flutter Journey with Jinali

141 posts