Flutter Gems is a curated list of 7250+ useful Dart & Flutter packages that are categorized based on functionality.
Top Flutter Code Generator and Serialization (JSON) packages
Last updated: May 18, 2026
Code generation automates the creation of tedious boilerplate codeβsuch as JSON serialization, API clients, and routing tablesβdrastically reducing human error and development time.
Best Practices for Code Generation
- Build Runner Optimization: The
build_runnercommand can take minutes to execute on massive projects. Use thebuild.yamlfile to restrict code generation to specific directories (likelib/models/) to significantly speed up the build process. - Commit Generated Files: Always commit your generated
.g.dartor.freezed.dartfiles to version control. Forcing every developer (or your CI/CD server) to runbuild_runnerfrom scratch on a fresh clone is a massive waste of time. - Freezed for Models: Use the
freezedpackage for complex data models. It automatically generates union types, deep copy mechanisms (copyWith), and immutable state structures that are impossible to maintain manually.
The complete list of Code Generators, JSON Serialization (json_serializable), and Boilerplate Automation packages is provided below.
json_annotation
π 1.3K β¬οΈ 7.8M
Dart 3 compatibleMaintenance Status: Good
Classes and helper functions that support JSON code generation via the `json_serializable` package.
json_serializable
π 3.93K β¬οΈ 2.7M
Dart 3 compatibleMaintenance Status: Good
Automatically generate code for converting to and from JSON by annotating Dart classes.
freezed
π 4.49K β¬οΈ 2M
Dart 3 compatibleMaintenance Status: Good
Code generation for immutable classes that has a simple syntax/API without compromising on the features.
source_gen
π 189 β¬οΈ 4.4M
Dart 3 compatibleMaintenance Status: Good
Source code generation builders and utilities for the Dart build system
freezed_annotation
π 553 β¬οΈ 2.8M
Dart 3 compatibleMaintenance Status: Good
Annotations for the freezed code-generator. This package does nothing without freezed too.
source_helper
π 19 β¬οΈ 2.8M
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.73K β¬οΈ 112.8K
Dart 3 compatibleMaintenance Status: Good
The Flutter code generator for your assets, fonts, colors, β¦ β Get rid of all String-based APIs.
pigeon
π 1.23K β¬οΈ 428.5K
Dart 3 compatibleMaintenance Status: Good
Code generator tool to make communication between Flutter and the host platform type-safe and easier.
riverpod_generator
π 430 β¬οΈ 733.3K
Dart 3 compatibleMaintenance Status: Good
A code generator for Riverpod. This both simplifies the syntax empowers it, such as allowing stateful hot-reload.
ffigen
π 332 β¬οΈ 807.7K
Dart 3 compatibleMaintenance Status: Good
Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.
asn1lib
π 26 β¬οΈ 1.1M
Dart 3 compatibleMaintenance Status: Good
An ASN1 parser library for Dart. Encodes / decodes from ASN1 Objects to BER bytes
riverpod_annotation
π 175 β¬οΈ 886K
Dart 3 compatibleMaintenance Status: Good
A package exposing annotations for riverpod_generator
dart_mappable
π 455 β¬οΈ 327.2K
Dart 3 compatibleMaintenance Status: Good
Improved json serialization and data classes with full support for generics, inheritance, customization and more.
flutter_gen_runner
π 318 β¬οΈ 451.5K
Dart 3 compatibleMaintenance Status: Good
The Flutter code generator for your assets, fonts, colors, β¦ β Get rid of all String-based APIs.
hive_generator
π 424 β¬οΈ 175.8K
Dart 3 compatibleMaintenance Status: Poor
Extension for Hive. Automatically generates TypeAdapters to store any class.
retrofit_generator
π 199 β¬οΈ 374.5K
Dart 3 compatibleMaintenance Status: Good
retrofit generator is an dio client generator using source_gen and inspired by Chopper and Retrofit.
drift_dev
π 68 β¬οΈ 513.4K
Dart 3 compatibleMaintenance Status: Good
Dev-dependency for users of drift. Contains the generator and development tools.
injectable_generator
π 133 β¬οΈ 431.5K
Dart 3 compatibleMaintenance Status: Good
Injectable is a convenient code generator for get_it. Inspired by Angular DI, Guice DI and inject.dart.
built_value_generator
π 148 β¬οΈ 281.5K
Dart 3 compatibleMaintenance Status: Good
Value types with builders, Dart classes as enums, and serialization. This library is the dev dependency.
mobx_codegen
π 301 β¬οΈ 54.1K
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 β¬οΈ 379.3K
Dart 3 compatibleMaintenance Status: Good
A package featuring the annotations used by widgetbook_generator.
copy_with_extension_gen
π 219 β¬οΈ 101.2K
Dart 3 compatibleMaintenance Status: Good
Automatically generating `copyWith` extensions code for classes with `@CopyWith()` annotation.
dart_json_mapper
π 279 β¬οΈ 2K
Dart 3 compatibleMaintenance Status: Good
This package allows programmers to annotate Dart objects in order to serialize / deserialize them from / to JSON.
graphql_codegen
π 151 β¬οΈ 132.2K
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 β¬οΈ 264K
Dart 3 compatibleMaintenance Status: Good
A package to automate setup and maintenance of the widgetbook package by using code generation.
protoc_plugin
π 96 β¬οΈ 156K
Dart 3 compatibleMaintenance Status: Good
A protobuf protoc compiler plugin used to generate Dart code.
jnigen
π 129 β¬οΈ 28.6K
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.
auto_mappr
π 140 β¬οΈ 11.7K
Dart 3 compatibleMaintenance Status: Good
Code generation for mapping between different objects with ease.
flutter_asset_generator
π 111 β¬οΈ 1.5K
Dart 3 compatibleMaintenance Status: Average
Generates the resource file by scanning assets defined in the pubspec.yaml, imitation R file short name.
functional_data
π 19 β¬οΈ 110.8K
Dart 3 compatibleMaintenance Status: Poor
Annotations and helpers for lenses for code generated with the `function_data_generator` package.
sum_types
π 13 β¬οΈ 57.5K
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 β¬οΈ 120
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.
pubspec_generator
π 45 β¬οΈ 858
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`
macro_kit
π 45 β¬οΈ 455
Dart 3 compatibleMaintenance Status: Good
A development-time macro system for Dart that generates code instantly for fast iteration without build_runner.
ferry_generator
π 23 β¬οΈ 26.8K
Dart 3 compatibleMaintenance Status: Good
Generated types for Ferry GraphQL Client
json_model
π 44 β¬οΈ 641
Dart 3 compatibleMaintenance Status: Poor
Gernerating Dart model class from Json files with one command.
embed
π 34 β¬οΈ 10.8K
Dart 3 compatibleMaintenance Status: Good
Code generation for embedding arbitrary file content into Dart code.
index_generator
π 33 β¬οΈ 11.9K
Dart 3 compatibleMaintenance Status: Good
Automatically generate index / barrel / library files with all the export needed for your library.
isar_generator
π 38 β¬οΈ 998
Dart 3 compatibleMaintenance Status: Poor
Code generator for the Isar Database. Finds classes annotated with @Collection.
barrel_files
π 34 β¬οΈ 543
Dart 3 compatibleMaintenance Status: Good
Generate barrel files for Dart and Flutter packages with build_runner based on code annotations
dson_adapter
π 31 β¬οΈ 21
Dart 3 compatibleMaintenance Status: Poor
Convert JSON to Dart Class withless code generate(build_runner)
cached_build_runner
π 29 β¬οΈ 137
Dart 3 compatibleMaintenance Status: Poor
Optimizes the build_runner by caching generated codes for non changed .dart files
flutterfire_gen
π 28 β¬οΈ 290
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.9K
Dart 3 compatibleMaintenance Status: Good
Annotations for the Cached code-generator. This package does nothing without Cached.
modular_codegen
π 24 β¬οΈ 109
Dart 3 compatibleMaintenance Status: Poor
Code Generate for flutter_modular. Inject Automation. Annotation @Inject, @Param and @Data.
gql_build
π 15 β¬οΈ 10.6K
Dart 3 compatibleMaintenance Status: Good
Useful builders for your GraphQL SDL and documents. Based on package:gql_code_builder and package:build
gate_generator
π 22 β¬οΈ 57
Dart 3 compatibleMaintenance Status: Poor
Dependency Injection generator for your flutter/dart applications. This uses annotations and build_runner.
simple_json
π 21 β¬οΈ 98
Dart 3 compatibleMaintenance Status: Poor
Simple way to dynamically convert from and to JSON using build-time generators given a type.
data_class_plugin
π 18 β¬οΈ 3.5K
Dart 3 compatibleMaintenance Status: Good
A tool that uses Dart's Analyzer to generate code on-the-fly.
sqfentity_gen
π 19 β¬οΈ 1.7K
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.
realm_generator
π 4 β¬οΈ 18.1K
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.
morphy
π 18 β¬οΈ 40
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
kiwi_generator
π 13 β¬οΈ 2.7K
Dart 3 compatibleMaintenance Status: Average
Generates dependency injection code using the kiwi package to reduce development time.
dogs_core
π 10 β¬οΈ 280
Dart 3 compatibleMaintenance Status: Good
universal object mapping and serialization library with a focus on dx.
data_serializer
π 3 β¬οΈ 5.4K
Dart 3 compatibleMaintenance Status: Good
Portable Dart package to handle data serialization/deserialization efficiently, including a dynamic BytesBuffer to read/write data.
dart_json_mapper_mobx
π 7 β¬οΈ 90
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 β¬οΈ 16
Dart 3 compatibleMaintenance Status: Poor
A Pure Dart File to Ast Serializer/Deserializer.
chopper_built_value
π 6 β¬οΈ 671
Dart 3 compatibleMaintenance Status: Good
A built_value based Converter for Chopper.
borsh_annotation
π 1 β¬οΈ 6.6K
Dart 3 compatibleMaintenance Status: Average
Annotation used to make a Dart object borsh serializable.
json_to_dart
π 6 β¬οΈ 73
Dart 3 compatibleMaintenance Status: Poor
A library that generates Dart classes (parse and generator included) from a json string.
borsh
π 5 β¬οΈ 84
Dart 3 compatibleMaintenance Status: Good
Implementation of the borsh serialization scheme
dart_json_mapper_flutter
π 4 β¬οΈ 96
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 β¬οΈ 28
Dart 3 compatibleMaintenance Status: Good
A Dart tool to generate model classes from JSON with fromJson, toJson, copyWith, and equality overrides.
brick_build
π 1 β¬οΈ 3.6K
Dart 3 compatibleMaintenance Status: Good
Code generation library and interface for Brick components. Useful for creating serdes generators for adapters.
brick_offline_first_with_rest_build
π 1 β¬οΈ 2.5K
Dart 3 compatibleMaintenance Status: Good
Code generation library for the Brick Offline First Domain using REST
brick_sqlite_generators
π 0 β¬οΈ 3.6K
Dart 3 compatibleMaintenance Status: Good
Code generation library for the SQLite providers, models, and adapters in Brick
brick_json_generators
π 0 β¬οΈ 3.5K
Dart 3 compatibleMaintenance Status: Good
Code generation library for the JSON-like providers, models, and adapters in Brick
brick_offline_first_build
π 0 β¬οΈ 3.5K
Dart 3 compatibleMaintenance Status: Good
Code generation library for the Brick Offline First Domain
doc_widget_annotation
π 2 β¬οΈ 559
Dart 3 compatibleMaintenance Status: Poor
This is a simple package that contains annotations to generate code in doc_widget
envify_generator
π 2 β¬οΈ 134
Dart 3 compatibleMaintenance Status: Poor
Code generator for envify, a better tool to handle environment variables.
brick_rest_generators
π 0 β¬οΈ 2.6K
Dart 3 compatibleMaintenance Status: Good
Code generation library for the REST providers, models, and adapters in Brick
typed_json
π 2 β¬οΈ 15
Dart 3 compatibleMaintenance Status: Poor
A library intended to bring manual JSON serialization to the Dart projects of all scales.
flamingo_generator
π 1 β¬οΈ 102
Dart 3 compatibleMaintenance Status: Poor
Automatically generate code for converting flamingo JSON by annotating Dart classes.
flamingo_annotation
π 1 β¬οΈ 60
Dart 3 compatibleMaintenance Status: Poor
Automatically generate code for converting flamingo JSON by annotating Dart classes.
dart_json_mapper_fixnum
π 1 β¬οΈ 46
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.
dart_json_mapper_built
π 1 β¬οΈ 31
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.
simple_assets_generator
π 1 β¬οΈ 21
Dart 3 compatibleMaintenance Status: Poor
Assets generator package.
brick_graphql_generators
π 0 β¬οΈ 209
Dart 3 compatibleMaintenance Status: Good
Code generation library for the GraphQL providers, models, and adapters in Brick
carp_study_generator
π 0 β¬οΈ 179
Dart 3 compatibleMaintenance Status: Good
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 β¬οΈ 158
Dart 3 compatibleMaintenance Status: Good
Code generation library for the Brick Offline First Domain using GraphQL
simple_auth_generator
π 0 β¬οΈ 42
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 β¬οΈ 223.3K
Maintenance Status: Good
Dart code builders taking *.graphql documents and SDL to build useful classes.
dataclass
π 62 β¬οΈ 62
Maintenance Status: Average
Code generation for immutable classes that has a simple syntax/API without compromising on the features.
data_class
π 60 β¬οΈ 34
Maintenance Status: Average
Experimental support for data classes in Dart using pkg:macros
json_to_model
π 46 β¬οΈ 300
Maintenance Status: Poor
Generate model class from Json file.
framy_annotation
π 28 β¬οΈ 59
Maintenance Status: Poor
Annotations for framy_generator. This package does nothing without framy_generator.
json_utilities
π 7 β¬οΈ 18
Maintenance Status: Poor
A collection of json utilities to enhance the experience of working with json based models.
