Flutter Gems is a curated list of 4900+ useful Dart & Flutter packages that are categorized based on functionality.

Medium LinkedIn Twitter Discord

Top Flutter Code Generator and Serialization (JSON) packages

Last updated: May 20, 2023

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.

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.


freezed
Null safety 👍 2.82K
Maintenance Status: Good

Code generation for immutable classes that has a simple syntax/API without compromising on the features.

json_serializable
Null safety 👍 2.71K
Maintenance Status: Good

Automatically generate code for converting to and from JSON by annotating Dart classes.

flutter_gen
Null safety 👍 923
Maintenance Status: Good

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

json_annotation
Null safety 👍 822
Maintenance Status: Good

Classes and helper functions that support JSON code generation via the 'json_serializable' package.

pigeon
Null safety 👍 675
Maintenance Status: Good

Code generator tool to make communication between Flutter and the host platform type-safe and easier.

freezed_annotation
Null safety 👍 305
Maintenance Status: Good

Annotations for the freezed code-generator. This package does nothing without freezed too.

hive_generator
Null safety 👍 264
Maintenance Status: Good

Extension for Hive. Automatically generates TypeAdapters to store any class.

mobx_codegen
Null safety 👍 251
Maintenance Status: Good

Code generator for MobX that adds support for annotating your code with @observable, @computed, @action and also creating Store classes.

dart_json_mapper
Null safety 👍 236
Maintenance Status: Good

This package allows programmers to annotate Dart objects in order to serialize / deserialize them from / to JSON.

swagger_dart_code_generator
Null safety 👍 223
Maintenance Status: Good

Have you been turned into a problem with writing code for Http requests? This package can help. It has all of the Http and model codegen functionality you have been looking for.

riverpod_generator
Null safety 👍 202
Maintenance Status: Good

A code generator for Riverpod. This both simplifies the syntax empowers it, such as allowing stateful hot-reload.

ffigen
Null safety 👍 196
Maintenance Status: Good

Generator for FFI bindings, using LibClang to parse C header files.

copy_with_extension_gen
Null safety 👍 141
Maintenance Status: Good

Automatically generating 'copyWith' extensions code for classes with '@CopyWith()' annotation.

flutter_gen_runner
Null safety 👍 122
Maintenance Status: Good

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

built_value_generator
Null safety 👍 119
Maintenance Status: Good

Value types with builders, Dart classes as enums, and serialization. This library is the dev dependency.

source_gen
Null safety 👍 114
Maintenance Status: Good

Source code generation builders and utilities for the Dart build system

retrofit_generator
Null safety 👍 86
Maintenance Status: Good

retrofit generator is an dio client generator using source_gen and inspired by Chopper and Retrofit.

dart_mappable
Null safety 👍 85
Maintenance Status: Good

Improved json serialization and data classes with full support for generics, inheritance, customization and more.

crimson
Null safety 👍 85
Maintenance Status: Good

Fast, efficient and easy-to-use JSON parser and serializer for Dart.

graphql_codegen
Null safety 👍 78
Maintenance Status: Good

Simple, opinionated, codegen library for GraphQL. It allows you to generate serializers and client helpers to easily call and parse your data.

injectable_generator
Null safety 👍 74
Maintenance Status: Good

Injectable is a convenient code generator for get_it. Inspired by Angular DI, Guice DI and inject.dart.

openapi_generator
Null safety 👍 72
Maintenance Status: Good

Generator for openapi client sdk inspired by the npm implementation of openapi-generator-cli.

protoc_plugin
Null safety 👍 66
Maintenance Status: Good

Protoc compiler plugin to generate Dart code

json_to_model
Null safety 👍 46
Maintenance Status: Good

Generate model class from Json file.

auto_mappr
Null safety 👍 40
Maintenance Status: Good

Code generation for mapping between different objects with ease.

stacked_generator
Null safety 👍 34
Maintenance Status: Good

Stacked Generator is a package dedicated to reduce the boilerplate required to setup a stacked application

freezer
Null safety 👍 23
Maintenance Status: Good

Provides the easiest and most productive automatic generation of model objects from JSON files.

gate_generator
Null safety 👍 21
Maintenance Status: Good

Dependency Injection generator for your flutter/dart applications. This uses annotations and build_runner.

drift_dev
Null safety 👍 21
Maintenance Status: Good

Dev-dependency for users of drift. Contains the generator and development tools.

sqfentity_gen
Null safety 👍 19
Maintenance Status: Good

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.

ferry_generator
Null safety 👍 18
Maintenance Status: Good

Generated types for Ferry GraphQL Client

isar_generator
Null safety 👍 16
Maintenance Status: Good

Code generator for the Isar Database. Finds classes annotated with @Collection.

gql_build
Null safety 👍 14
Maintenance Status: Good

Useful builders for your GraphQL SDL and documents. Based on package:gql_code_builder and package:build

build_cli
Null safety 👍 14
Maintenance Status: Good

Parse command line arguments directly into an annotation class using the power of build_runner and source_gen.

widgetbook_generator
Null safety 👍 13
Maintenance Status: Good

A package to automate setup and maintanance of the widgetbook package by using code generation.

sum_types
Null safety 👍 12
Maintenance Status: Good

sum_types and sum_types_generator packages together define a code generator enabling sum-types in Dart.

widgetbook_annotation
Null safety 👍 10
Maintenance Status: Good

A package featuring the annotations used by widgetbook_generator.

kiwi_generator
Null safety 👍 10
Maintenance Status: Good

Generates dependency injection code using the kiwi package to reduce development time.

chopper_built_value
Null safety 👍 5
Maintenance Status: Good

A built_value based Converter for Chopper.

flutter_ast
Null safety 👍 4
Maintenance Status: Good

A Pure Dart File to Ast Serializer/Deserializer.

realm_generator
Null safety 👍 3
Maintenance Status: Good

Generates RealmObject classes from Realm data model classes. This package is part of the official Realm Flutter and Realm Dart SDKs.

gql_code_builder
Null safety 👍 2
Maintenance Status: Good

Dart code builders taking *.graphql documents and SDL to build useful classes.

envify_generator
Null safety 👍 2
Maintenance Status: Good

Code generator for envify, a better tool to handle environment variables.

flamingo_generator
Null safety 👍 1
Maintenance Status: Good

Automatically generate code for converting flamingo JSON by annotating Dart classes.

flamingo_annotation
Null safety 👍 1
Maintenance Status: Good

Automatically generate code for converting flamingo JSON by annotating Dart classes.

brick_build
Null safety 👍 1
Maintenance Status: Good

Code generation library and interface for Brick components. Useful for creating serdes generators for adapters.

borsh_annotation
Null safety 👍 1
Maintenance Status: Good

Annotation used to make a Dart object borsh serializable.

simple_assets_generator
Null safety 👍 0
Maintenance Status: Good

Assets generator package.

carp_study_generator
Null safety 👍 0
Maintenance Status: Good

Utilities for generating CARP Mobile Sensing studies incl. protocol, informed consent, translations, and messages.

brick_sqlite_generators
Null safety 👍 0
Maintenance Status: Good

Code generation library for the SQLite providers, models, and adapters in Brick

brick_rest_generators
Null safety 👍 0
Maintenance Status: Good

Code generation library for the REST providers, models, and adapters in Brick

brick_offline_first_with_rest_build
Null safety 👍 0
Maintenance Status: Good

Code generation library for the Brick Offline First Domain using REST

brick_offline_first_with_graphql_build
Null safety 👍 0
Maintenance Status: Good

Code generation library for the Brick Offline First Domain using GraphQL

brick_offline_first_build
Null safety 👍 0
Maintenance Status: Good

Code generation library for the Brick Offline First Domain

brick_json_generators
Null safety 👍 0
Maintenance Status: Good

Code generation library for the JSON-like providers, models, and adapters in Brick

brick_graphql_generators
Null safety 👍 0
Maintenance Status: Good

Code generation library for the GraphQL providers, models, and adapters in Brick

flutter_asset_generator
Null safety 👍 43
Maintenance Status: Average

Automatically generate a resource file by scanning pubspec.yaml to correspond to the flutter's asset, imitation R file short name.

json_model
Null safety 👍 38
Maintenance Status: Average

Gernerating Dart model class from Json files with one command.

modular_codegen
Null safety 👍 24
Maintenance Status: Average

Code Generate for flutter_modular. Inject Automation. Annotation @Inject, @Param and @Data.

simple_json
Null safety 👍 19
Maintenance Status: Average

Simple way to dynamically convert from and to JSON using build-time generators given a type.

dart_json_mapper_mobx
Null safety 👍 7
Maintenance Status: Average

This is a dart-json-mapper complementary package provides support for MobX Stores to persist as JSON.

json_to_dart
Null safety 👍 5
Maintenance Status: Average

A library that generates Dart classes (parse and generator included) from a json string.

dart_json_mapper_flutter
Null safety 👍 4
Maintenance Status: Average

This is a dart-json-mapper complementary package provides support for flutter types in order to serialize / deserialize them from / to JSON.

doc_widget_annotation
Null safety 👍 2
Maintenance Status: Average

This is a simple package that contains annotations to generate code in doc_widget

dart_json_mapper_fixnum
Null safety 👍 1
Maintenance Status: Average

This is a dart-json-mapper complementary package provides support for fixnum package types in order to serialize / deserialize them from / to JSON.

dart_json_mapper_built
Null safety 👍 1
Maintenance Status: Average

This is a dart-json-mapper complementary package provides support for built_collection package types in order to serialize / deserialize them from / to JSON.

simple_auth_generator
Null safety 👍 0
Maintenance Status: Average

simple_auth is an http client generator using source_gen and inspired from retrofit and chopper

functional_data
Null safety 👍 16
Maintenance Status: Poor

Annotations and helpers for lenses for code generated with the 'function_data_generator' package.

framy_annotation
👍 29
Maintenance Status: Poor

Annotations for framy_generator. This package does nothing without framy_generator.

json_utilities
👍 7
Maintenance Status: Poor

A collection of json utilities to enhance the experience of working with json based models.