Top Flutter Code Generator and Serialization (JSON) packages 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.
freezed_annotation
480
Annotations for the freezed code-generator. This package does nothing without freezed too.
riverpod_generator
397
A code generator for Riverpod. This both simplifies the syntax empowers it, such as allowing stateful hot-reload.
dart_mappable
380
Improved json serialization and data classes with full support for generics, inheritance, customization and more.
mobx_codegen
297
Code generator for MobX that adds support for annotating your code with @observable, @computed, @action and also creating Store classes.
dart_json_mapper
275
This package allows programmers to annotate Dart objects in order to serialize / deserialize them from / to JSON.
flutter_gen_runner
268
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
functional_widget
260
A code generator that generates widget classes from their implementation as a function.
copy_with_extension_gen
199
Automatically generating 'copyWith' extensions code for classes with '@CopyWith()' annotation.
retrofit_generator
168
retrofit generator is an dio client generator using source_gen and inspired by Chopper and Retrofit.
built_value_generator
143
Value types with builders, Dart classes as enums, and serialization. This library is the dev dependency.
injectable_generator
119
Injectable is a convenient code generator for get_it. Inspired by Angular DI, Guice DI and inject.dart.
flutter_asset_generator
98
Automatically generate a resource file by scanning pubspec.yaml to correspond to the flutter's asset, imitation R file short name.
jnigen
96
A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine.
dataclass
62
Code generation for immutable classes that has a simple syntax/API without compromising on the features.
super_annotations
41
Write your code generation functions naturally alongside your normal code. Define and use custom annotations in the same file or project.
pubspec_generator
40
Code generator pubspec.yaml.g.dart from pubspec.yaml. Just import `pubspec_generator` and then run `dart run build_runner build`
stacked_generator
40
Stacked Generator is a package dedicated to reduce the boilerplate required to setup a stacked application
framy_annotation
28
Annotations for framy_generator. This package does nothing without framy_generator.
barrel_files
27
Generate barrel files for Dart and Flutter packages with build_runner based on code annotations
flutterfire_gen
27
flutterfire_gen is a package for automatic code generation for Cloud Firestore. It supports efficient CRUD operations with type-safe interfaces and methods.
index_generator
25
Automatically generate index / barrel / library files with all the export needed for your library.
freezer
24
Provides the easiest and most productive automatic generation of model objects from JSON files.
modular_codegen
24
Code Generate for flutter_modular. Inject Automation. Annotation @Inject, @Param and @Data.
simple_json
21
Simple way to dynamically convert from and to JSON using build-time generators given a type.
gate_generator
21
Dependency Injection generator for your flutter/dart applications. This uses annotations and build_runner.
source_helper
18
Utilities to help with Dart source code generation. Includes utilities for properly generating String literals from any String value.
functional_data
18
Annotations and helpers for lenses for code generated with the 'function_data_generator' package.
morphy
17
Provides a clean class definition with extra functionality including; copy with, json serializable, tostring, equals that supports inheritance and polymorphism
gql_build
15
Useful builders for your GraphQL SDL and documents. Based on package:gql_code_builder and package:build
sum_types
13
sum_types and sum_types_generator packages together define a code generator enabling sum-types in Dart.
kiwi_generator
12
Generates dependency injection code using the kiwi package to reduce development time.
dart_json_mapper_mobx
7
This is a dart-json-mapper complementary package provides support for MobX Stores to persist as JSON.
json_utilities
7
A collection of json utilities to enhance the experience of working with json based models.
json_to_dart
5
A library that generates Dart classes (parse and generator included) from a json string.
dart_json_mapper_flutter
4
This is a dart-json-mapper complementary package provides support for flutter types in order to serialize / deserialize them from / to JSON.
realm_generator
4
Generates RealmObject classes from Realm data model classes. This package is part of the official Realm Flutter and Realm Dart SDKs.
data_serializer
3
Portable Dart package to handle data serialization/deserialization efficiently, including a dynamic BytesBuffer to read/write data.
doc_widget_annotation
2
This is a simple package that contains annotations to generate code in doc_widget
typed_json
2
A library intended to bring manual JSON serialization to the Dart projects of all scales.
flamingo_annotation
1
Automatically generate code for converting flamingo JSON by annotating Dart classes.
brick_offline_first_with_rest_build
1
Code generation library for the Brick Offline First Domain using REST
flamingo_generator
1
Automatically generate code for converting flamingo JSON by annotating Dart classes.
brick_build
1
Code generation library and interface for Brick components. Useful for creating serdes generators for adapters.
dart_json_mapper_fixnum
1
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
1
This is a dart-json-mapper complementary package provides support for built_collection package types in order to serialize / deserialize them from / to JSON.
flutter_gen
0
The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
json_serializable
0
Automatically generate code for converting to and from JSON by annotating Dart classes.
pigeon
0
Code generator tool to make communication between Flutter and the host platform type-safe and easier.
json_annotation
0
Classes and helper functions that support JSON code generation via the 'json_serializable' package.
carp_study_generator
0
Utilities for generating CARP Mobile Sensing studies incl. protocol, informed consent, translations, and messages.
brick_offline_first_with_graphql_build
0
Code generation library for the Brick Offline First Domain using GraphQL
brick_sqlite_generators
0
Code generation library for the SQLite providers, models, and adapters in Brick
brick_json_generators
0
Code generation library for the JSON-like providers, models, and adapters in Brick