Dart: Libraries

Dart: Libraries

ยท

1 min read

Libraries are a key concept in Flutter and Dart, and they are used to organize and reuse code in your app.

Libraries are collections of functions, classes, and variables that can be imported into other parts of your code and used to perform a wide range of tasks.

In Flutter, libraries are used to provide access to various features and functionality, such as UI elements, animations, networking, and more.

Flutter provides a number of built-in libraries, such as the material library, which contains the material design UI elements, and the Cupertino library, which contains the Cupertino design UI elements. To use a library in Flutter, you need to import it into your code using the import statement.

There are many Library in Dart and flutter which we can use it.

For , Importing library we need to write " import ' libarary_name '; "

Library :

import 'dart:html';
import 'package:test/test.dart';
import 'package:lib1/lib1.dart';
//When name comflicts between two library at that time we can use "as".
import 'package:lib2/lib2.dart' as lib2;
// Import only foo.
import 'package:lib1/lib1.dart' show foo;
// Import all names EXCEPT foo.
import 'package:lib2/lib2.dart' hide foo;

There are many way we can can call library in file , I have write some example above.

ย