Тёмный

How to Create Dart Packages for Your Flutter Apps 

Andrea Bizzotto
Подписаться 39 тыс.
Просмотров 35 тыс.
50% 1

Written tutorial here: 👇👇
codewithandrea.com/videos/202...
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: 👇👇
github.com/bizz84/bmi_calcula...
Want more? Check out all my Flutter courses: 👇👇
codewithandrea.com/courses/
Happy Coding!

Наука

Опубликовано:

 

4 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 37   
@ivanyoed
@ivanyoed 3 года назад
Thanks a lot for this tutorial. Brief and clear! Keep it up Andrea!
@TreyHope
@TreyHope 2 года назад
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!
@TheInvestmentThesis
@TheInvestmentThesis 2 года назад
This is immensely helpful! Thank you, Andrea.
@krishnakumarramachandran5888
@krishnakumarramachandran5888 4 года назад
Thanks a lot brother, Today i learned how to create packages.
@renanmendes35
@renanmendes35 3 года назад
Easy to follow and understand. Thank you very much.
@gnrslashsp6501
@gnrslashsp6501 3 года назад
Just wonderful! With DART and your tutorial, I can make better coded apps!!! Thank you so much!
@ihsanvarol9114
@ihsanvarol9114 3 года назад
Thank you for this excellent tutorial.
@e7810510
@e7810510 3 года назад
Thanks a lot for this tutorial. Really helpful.
@Sheikh_Sakibul_Islam
@Sheikh_Sakibul_Islam 2 года назад
Excellent Tutorial Dude !!!
@ProductionReadyApp
@ProductionReadyApp 2 года назад
To the point tutorial.superb👍🏻
@simonealessandria8020
@simonealessandria8020 3 года назад
Very well done!
@moazelsawaf2000
@moazelsawaf2000 Год назад
Thanks a lot ❤ Great Video 🙏🏻❤
@rydmike
@rydmike 4 года назад
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.
@CodeWithAndrea
@CodeWithAndrea 4 года назад
That's a very good observation, thanks for pointing that out. I may cover export and how to use it as a follow-up tutorial.
@jenadiusnicholaus3238
@jenadiusnicholaus3238 2 года назад
i really appropriate the emerge bro
@saghrounimalek7545
@saghrounimalek7545 3 года назад
Je vous remercies infiniment pour votre explication.
@NitinGupta12
@NitinGupta12 3 года назад
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.
@muhammadrashid1577
@muhammadrashid1577 3 года назад
Man your awsem...
@wongvoonngee3307
@wongvoonngee3307 3 года назад
Thank you, learn a lot from this video. May I know can I create Dart Plugin same way as creating dart packages like this.
@luisharomtz
@luisharomtz 3 года назад
Is it possible to create a package that reads/writes to Firestore?
@victormorilla6456
@victormorilla6456 4 года назад
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?
@CodeWithAndrea
@CodeWithAndrea 4 года назад
Good observation. You can just remove the flutter sdk as a dependency: # flutter: # sdk: flutter And also remove this: #dev_dependencies: # flutter_test: # sdk: flutter
@kevinyeung1787
@kevinyeung1787 4 года назад
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 ?
@kevinyeung1787
@kevinyeung1787 4 года назад
I think i find a solution. Thanks absolute path to file - by adding file:// URI prefix we can reference a library file that is on the computer
@umairjibran7
@umairjibran7 3 года назад
Awesome Tutorial, Thank you for this. also can someone share info about the icon and overall theme?
@abdulmohsenalkhamees4536
@abdulmohsenalkhamees4536 3 года назад
I think it’s called Dark-Dracula?
@rikyriky966
@rikyriky966 4 года назад
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?
@rydmike
@rydmike 4 года назад
ariky If you publish it on pub.dev or any other location from where your package maybe imported into a project, the source code is when you get the package downloaded and cached into the computer using the code. It is easy to find and see this code on the computer and even copy it to another folder and make your own version of it. I think the Syncfusion Flutter charting package is an example, it has a commercial license and its source is not publicly available on GitHub, but the code can still be found and viewed after you include the package in a project, eg by building their demo app.
@CodeWithAndrea
@CodeWithAndrea 4 года назад
I think there are various ways of approaching this. If you want to charge for access to your repo/library, then you could keep it private, and add your customers as collaborators once they paid you. This page has more info on licensing: help.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository I also found this: github.com/mrjoelkemp/awesome-paid-open-source A while ago someone told me they had a product for selectively making parts of a repository paid (and private). I thought it was a great idea, but I can't find the link anymore :/
@rikyriky966
@rikyriky966 4 года назад
Mike Rydstrom a bit late but I didn’t get a notification. Thank you for your insight about this. I thought the same. If it is released somehow, it can be viewed. Thanks for the example too.
@rikyriky966
@rikyriky966 4 года назад
Code With Andrea thank you Andrea. I’m a bit late to response because I didn’t get a notification. Those links are very helpful for me! Thanks for pointing me to the right direction.
@Proviper666
@Proviper666 3 года назад
I wanted to know how to move calculations to another dart file :(
@ertan1147
@ertan1147 2 года назад
how it works without typing "export" keyword?
@laxmirathod1755
@laxmirathod1755 2 года назад
Sir plz tell me in a different format
@xxafxx
@xxafxx 2 года назад
You always talk so fast, bro
@user-vo7lq1jt5v
@user-vo7lq1jt5v 2 года назад
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';
Далее
ЗЕНИТ - РОСТОВ: обзор матча
01:03
Просмотров 182 тыс.
How to build a package in Dart
14:23
Просмотров 17 тыс.
Top 12 Flutter Tips & Tricks
9:32
Просмотров 267 тыс.
The Price of Using Local Packages in Flutter
6:41
Просмотров 8 тыс.
Complex Animations in Flutter using Rive | Flare
15:44
Просмотров 224 тыс.
C interoperability with Dart FFI | Session
13:37
Просмотров 25 тыс.
Top 70 Flutter Tips, Widgets & Packages
16:22
Просмотров 126 тыс.
Flutter Plugin Development
23:55
Просмотров 19 тыс.
Firebase pros and cons (for Flutter app development)
10:57
Dart Pro tips and tricks
3:21
Просмотров 496
Самая редкая видеокарта NVIDIA
1:00