Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create libraries for Dart?

Tags:

dart

dartium

How can I create libraries using Dart?

I want to start porting some JavaScript (and other languages) libraries I've created to Dart.

like image 853
Nathan Campos Avatar asked Feb 02 '23 06:02

Nathan Campos


1 Answers

Just put this in your library file (first place):

library mylibraryname;

You can then import this lib with:

import "path/to/mylibraryname.dart";

Other options are available, for example part which acts as include.

For a more in-depth tutorial I recommend you this blog post from Dartwatch.

like image 192
Christian Avatar answered Feb 05 '23 17:02

Christian