How to Create Dart Packages for Your Flutter Apps

preview_player
Показать описание
Written tutorial here: 👇👇

How to create your own Dart packages from existing apps, and other things you need to know.

Includes a step-by-step guide, showing how to convert a sample BMI calculator application to use internal packages within the same project.

Also included:

- Dealing with existing, large apps
- Reusing packages across multiple apps
- Local vs remove (git) packages
- Versioning packages and the humble changelog

HIGHLIGHTS

00:00 - Intro
01:23 - Overview of the starter project (BMI calculator)
03:13 - Creating a new package and using it in the main app
06:52 - Recap: moving code to packages
07:30 - Organizing package code with part and part of
09:40 - Creating packages from complex apps
10:38 - How to reuse packages across multiple projects
12:05 - Package versioning and changelog

Starter project source code: 👇👇

Want more? Check out all my Flutter courses: 👇👇

Happy Coding!
Рекомендации по теме
Комментарии
Автор

Thank you for such a great explanation. I've been curious about creating my own packages for the longest, and the idea was daunting thinking it would be a difficult process. I'm glad it's fairly simple. Keep up the good content!

TreyHope
Автор

Thanks a lot brother, Today i learned how to create packages.

krishnakumarramachandran
Автор

Thanks a lot for this tutorial. Brief and clear! Keep it up Andrea!

ivanyoed
Автор

This is immensely helpful! Thank you, Andrea.

TheInvestmentThesis
Автор

Easy to follow and understand. Thank you very much.

renanmendes
Автор

Thank you for this excellent tutorial.

ihsanvarol
Автор

Thanks a lot for this tutorial. Really helpful.

e
Автор

Just wonderful! With DART and your tutorial, I can make better coded apps!!! Thank you so much!

gnrslashsp
Автор

Thanks Andrea, excellent tutorial again!
Instead of using the part of setup, I would also mention/recommend the /src sub folder structure with your classes/functions as files in it, and then in the package root folder exporting only the classes that are a part of the API the package needs to expose. This as per the guides in Dart/Flutter libs documentation. Sure for smaller libs Part of, is ok too. Although in the Flutter style guide wiki using Part is not recommended even as a general practice, with the rationale that it may create spaghetti code that is harder to reason about, over the layered lasagna model.

rydmike
Автор

Je vous remercies infiniment pour votre explication.

saghrounimalek
Автор

Hey Andrea, thanks for this excellent tutorial. I am having trouble creating a Monorep for packages. Can you please do a tutorial on that. Or share any guides/references. Again, thanks.

NitinGupta
Автор

Thank you, learn a lot from this video. May I know can I create Dart Plugin same way as creating dart packages like this.

wongvoonngee
Автор

Is it possible to create a package that reads/writes to Firestore?

luisharomtz
Автор

Enjoyed the video. Thanks a lot. One question: the package you create has no flutter dependencies and it might be a good candidate for a pure dart package. How would you achieve this?

victormorilla
Автор

Awesome Tutorial, Thank you for this.

also can someone share info about the icon and overall theme?

umairjibran
Автор

Thanks andrea, i follow u from your course and in youtube. It really helps a lot for my coding skill.

I would like to ask, if i want to share the package locally for different apps, may i know how to handle it ?

kevinyeung
Автор

Hi Andrea! Thanks for this great video again. I have a question for you if you’d like to answer.

I have developed a fairly complex widget especially for working on Flutter Web. It is aimed for enterprise webapps and it has a commercial value.

Can I turn it into a private package? (I think I can’t) I’d like people not to see the source code but to use widget in their apps.

In other words, can I provide people commercial paid licensing to use my package?

rikyriky
Автор

I wanted to know how to move calculations to another dart file :(

Proviper
Автор

how it works without typing "export" keyword?

ertan
Автор

Thanks for video. Just I noticed that you use syntax with library name \\ part of my_library \\ while official documentation tells that its bad syntax and exists for legacy reasons, instead recommended to use URI string that points directly to the library file. part of '../my_library.dart';

volqjtv