How to Create Dart Packages for Your Flutter Apps

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 37

  • @krishnakumarramachandran5888
    @krishnakumarramachandran5888 4 года назад +8

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

  • @TreyHope
    @TreyHope 2 года назад +1

    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!

  • @rydmike
    @rydmike 4 года назад +7

    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 года назад +8

      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.

  • @gnrslashsp6501
    @gnrslashsp6501 3 года назад +1

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

  • @ThunderboltPath
    @ThunderboltPath 3 года назад

    This is immensely helpful! Thank you, Andrea.

  • @ivanyoed
    @ivanyoed 3 года назад

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

  • @renanmendes35
    @renanmendes35 3 года назад

    Easy to follow and understand. Thank you very much.

  • @Sheikh_Sakibul_Islam
    @Sheikh_Sakibul_Islam 3 года назад

    Excellent Tutorial Dude !!!

  • @NitinGupta12
    @NitinGupta12 3 года назад +1

    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.

  • @ProductionReadyApp
    @ProductionReadyApp 2 года назад

    To the point tutorial.superb👍🏻

  • @moazelsawaf2000
    @moazelsawaf2000 Год назад

    Thanks a lot ❤
    Great Video 🙏🏻❤

  • @ihsanvarol9114
    @ihsanvarol9114 3 года назад

    Thank you for this excellent tutorial.

  • @victormorilla6456
    @victormorilla6456 4 года назад +1

    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 года назад +3

      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

  • @umairjibran7
    @umairjibran7 3 года назад +1

    Awesome Tutorial, Thank you for this.
    also can someone share info about the icon and overall theme?

  • @wongvoonngee3307
    @wongvoonngee3307 4 года назад

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

  • @jenadiusnicholaus3238
    @jenadiusnicholaus3238 2 года назад

    i really appropriate the emerge bro

  • @rikyriky966
    @rikyriky966 4 года назад +2

    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 года назад +1

      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 года назад +1

      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.

  • @simonealessandria8020
    @simonealessandria8020 4 года назад

    Very well done!

  • @saghrounimalek7545
    @saghrounimalek7545 4 года назад +1

    Je vous remercies infiniment pour votre explication.

  • @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 года назад +1

      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

  • @muhammadrashid1577
    @muhammadrashid1577 3 года назад

    Man your awsem...

  • @luisharomtz
    @luisharomtz 4 года назад

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

  • @Proviper666
    @Proviper666 4 года назад

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

  • @graphboss
    @graphboss 3 года назад

    how it works without typing "export" keyword?

  • @laxmirathod1755
    @laxmirathod1755 2 года назад

    Sir plz tell me in a different format

  • @xxafxx
    @xxafxx 3 года назад

    You always talk so fast, bro

  • @Станислав-щ7ф8е
    @Станислав-щ7ф8е 3 года назад

    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';

  • @e7810510
    @e7810510 3 года назад

    Thanks a lot for this tutorial. Really helpful.