Flutter Gems is a curated list of 7100+ useful Dart & Flutter packages that are categorized based on functionality.
Top Flutter Code Generator and Serialization (JSON) packages
Last updated: March 18, 2026
Code generation is a technique for automatically generating code based on certain input data or rules. In Flutter, code generation is used for a variety of purposes, such as generating code for working with JSON data, generating code for working with databases, and generating code for working with web services. Code generation can make it easier to write and maintain code, as it can automate repetitive tasks and reduce the amount of manual coding that is required.
JSON serialization is the process of converting data from a structured format, such as a JSON object, into a format that can be easily stored or transmitted. In Flutter, JSON serialization is often used for working with data that comes from web services or other external sources. The Flutter framework provides built-in support for serializing and deserializing JSON data, making it easy to work with JSON in your Flutter applications. There are various packages which provides essential tools for encoding Dart objects into JSON and decoding JSON back into Dart objects as well as parsing JSON. This capability proves crucial when fetching data from APIs, managing configuration files, or persisting local app state.
Annotations are a way of adding metadata or additional information to your code. In Flutter, annotations are typically used to provide additional information about the types of data that are used in your code, such as the types of objects that are returned by a function or the types of parameters that are accepted by a method. Annotations can be useful for providing additional context to your code, and can also be used by tools such as IDEs to provide better code completion and error checking.
The complete list of Dart and Flutter Code Generation, JSON Serialization and Annotation packages is provided below.
json_annotation
👍 1.3K ⬇️ 6.8M
Dart 3 compatibleMaintenance Status: Good
Classes and helper functions that support JSON code generation via the `json_serializable` package.
json_serializable
👍 3.91K ⬇️ 2.4M
Dart 3 compatibleMaintenance Status: Good
Automatically generate code for converting to and from JSON by annotating Dart classes.
freezed
👍 4.46K ⬇️ 1.7M
Dart 3 compatibleMaintenance Status: Good
Code generation for immutable classes that has a simple syntax/API without compromising on the features.
source_gen
👍 189 ⬇️ 3.8M
Dart 3 compatibleMaintenance Status: Good
Source code generation builders and utilities for the Dart build system
freezed_annotation
👍 549 ⬇️ 2.5M
Dart 3 compatibleMaintenance Status: Good
Annotations for the freezed code-generator. This package does nothing without freezed too.
source_helper
👍 19 ⬇️ 2.5M
Dart 3 compatibleMaintenance Status: Good
Utilities to help with Dart source code generation. Includes utilities for properly generating String literals from any String value.
flutter_gen
👍 1.72K ⬇️ 107.7K
Dart 3 compatibleMaintenance Status: Good
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
pigeon
👍 1.22K ⬇️ 327.5K
Dart 3 compatibleMaintenance Status: Good
Code generator tool to make communication between Flutter and the host platform type-safe and easier.
ffigen
👍 331 ⬇️ 851.6K
Dart 3 compatibleMaintenance Status: Good
Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.
riverpod_generator
👍 428 ⬇️ 624.1K
Dart 3 compatibleMaintenance Status: Good
A code generator for Riverpod. This both simplifies the syntax empowers it, such as allowing stateful hot-reload.
asn1lib
👍 26 ⬇️ 1M
Dart 3 compatibleMaintenance Status: Good
An ASN1 parser library for Dart. Encodes / decodes from ASN1 Objects to BER bytes
riverpod_annotation
👍 172 ⬇️ 744K
Dart 3 compatibleMaintenance Status: Good
A package exposing annotations for riverpod_generator
flutter_gen_runner
👍 313 ⬇️ 475.2K
Dart 3 compatibleMaintenance Status: Good
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
dart_mappable
👍 446 ⬇️ 262.6K
Dart 3 compatibleMaintenance Status: Good
Improved json serialization and data classes with full support for generics, inheritance, customization and more.
hive_generator
👍 423 ⬇️ 174.1K
Dart 3 compatibleMaintenance Status: Poor
Extension for Hive. Automatically generates TypeAdapters to store any class.
retrofit_generator
👍 195 ⬇️ 346K
Dart 3 compatibleMaintenance Status: Good
retrofit generator is an dio client generator using source_gen and inspired by Chopper and Retrofit.
injectable_generator
👍 131 ⬇️ 387.5K
Dart 3 compatibleMaintenance Status: Good
Injectable is a convenient code generator for get_it. Inspired by Angular DI, Guice DI and inject.dart.
drift_dev
👍 67 ⬇️ 421.4K
Dart 3 compatibleMaintenance Status: Good
Dev-dependency for users of drift. Contains the generator and development tools.
built_value_generator
👍 148 ⬇️ 253K
Dart 3 compatibleMaintenance Status: Good
Value types with builders, Dart classes as enums, and serialization. This library is the dev dependency.
mobx_codegen
👍 300 ⬇️ 46.4K
Dart 3 compatibleMaintenance Status: Good
Code generator for MobX that adds support for annotating your code with @observable, @computed, @action and also creating Store classes.
widgetbook_annotation
👍 19 ⬇️ 325.7K
Dart 3 compatibleMaintenance Status: Good
A package featuring the annotations used by widgetbook_generator.
copy_with_extension_gen
👍 214 ⬇️ 72.8K
Dart 3 compatibleMaintenance Status: Good
Automatically generating `copyWith` extensions code for classes with `@CopyWith()` annotation.
dart_json_mapper
👍 279 ⬇️ 2.4K
Dart 3 compatibleMaintenance Status: Good
This package allows programmers to annotate Dart objects in order to serialize / deserialize them from / to JSON.
graphql_codegen
👍 150 ⬇️ 99.3K
Dart 3 compatibleMaintenance Status: Good
Simple, opinionated, codegen library for GraphQL. It allows you to generate serializers and client helpers to easily call and parse your data.
widgetbook_generator
👍 20 ⬇️ 235.3K
Dart 3 compatibleMaintenance Status: Good
A package to automate setup and maintenance of the widgetbook package by using code generation.
protoc_plugin
👍 94 ⬇️ 128.2K
Dart 3 compatibleMaintenance Status: Good
A protobuf protoc compiler plugin used to generate Dart code.
auto_mappr
👍 138 ⬇️ 10.9K
Dart 3 compatibleMaintenance Status: Good
Code generation for mapping between different objects with ease.
jnigen
👍 125 ⬇️ 7.4K
Dart 3 compatibleMaintenance Status: Good
A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine.
functional_data
👍 19 ⬇️ 98.4K
Dart 3 compatibleMaintenance Status: Average
Annotations and helpers for lenses for code generated with the `function_data_generator` package.
flutter_asset_generator
👍 110 ⬇️ 1.3K
Dart 3 compatibleMaintenance Status: Average
Generates the resource file by scanning assets defined in the pubspec.yaml, imitation R file short name.
sum_types
👍 13 ⬇️ 51.9K
Dart 3 compatibleMaintenance Status: Average
sum_types and sum_types_generator packages together define a code generator enabling sum-types in Dart.
stacked_generator
👍 46 ⬇️ 12.6K
Dart 3 compatibleMaintenance Status: Good
Stacked Generator is a package dedicated to reduce the boilerplate required to setup a stacked application
super_annotations
👍 49 ⬇️ 180
Dart 3 compatibleMaintenance Status: Good
Write your code generation functions naturally alongside your normal code. Define and use custom annotations in the same file or project.
index_generator
👍 33 ⬇️ 12.6K
Dart 3 compatibleMaintenance Status: Good
Automatically generate index / barrel / library files with all the export needed for your library.
pubspec_generator
👍 44 ⬇️ 1K
Dart 3 compatibleMaintenance Status: Good
Code generator pubspec.yaml.g.dart from pubspec.yaml. Just import `pubspec_generator` and then run `dart run build_runner build`
embed
👍 34 ⬇️ 11.4K
Dart 3 compatibleMaintenance Status: Good
Code generation for embedding arbitrary file content into Dart code.
json_model
👍 44 ⬇️ 882
Dart 3 compatibleMaintenance Status: Poor
Gernerating Dart model class from Json files with one command.
isar_generator
👍 37 ⬇️ 1.2K
Dart 3 compatibleMaintenance Status: Poor
Code generator for the Isar Database. Finds classes annotated with @Collection.
ferry_generator
👍 23 ⬇️ 13.8K
Dart 3 compatibleMaintenance Status: Good
Generated types for Ferry GraphQL Client
barrel_files
👍 34 ⬇️ 1.4K
Dart 3 compatibleMaintenance Status: Good
Generate barrel files for Dart and Flutter packages with build_runner based on code annotations
dson_adapter
👍 31 ⬇️ 25
Dart 3 compatibleMaintenance Status: Poor
Convert JSON to Dart Class withless code generate(build_runner)
realm_generator
👍 4 ⬇️ 27.7K
Dart 3 compatibleMaintenance Status: Good
Generates RealmObject classes from Realm data model classes. This package is part of the official Realm Flutter and Realm Dart SDKs.
cached_build_runner
👍 28 ⬇️ 366
Dart 3 compatibleMaintenance Status: Poor
Optimizes the build_runner by caching generated codes for non changed .dart files
flutterfire_gen
👍 28 ⬇️ 224
Dart 3 compatibleMaintenance Status: Good
flutterfire_gen is a package for automatic code generation for Cloud Firestore. It supports efficient CRUD operations with type-safe interfaces and methods.
cached_annotation
👍 23 ⬇️ 4.7K
Dart 3 compatibleMaintenance Status: Good
Annotations for the Cached code-generator. This package does nothing without Cached.
modular_codegen
👍 24 ⬇️ 119
Dart 3 compatibleMaintenance Status: Poor
Code Generate for flutter_modular. Inject Automation. Annotation @Inject, @Param and @Data.
gate_generator
👍 22 ⬇️ 62
Dart 3 compatibleMaintenance Status: Poor
Dependency Injection generator for your flutter/dart applications. This uses annotations and build_runner.
kiwi_generator
👍 13 ⬇️ 9K
Dart 3 compatibleMaintenance Status: Average
Generates dependency injection code using the kiwi package to reduce development time.
simple_json
👍 21 ⬇️ 171
Dart 3 compatibleMaintenance Status: Poor
Simple way to dynamically convert from and to JSON using build-time generators given a type.
sqfentity_gen
👍 19 ⬇️ 1K
Dart 3 compatibleMaintenance Status: Average
SqfnEntity Model Generator. SQLite ORM for Flutter lets you build and execute SQL commands easily and quickly with the help of fluent methods similar to .Net Entity Framework.
data_class_plugin
👍 18 ⬇️ 1.5K
Dart 3 compatibleMaintenance Status: Good
A tool that uses Dart's Analyzer to generate code on-the-fly.
morphy
👍 18 ⬇️ 67
Dart 3 compatibleMaintenance Status: Good
Provides a clean class definition with extra functionality including; copy with, json serializable, tostring, equals that supports inheritance and polymorphism
gql_build
👍 15 ⬇️ 1.5K
Dart 3 compatibleMaintenance Status: Good
Useful builders for your GraphQL SDL and documents. Based on package:gql_code_builder and package:build
dogs_core
👍 10 ⬇️ 293
Dart 3 compatibleMaintenance Status: Good
universal object mapping and serialization library with a focus on dx.
data_serializer
👍 3 ⬇️ 5.5K
Dart 3 compatibleMaintenance Status: Average
Portable Dart package to handle data serialization/deserialization efficiently, including a dynamic BytesBuffer to read/write data.
borsh_annotation
👍 1 ⬇️ 6.6K
Dart 3 compatibleMaintenance Status: Average
Annotation used to make a Dart object borsh serializable.
dart_json_mapper_mobx
👍 7 ⬇️ 140
Dart 3 compatibleMaintenance Status: Poor
This is a dart-json-mapper complementary package provides support for MobX Stores to persist as JSON.
flutter_ast
👍 7 ⬇️ 20
Dart 3 compatibleMaintenance Status: Poor
A Pure Dart File to Ast Serializer/Deserializer.
chopper_built_value
👍 6 ⬇️ 665
Dart 3 compatibleMaintenance Status: Good
A built_value based Converter for Chopper.
json_to_dart
👍 5 ⬇️ 171
Dart 3 compatibleMaintenance Status: Poor
A library that generates Dart classes (parse and generator included) from a json string.
borsh
👍 5 ⬇️ 153
Dart 3 compatibleMaintenance Status: Good
Implementation of the borsh serialization scheme
dart_json_mapper_flutter
👍 4 ⬇️ 105
Dart 3 compatibleMaintenance Status: Poor
This is a dart-json-mapper complementary package provides support for https://github.com/flutter/flutter types in order to serialize / deserialize them from / to JSON.
json_model_gen
👍 4 ⬇️ 58
Dart 3 compatibleMaintenance Status: Good
A Dart tool to generate model classes from JSON with fromJson, toJson, copyWith, and equality overrides.
doc_widget_annotation
👍 2 ⬇️ 358
Dart 3 compatibleMaintenance Status: Poor
This is a simple package that contains annotations to generate code in doc_widget
envify_generator
👍 2 ⬇️ 286
Dart 3 compatibleMaintenance Status: Poor
Code generator for envify, a better tool to handle environment variables.
brick_build
👍 1 ⬇️ 1.2K
Dart 3 compatibleMaintenance Status: Good
Code generation library and interface for Brick components. Useful for creating serdes generators for adapters.
typed_json
👍 2 ⬇️ 26
Dart 3 compatibleMaintenance Status: Poor
A library intended to bring manual JSON serialization to the Dart projects of all scales.
brick_offline_first_with_rest_build
👍 1 ⬇️ 369
Dart 3 compatibleMaintenance Status: Good
Code generation library for the Brick Offline First Domain using REST
flamingo_generator
👍 1 ⬇️ 204
Dart 3 compatibleMaintenance Status: Poor
Automatically generate code for converting flamingo JSON by annotating Dart classes.
flamingo_annotation
👍 1 ⬇️ 83
Dart 3 compatibleMaintenance Status: Poor
Automatically generate code for converting flamingo JSON by annotating Dart classes.
dart_json_mapper_fixnum
👍 1 ⬇️ 59
Dart 3 compatibleMaintenance Status: Poor
This is a dart-json-mapper complementary package provides support for https://pub.dev/packages/fixnum types in order to serialize / deserialize them from / to JSON.
simple_assets_generator
👍 1 ⬇️ 54
Dart 3 compatibleMaintenance Status: Poor
Assets generator package.
brick_sqlite_generators
👍 0 ⬇️ 1.1K
Dart 3 compatibleMaintenance Status: Good
Code generation library for the SQLite providers, models, and adapters in Brick
dart_json_mapper_built
👍 1 ⬇️ 43
Dart 3 compatibleMaintenance Status: Poor
This is a dart-json-mapper complementary package provides support for https://pub.dev/packages/built_collection types in order to serialize / deserialize them from / to JSON.
brick_offline_first_build
👍 0 ⬇️ 926
Dart 3 compatibleMaintenance Status: Good
Code generation library for the Brick Offline First Domain
brick_json_generators
👍 0 ⬇️ 905
Dart 3 compatibleMaintenance Status: Good
Code generation library for the JSON-like providers, models, and adapters in Brick
brick_rest_generators
👍 0 ⬇️ 420
Dart 3 compatibleMaintenance Status: Good
Code generation library for the REST providers, models, and adapters in Brick
brick_graphql_generators
👍 0 ⬇️ 183
Dart 3 compatibleMaintenance Status: Good
Code generation library for the GraphQL providers, models, and adapters in Brick
carp_study_generator
👍 0 ⬇️ 153
Dart 3 compatibleMaintenance Status: Average
Utilities for managing CARP Mobile Sensing studies, including generating and uploading a study protocol, informed consent, translations, and messages.
brick_offline_first_with_graphql_build
👍 0 ⬇️ 101
Dart 3 compatibleMaintenance Status: Good
Code generation library for the Brick Offline First Domain using GraphQL
simple_auth_generator
👍 0 ⬇️ 58
Dart 3 compatibleMaintenance Status: Poor
simple_auth is an http client generator using source_gen and inspired from retrofit and chopper
gql_code_builder
👍 5 ⬇️ 176.8K
Maintenance Status: Good
Dart code builders taking *.graphql documents and SDL to build useful classes.
dataclass
👍 62 ⬇️ 79
Maintenance Status: Average
Code generation for immutable classes that has a simple syntax/API without compromising on the features.
data_class
👍 60 ⬇️ 51
Maintenance Status: Average
Experimental support for data classes in Dart using pkg:macros
framy_annotation
👍 28 ⬇️ 47
Maintenance Status: Poor
Annotations for framy_generator. This package does nothing without framy_generator.
json_utilities
👍 7 ⬇️ 46
Maintenance Status: Poor
A collection of json utilities to enhance the experience of working with json based models.
