VS Code Extensions
Flutter Freezed Helper

Flutter Freezed Helper

by NexusBiharRaunak

A VS Code extension that generates Flutter Freezed model classes from JSON with nested object support, JsonKey mappings, JSON serialization, null safety, and automatic build_runner execution.

Downloads

23

Rating

5.0 / 5 (1)

Version

1.0.3

Last updated

Apr 10, 2026

Generate Freezed model classes from JSON in seconds, right from VS Code.

Installation

Download the extension from:

Features

  • One command – Ctrl+Shift+P → Freezed: Generate Model from JSON
  • Paste any JSON (object or array) and get a fully-typed Freezed class
  • Nested objects automatically become their own Freezed classes
  • Adds @JsonKey(name: '...') when JSON keys differ from Dart conventions
  • Automatically runs dart run build_runner build --delete-conflicting-outputs
  • Right-click any folder in the Explorer → Freezed: Generate Model from JSON (here)

Quick Start

  1. Copy a JSON payload
  2. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  3. Run Freezed: Generate Model from JSON
  4. Enter a class name → paste the JSON → choose a folder
  5. The .dart file is created and build_runner fires automatically

Example

Input JSON:

{
  "user_id": 42,
  "full_name": "Raunak Raj",
  "is_active": true,
  "address": {
    "city": "Delhi",
    "pin_code": "110001"
  }
}

Generated user.dart:

import 'package:freezed_annotation/freezed_annotation.dart';

part 'user.freezed.dart';
part 'user.g.dart';

@freezed
class User with _$User {
  const factory User({
    @JsonKey(name: 'user_id')
    int? userId,
    @JsonKey(name: 'full_name')
    String? fullName,
    @JsonKey(name: 'is_active')
    bool? isActive,
    Address? address,
  }) = _User;

  factory User.fromJson(Map<String, dynamic> json) =>
      _$UserFromJson(json);
}

@freezed
class Address with _$Address {
  const factory Address({
    String? city,
    @JsonKey(name: 'pin_code')
    String? pinCode,
  }) = _Address;

  factory Address.fromJson(Map<String, dynamic> json) =>
      _$AddressFromJson(json);
}

Settings

Setting Default Description
freezedHelper.autoRunBuildRunner true Run build_runner automatically
freezedHelper.jsonSerializable true Add fromJson/toJson support
freezedHelper.nullSafety true Make fields nullable (?)
freezedHelper.buildRunnerCommand dart run build_runner build --delete-conflicting-outputs Custom command

Requirements

Your Flutter project must have freezed, freezed_annotation, and build_runner in pubspec.yaml.

dependencies:
  freezed_annotation: ^2.4.1
  json_annotation: ^4.8.1

dev_dependencies:
  build_runner: ^2.4.7
  freezed: ^2.4.5
  json_serializable: ^6.7.1

Development

For instructions on how to build the extension from source and generate a .vsix file, see BUILD.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.