Dart Package Tutorial – Getting Started

Learn how to create your first Dart package using test-driven development, generate documentation and publish it to pub.dev. By Agustinus Theodorus.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Importing Your Dart Package as Dependencies

To import your package inside your Flutter app, open flutter/pubspec.yaml again and change the dependency to an external one:

my_genderizeio: 1.0.0

Run flutter pub get, and you’ll be good to go!

Build and run your Flutter project.

Flutter project with external package

Where to Go From Here?

You can download the learning materials using the Download Materials button on the top or bottom of the page to compare your results.

Creating a Dart package from scratch is a fairly basic process, and it’s a good learning step to creating and learning Dart overall.

If you’re interested in exploring Dart some more, check out:

I hope you enjoyed making your first Dart package and found this tutorial helpful. Please join the forum discussion below if you have any questions or comments.