Source code generation in Flutter & Dart (Part 1): Reflection and code gen

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • json_serializable.dart

    Generates utilities to aid in serializing to/from JSON.

  • However, we cannot do this kind of JSON de-serialization in Flutter. Without reflection, we need to consider other approaches for these same tasks. For instance, the package json_serializable uses source code generation for decorating classes with methods to serialize and de-serialize JSON strings.

  • Jackson JSON Processor

    Main Portal page for the Jackson project

  • In this code example, the Jackson mapper uses reflection to find out the type of class it should use to de-serialize the JSON string:

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • mockito

    Mockito-inspired mock library for Dart (by dart-lang)

  • Mockito allows developers to create mock objects from existing classes, stub their methods and verify or assert their behavior during tests.

  • build

    A build system for Dart written in Dart (by dart-lang)

  • build: "Defines the basic pieces of how a build happens and how they interact."

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts