Code generation with Source_gen (Dart Package of the Week #6)

preview_player
Показать описание
Today's package of the week brings us to the source_gen package. This package allows us to automate code generation in Dart projects, and is the go-to recommendation by the Dart team. Also includes a mini-tutorial on the json_serializable package (Watch till the end!)

Please leave us your feedback in the comments, and let us know what you would like us to demonstrate next! You can reach out in the comments below or on Twitter using #Flutter #Dartlang #Coding #Automation

Like, Subscribe and Hit the Bell 🔔 if you enjoyed this video 😍

LET'S CONNECT
---
Рекомендации по теме
Комментарии
Автор

Hi man! You're amongst the rare people who makes tutorial about these! Really thank you!

randriakotonjanaharytolotr
Автор

Hi Jermaine thanks for this, well presented and very clear.

dsowerby
Автор

Thanks a lot. Exactly what I was looking for.

HighscoreGetter
Автор

How do I handle package imports and generics correctly with Annotation- and normal Generators?

lightgaming
Автор

Thanks, very useful.
I need to generate a single file in the lib folder based on all classes of the application with a certain annotation. What would be the procedure for me to achieve this result?

JeanMerelis
Автор

Can ppl read the source code of these packages like in PHP?

Dabayare
Автор

Hello, it wasn't working for me and wasn't generating example.g.dart at 6:20. (maybe due to new version of the packages). I solved this by modifying my_generators/build.yaml.

You should write
build_extensions: { ".dart": [".info.g.part"] }
instead of
build_extensions: { ".dart": [".info.part"] }

valentinvignal